/* =============================================
   Single product page
   ============================================= */

.single-product-page {
	padding: 40px 0 64px;
}

/* Two simple columns — gallery / summary. This grid only ever has
   two direct children now (gallery, summary), so there's no
   auto-placement risk for anything else. */
.product-layout {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	column-gap: 56px;
}

/* ---- Gallery — sizes itself per breakpoint ---- */
.product-gallery__main {
	position: relative;
	aspect-ratio: 1 / 1;
	max-height: 560px;
	background: var(--color-bg-alt);
	border-radius: 20px;
	overflow: hidden;
}

.product-gallery__main img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.product-gallery__placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #f0f0f0, #e2e2e2);
}

.product-gallery__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: var(--color-accent);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 4px 10px;
	border-radius: 999px;
}

.product-gallery__thumbs {
	display: flex;
	gap: 10px;
	margin-top: 12px;
	overflow-x: auto;
}

.product-gallery__thumb {
	flex: 0 0 60px;
	width: 60px;
	height: 60px;
	border-radius: 12px;
	overflow: hidden;
	border: 2px solid transparent;
	padding: 0;
	background: var(--color-bg-alt);
	cursor: pointer;
	opacity: 0.55;
	transition: border-color 0.15s ease, opacity 0.15s ease;
}

.product-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.product-gallery__thumb.is-active,
.product-gallery__thumb:hover {
	border-color: var(--color-accent);
	opacity: 1;
}

/* ---- Summary ---- */
.product-summary__title {
	font-size: 1.6rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 0 0 10px;
}

.product-summary__price {
	font-size: 1.6rem;
	font-weight: 700;
	margin-bottom: 14px;
}

.product-summary__price ins {
	color: var(--color-accent);
	font-weight: 700;
	text-decoration: none;
}

.product-summary__price del {
	color: var(--color-text-muted);
	font-size: 1rem;
	font-weight: 400;
	margin-right: 8px;
}

/* ---- Quick-fact pills: availability + category ---- */
.product-quickfacts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.product-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid var(--color-border);
	color: var(--color-text);
}

.product-pill--category:hover {
	border-color: var(--color-accent);
	color: var(--color-accent);
}

.product-pill__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.product-pill--instock {
	border-color: rgba(30, 190, 91, 0.35);
	color: var(--color-success);
}

.product-pill--outofstock {
	border-color: rgba(220, 60, 60, 0.35);
	color: var(--color-error);
}

/* ---- Rating summary ---- */
.product-summary__rating {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.product-summary__rating .star-rating {
	color: var(--color-accent);
	font-size: 0.95rem;
}

.product-summary__rating-count {
	font-size: 0.85rem;
	color: var(--color-text-muted);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.product-summary__rating-count:hover {
	color: var(--color-accent);
}

/* ---- Buy box: quantity row on top, Add to Cart + WhatsApp aligned below ---- */
.product-buybox {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 440px;
}

/* Quantity stepper sits alone in its own row */
.product-buybox__qty-row {
	display: flex;
}

.quantity-stepper {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	overflow: hidden;
	flex: 0 0 148px;
	width: 148px;
	height: 48px;
}

.quantity-stepper__btn {
	width: 40px;
	background: transparent;
	border: none;
	font-size: 1.1rem;
	color: var(--color-text-muted);
	cursor: pointer;
	transition: color 0.15s ease;
}

.quantity-stepper__btn:hover {
	color: var(--color-accent);
}

.quantity-stepper__input {
	flex: 1;
	min-width: 0;
	border: none;
	text-align: center;
	font-size: 0.95rem;
	background: transparent;
	-moz-appearance: textfield;
}

.quantity-stepper__input::-webkit-outer-spin-button,
.quantity-stepper__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Add to Cart + WhatsApp — perfectly aligned, equal width, side by side */
.product-buybox__actions-row {
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.product-buybox__actions-row > a {
	flex: 1;
	min-width: 0;
	height: 48px;
}

/* Add to Cart — solid accent fill, primary action */
.product-buybox__cart-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 16px;
	border-radius: 999px;
	background: var(--color-accent);
	color: #fff;
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-buybox__cart-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.product-buybox__cart-btn .cart-icon-added {
	display: none;
}

.product-buybox__cart-btn.is-added {
	background: var(--color-success);
}

.product-buybox__cart-btn.is-added .cart-icon-default {
	display: none;
}

.product-buybox__cart-btn.is-added .cart-icon-added {
	display: block;
}

/* WhatsApp — solid green fill, same size as Add to Cart, sits alongside it */
.product-buybox__whatsapp-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 16px;
	border-radius: 999px;
	background: #25d366;
	color: #fff;
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.product-buybox__whatsapp-btn:hover {
	background: #1ebe5b;
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(37, 211, 102, 0.28);
}

/* =============================================
   Short description — ONE block combining the intro text, the parsed
   "Label: Value" spec rows, and SKU/Brand/Tags. Sits directly under
   the buy box. This is the WordPress "short description" field,
   shown as a single section instead of being split across two.
   ============================================= */
.product-short-description {
	margin-top: 28px;
	padding-top: 24px;
	border-top: 1px solid var(--color-border);
}

.product-short-description__intro {
	color: var(--color-text-muted);
	font-size: 0.92rem;
	line-height: 1.6;
	margin-bottom: 22px;
}

.product-short-description__intro p {
	margin: 0 0 0.6em;
}

.product-short-description__intro p:last-child {
	margin-bottom: 0;
}

/* ---- One bordered table card, split into labeled sections
   (Specifications / Product Details) — reads as a single connected
   table instead of loose floating rows. ---- */
.product-specs-card {
	border: 1px solid var(--color-border);
	border-radius: 16px;
	overflow: hidden;
	background: var(--color-bg);
}

.product-specs-card__section {
	padding: 20px;
}

.product-specs-card__section + .product-specs-card__section {
	border-top: 1px solid var(--color-border);
}

.product-specs-card__label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-text-muted);
	margin: 0 0 14px;
}

.product-specs-table {
	display: flex;
	flex-direction: column;
}

.product-specs-row {
	display: grid;
	grid-template-columns: 150px 1fr;
	gap: 14px;
	padding: 10px 0;
	border-bottom: 1px solid var(--color-border);
}

.product-specs-row:last-child {
	border-bottom: none;
}

/* Zebra striping, bled out to the card's own edges — reinforces the
   "this is one continuous table" read */
.product-specs-row:nth-child(even) {
	background: var(--color-bg-alt);
	margin: 0 -20px;
	padding: 10px 20px;
	border-bottom-color: transparent;
}

.product-specs-row__label {
	font-size: 0.8rem;
	color: var(--color-text-muted);
	font-weight: 500;
}

.product-specs-row__value {
	font-size: 0.85rem;
	color: var(--color-text);
	font-weight: 500;
}

.product-specs-row__value a {
	color: var(--color-text);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.product-specs-row__value a:hover {
	color: var(--color-accent);
}

/* ---- Shared section title (Description / Reviews / Related) ---- */
.product-section-title {
	font-size: 1.3rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 0 0 20px;
}

/* =============================================
   Description — the product's full description field. Lives OUTSIDE
   .product-layout entirely (see the template), so it's never subject
   to grid auto-placement. Left-aligned, not centered: it starts flush
   with the container's left edge on every screen size.
   ============================================= */
.product-description-section {
	max-width: 860px;
	margin: 48px 0 0;
	padding-top: 44px;
	border-top: 1px solid var(--color-border);
}

.product-description-content {
	color: var(--color-text-muted);
	font-size: 0.93rem;
	line-height: 1.6;
}

.product-description-content p {
	margin-bottom: 0.75em;
}

/* =============================================
   Reviews — modern card treatment
   ----------------------------------------------
   Anchored on #product-reviews (the section's real ID) rather than
   .product-reviews-section, and the review-form rules go further and
   anchor on #respond / #commentform too. WooCommerce ships its own
   review-form CSS using selectors like ".woocommerce #respond
   input#submit" — two IDs plus a class. A same-order class-only
   selector loses that fight regardless of load order, since ID
   specificity always outranks class specificity. Matching WooCommerce's
   own ID usage here is what makes these rules actually win.
   ============================================= */

#product-reviews {
	max-width: 860px;
	margin: 40px 0 0;
	padding-top: 40px;
	border-top: 1px solid var(--color-border);
}

#product-reviews #reviews {
	font-family: inherit;
}

#product-reviews .woocommerce-Reviews-title {
	display: none;
}

#product-reviews .commentlist,
#product-reviews ol.commentlist {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

#product-reviews .comment_container {
	display: flex;
	gap: 16px;
	padding: 20px;
	border: 1px solid var(--color-border);
	border-radius: 18px;
	background: var(--color-bg-alt);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

#product-reviews .comment_container:hover {
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
	transform: translateY(-1px);
}

#product-reviews .comment_container img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	flex-shrink: 0;
}

#product-reviews .comment-text {
	flex: 1;
}

#product-reviews .star-rating {
	color: var(--color-accent);
	font-size: 0.9rem;
	margin-bottom: 8px;
}

#product-reviews .meta {
	font-size: 0.83rem;
	color: var(--color-text-muted);
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

#product-reviews .meta strong {
	color: var(--color-text);
	font-weight: 600;
}

/* Reviewer name + date — current WooCommerce outputs these as separate
   elements, not wrapped in a single .meta div like older versions did. */
#product-reviews .woocommerce-review__author,
#product-reviews .woocommerce-review__published-date {
	font-size: 0.83rem;
	color: var(--color-text-muted);
}

#product-reviews .woocommerce-review__author {
	font-weight: 600;
	color: var(--color-text);
}

#product-reviews .woocommerce-review__dash {
	color: var(--color-text-muted);
	margin: 0 4px;
}

#product-reviews .woocommerce-review__author,
#product-reviews .woocommerce-review__dash,
#product-reviews .woocommerce-review__published-date {
	display: inline;
}

#product-reviews .description p {
	margin: 0;
	font-size: 0.89rem;
	color: var(--color-text);
	line-height: 1.6;
}

/* ---- The review form itself: #respond / #commentform, per the DOM
   inspector — matching those IDs directly is what beats WooCommerce's
   own ID-based defaults. ---- */
#product-reviews #respond {
	border-top: 1px solid var(--color-border);
	padding-top: 28px;
	margin-top: 4px;
}

#product-reviews #reply-title {
	font-size: 1.15rem;
	font-weight: 600;
	margin-bottom: 16px;
}

#product-reviews #reply-title small {
	font-size: 0.75rem;
	font-weight: 500;
	margin-left: 8px;
}

#product-reviews #commentform .comment-form-rating select,
#product-reviews .comment-form-rating select {
	border: 1px solid var(--color-border);
	border-radius: 10px;
	padding: 8px 12px;
	font-family: inherit;
	background: var(--color-bg);
}

#product-reviews #commentform p.comment-form-author input#author,
#product-reviews #commentform p.comment-form-email input#email,
#product-reviews #commentform textarea#comment,
#product-reviews .comment-form input[type="text"],
#product-reviews .comment-form input[type="email"],
#product-reviews .comment-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	font-family: inherit;
	font-size: 0.9rem;
	margin-bottom: 14px;
	background: var(--color-bg);
	transition: border-color 0.15s ease;
}

#product-reviews #commentform input#author:focus-visible,
#product-reviews #commentform input#email:focus-visible,
#product-reviews #commentform textarea#comment:focus-visible,
#product-reviews .comment-form input[type="text"]:focus-visible,
#product-reviews .comment-form input[type="email"]:focus-visible,
#product-reviews .comment-form textarea:focus-visible {
	outline: none;
	border-color: var(--color-accent);
}

#product-reviews #commentform p.form-submit,
#product-reviews .form-submit {
	margin: 0;
}

/* The submit button carries id="submit" in WooCommerce's markup, and
   Woo's own stylesheet targets it as "#respond input#submit" — two
   IDs. We match #respond + #submit here too, so ours always wins. */
#product-reviews #respond input#submit,
#product-reviews #commentform input#submit,
#product-reviews .form-submit input[type="submit"] {
	background: var(--color-accent);
	color: #fff;
	border: none;
	padding: 12px 26px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#product-reviews #respond input#submit:hover,
#product-reviews #commentform input#submit:hover,
#product-reviews .form-submit input[type="submit"]:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
	background: var(--color-accent);
	color: #fff;
}

/* ---- Product carousels: Related / Category / Brand ---- */
.product-carousel-section {
	max-width: var(--container-max, 1240px);
	margin: 40px auto 0;
	padding-top: 40px;
	border-top: 1px solid var(--color-border);
}

.product-carousel__track {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 8px;
}

.product-carousel__track .deal-card {
	flex: 0 0 calc((100% - 4 * 16px) / 4.5);
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 880px) {
	.product-layout {
		grid-template-columns: 1fr;
		row-gap: 28px;
	}

	.product-gallery__main {
		aspect-ratio: 4 / 3;
		max-height: 420px;
	}

	#product-reviews .comment_container {
		flex-direction: column;
	}

	/* Specs stay a clean two-column row on mobile too — a narrower
	   fixed label column, same divider style, no stacking. This is
	   what keeps the flow readable instead of messy on small screens. */
	.product-specs-card__section {
		padding: 16px;
	}

	.product-specs-row {
		grid-template-columns: 110px 1fr;
		gap: 10px;
	}

	.product-specs-row:nth-child(even) {
		margin: 0 -16px;
		padding: 10px 16px;
	}

	.product-specs-row__label {
		font-size: 0.76rem;
	}

	.product-specs-row__value {
		font-size: 0.8rem;
	}

	.product-carousel__track .deal-card {
		flex: 0 0 calc((100% - 2 * 16px) / 2.3);
	}
}

@media (max-width: 480px) {
	.single-product-page {
		padding: 24px 0 40px;
	}

	.product-gallery__main {
		aspect-ratio: 4 / 3;
		max-height: 320px;
	}

	.product-summary__title {
		font-size: 1.3rem;
	}

	.product-summary__price {
		font-size: 1.3rem;
	}

	.product-buybox {
		max-width: 100%;
	}

	/* Quantity stepper expands to fill the row, still shows "− 1 +" clearly */
	.quantity-stepper {
		flex: 1 1 auto;
		width: 100%;
	}

	.product-buybox__actions-row {
		gap: 8px;
	}

	.product-buybox__cart-btn,
	.product-buybox__whatsapp-btn {
		font-size: 0.82rem;
		padding: 0 10px;
		gap: 6px;
	}

	/* Very small phones: trim the label column a bit further so the
	   value still has real room to breathe */
	.product-specs-card__section {
		padding: 14px;
	}

	.product-specs-row {
		grid-template-columns: 92px 1fr;
		gap: 8px;
	}

	.product-specs-row:nth-child(even) {
		margin: 0 -14px;
		padding: 10px 14px;
	}

	.product-short-description {
		margin-top: 22px;
		padding-top: 18px;
	}
}