/**
 * Single product page — Deepak Sales.
 *
 * Mobile-first. Depends on tokens.css + base.css. WooCommerce's own
 * frontend stylesheet is disabled (inc/woocommerce.php) so every
 * WC-generated element here (gallery, quantity input, variations table,
 * tabs, meta) is styled from scratch — this file is this theme's full
 * replacement for the single product page. The gallery's zoom/lightbox
 * *behaviour* is still WooCommerce's own bundled JS (photoswipe/zoom/
 * flexslider, enabled via theme support in inc/setup.php) — only its
 * appearance is redefined here.
 */

/* ==========================================================================
   1. Layout
   ========================================================================== */
.ds-single-product__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--ds-space-xl);
	padding-block: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.ds-single-product__below {
	padding-block: clamp(2rem, 1.25rem + 2.5vw, 3.5rem);
	border-top: 1px solid var(--ds-line);
}

/* 62em (992px) — the theme's formal desktop tier (see header.css/hero.css),
   replacing the previous 64em guess. */
@media (min-width: 62em) {
	.ds-single-product__layout {
		grid-template-columns: 1.1fr 1fr;
		gap: var(--ds-space-2xl);
	}
}

/* ==========================================================================
   2. Gallery (structure/behaviour from WooCommerce core; styled here)
   ========================================================================== */
.woocommerce-product-gallery__wrapper {
	margin: 0;
	padding: 0;
	list-style: none;
	border-radius: var(--ds-radius-lg);
	overflow: clip;
	background-color: var(--ds-paper-2);
}

.woocommerce-product-gallery__image img {
	width: 100%;
	height: auto;
	display: block;
	aspect-ratio: 1;
	object-fit: cover;
	cursor: zoom-in;
}

.woocommerce-product-gallery__trigger {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background-color: var(--ds-surface);
	color: var(--ds-oxblood);
	box-shadow: var(--ds-shadow-md);
	transition:
		transform var(--ds-dur-fast) var(--ds-ease),
		background-color var(--ds-dur-fast) var(--ds-ease);
}

/* WC's own CSS (which normally supplies this icon) is dequeued theme-wide,
   so the trigger button needs its own zoom-in glyph — mask-image lets it
   pick up the token color via currentColor rather than a fixed SVG fill. */
.woocommerce-product-gallery__trigger::before {
	content: "";
	width: 1.1rem;
	height: 1.1rem;
	background-color: currentColor;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

.woocommerce-product-gallery__trigger:hover {
	background-color: var(--ds-oxblood-tint);
}

.flex-control-nav.flex-control-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 0.75rem;
	padding: 0;
	list-style: none;
}

.flex-control-thumbs li {
	width: 4.5rem;
}

.flex-control-thumbs img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--ds-radius-sm);
	border: 2px solid transparent;
	cursor: pointer;
	transition: border-color var(--ds-dur-fast) var(--ds-ease);
}

.flex-control-thumbs img.flex-active {
	border-color: var(--ds-gold);
}

/* ==========================================================================
   3. Summary: title, rating, price, MOQ, excerpt
   ========================================================================== */
/* font-size: --ds-fs-h1 is now the dedicated "page title" tier (28-36px) —
   Hero moved to its own --ds-fs-display token, so this no longer shares a
   42-52px scale with the Hero and doesn't need its own mobile-only
   reduction below that; it matches the Shop/Category page title exactly at
   every breakpoint, keeping the "page title" tier consistent site-wide. */
.ds-single-product__summary .product_title {
	margin-bottom: var(--ds-space-sm);
	font-family: var(--ds-font-display);
	font-size: var(--ds-fs-h1);
	font-weight: var(--ds-fw-product);
	line-height: var(--ds-lh-tight);
	color: var(--ds-heading);
}

.woocommerce-product-rating {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: var(--ds-space-sm);
	font-size: var(--ds-fs-small);
}

.star-rating {
	position: relative;
	width: 5.4em;
	height: 1.1em;
	font-family: serif;
	line-height: 1;
	color: var(--ds-gold);
}

.star-rating::before {
	content: "\2605\2605\2605\2605\2605";
	position: absolute;
	inset: 0;
	color: var(--ds-line-strong);
	letter-spacing: 0.2em;
}

.star-rating span {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.star-rating span::before {
	content: "\2605\2605\2605\2605\2605";
	position: absolute;
	inset: 0;
	color: var(--ds-gold);
	letter-spacing: 0.2em;
}

.woocommerce-review-link {
	color: var(--ds-muted);
}

.ds-single-product__summary .price {
	margin-bottom: 0.35rem;
	font-family: var(--ds-font-display);
	font-size: var(--ds-fs-price);
	font-weight: var(--ds-fw-product);
	color: var(--ds-oxblood);
}

.price del {
	margin-right: 0.5rem;
	font-size: 0.7em;
	font-weight: 400;
	color: var(--ds-muted);
	opacity: 0.8;
}

.price ins {
	text-decoration: none;
}

.ds-single-product__moq {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ds-space-sm);
	margin-bottom: var(--ds-space-md);
	font-family: var(--ds-font-mono);
	font-size: var(--ds-fs-small);
	color: var(--ds-muted);
}

.ds-single-product__wholesale-link {
	font-family: var(--ds-font-body);
	font-weight: 600;
	color: var(--ds-oxblood);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.stock {
	margin-bottom: var(--ds-space-sm);
	font-size: var(--ds-fs-small);
	font-weight: 600;
}

.stock.in-stock {
	color: var(--ds-success);
}

.stock.out-of-stock {
	color: var(--ds-oxblood);
}

.woocommerce-product-details__short-description {
	margin-bottom: var(--ds-space-lg);
	color: var(--ds-body);
	line-height: var(--ds-lh-body);
}

/* ==========================================================================
   4. Add to cart form
   ========================================================================== */
.ds-single-product__summary form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ds-space-md);
	margin-bottom: var(--ds-space-lg);
}

.quantity {
	display: flex;
}

.quantity .qty {
	width: 4.5rem;
	min-height: 2.5rem;
	padding: 0.75rem;
	border: 1px solid var(--ds-line-strong);
	border-radius: var(--ds-radius-md);
	background-color: var(--ds-surface);
	font-size: var(--ds-fs-body);
	text-align: center;
}

.quantity .qty:focus {
	outline: 2px solid var(--ds-focus);
	outline-offset: 1px;
}

/* Quantity stepper (progressive enhancement — see assets/js/single-product.js).
   Reuses the same circular-button visual language as the product-card qty
   stepper (assets/css/collection.css .ds-collection__qty-btn) — including
   its 40px size, trimmed from 44px in the sitewide sizing pass so the two
   stay in sync. */
.ds-qty-stepper {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.ds-qty-stepper .qty {
	width: 3rem;
	padding: 0.75rem 0.25rem;
}

.ds-qty-stepper__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	flex: 0 0 auto;
	border: 1px solid var(--ds-line-strong);
	border-radius: 50%;
	background-color: var(--ds-surface);
	color: var(--ds-ink);
	font-size: 1.1rem;
	line-height: 1;
	transition:
		background-color var(--ds-dur-fast) var(--ds-ease),
		color var(--ds-dur-fast) var(--ds-ease);
}

.ds-qty-stepper__btn:hover {
	background-color: var(--ds-oxblood-tint);
	color: var(--ds-oxblood);
}

.single_add_to_cart_button,
.ds-single-product__buy-now {
	padding: 0.85em 1.75em;
	border: none;
	border-radius: var(--ds-radius-pill);
	font-size: var(--ds-fs-small);
	font-weight: 600;
	cursor: pointer;
	transition:
		transform var(--ds-dur-fast) var(--ds-ease),
		box-shadow var(--ds-dur-fast) var(--ds-ease);
}

.single_add_to_cart_button {
	background-color: var(--ds-oxblood);
	color: var(--ds-on-accent);
}

.single_add_to_cart_button:hover,
.ds-single-product__buy-now:hover {
	transform: translateY(-1px);
	box-shadow: var(--ds-shadow-md);
}

.single_add_to_cart_button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.single_add_to_cart_button.wc-variation-is-unavailable {
	display: none;
}

/* Variations table */
table.variations {
	width: 100%;
	margin-bottom: var(--ds-space-md);
	border-collapse: collapse;
}

table.variations tr + tr td,
table.variations tr + tr th {
	padding-top: var(--ds-space-sm);
}

table.variations th.label {
	padding-right: var(--ds-space-md);
	text-align: left;
	font-size: var(--ds-fs-small);
	font-weight: 600;
	color: var(--ds-ink);
	white-space: nowrap;
}

table.variations td.value select {
	width: 100%;
	max-width: 16rem;
	padding: 0.6rem 0.9rem;
	border: 1px solid var(--ds-line-strong);
	border-radius: var(--ds-radius-md);
	background-color: var(--ds-surface);
	font-size: var(--ds-fs-small);
}

.reset_variations {
	margin-left: var(--ds-space-sm);
	font-size: var(--ds-fs-eyebrow);
	color: var(--ds-muted);
}

.woocommerce-variation-price .price {
	font-size: var(--ds-fs-h3);
}

.woocommerce-variation-availability .stock {
	margin-bottom: 0;
}

.single_variation_wrap .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ds-space-md);
}

/* ==========================================================================
   5. Wholesale CTA group (Request Bulk Quote / WhatsApp / Call Now)
   ========================================================================== */
.ds-single-product__wholesale-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ds-space-sm);
	margin-bottom: var(--ds-space-lg);
}

.ds-single-product__quote,
.ds-single-product__whatsapp,
.ds-single-product__call {
	flex: 1 1 auto;
	white-space: nowrap;
}

@media (max-width: 39.99em) {
	.ds-single-product__wholesale-actions {
		flex-direction: column;
	}

	.ds-single-product__quote,
	.ds-single-product__whatsapp,
	.ds-single-product__call {
		width: 100%;
	}
}

/* ==========================================================================
   5.5. Wholesale Information
   ========================================================================== */
.ds-wholesale-info {
	margin-bottom: var(--ds-space-lg);
	padding: 1.1rem 1.25rem;
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-radius-md);
	background-color: var(--ds-paper-2);
}

.ds-wholesale-info__title {
	margin-bottom: 0.6rem;
	font-family: var(--ds-font-display);
	font-size: var(--ds-fs-h3);
	font-weight: var(--ds-fw-section);
	color: var(--ds-heading);
}

.ds-wholesale-info__list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ds-wholesale-info__row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	font-size: var(--ds-fs-small);
}

.ds-wholesale-info__label {
	color: var(--ds-muted);
}

.ds-wholesale-info__value {
	font-weight: 600;
	color: var(--ds-ink);
	text-align: right;
}

/* ==========================================================================
   6. Meta / Brand
   ========================================================================== */
.product_meta {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin-bottom: var(--ds-space-sm);
	font-size: var(--ds-fs-eyebrow);
	color: var(--ds-muted);
}

.product_meta a {
	color: var(--ds-oxblood);
}

.ds-single-product__brand {
	margin-bottom: var(--ds-space-md);
	font-size: var(--ds-fs-eyebrow);
	color: var(--ds-muted);
}

.ds-single-product__brand-label {
	font-weight: 600;
	color: var(--ds-ink);
}

.ds-single-product__brand a {
	color: var(--ds-oxblood);
}

/* ==========================================================================
   7. Share buttons
   ========================================================================== */
.ds-single-product__share {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: var(--ds-space-lg);
}

.ds-single-product__share-label {
	font-size: var(--ds-fs-small);
	color: var(--ds-muted);
}

.ds-single-product__share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	border: 1px solid var(--ds-line-strong);
	color: var(--ds-body);
	background: none;
	cursor: pointer;
	transition:
		background-color var(--ds-dur-fast) var(--ds-ease),
		color var(--ds-dur-fast) var(--ds-ease);
}

.ds-single-product__share-btn:hover {
	background-color: var(--ds-oxblood-tint);
	color: var(--ds-oxblood);
}

/* ==========================================================================
   8. Trust badges
   ========================================================================== */
.ds-single-product__trust {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ds-space-md);
	padding-top: var(--ds-space-md);
	border-top: 1px solid var(--ds-line);
}

.ds-single-product__trust-item {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: var(--ds-fs-eyebrow);
	font-weight: var(--ds-fw-label);
	color: var(--ds-muted);
}

.ds-single-product__trust-ic {
	display: inline-flex;
	color: var(--ds-oxblood);
}

/* ==========================================================================
   9. Tabs (Description / Specifications / Benefits / Reviews)
   ========================================================================== */
.woocommerce-tabs {
	max-width: 48rem;
}

.wc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ds-space-lg);
	margin-bottom: var(--ds-space-lg);
	padding: 0;
	list-style: none;
	border-bottom: 1px solid var(--ds-line);
}

.wc-tabs li a {
	display: inline-block;
	padding-bottom: 0.75rem;
	font-family: var(--ds-font-mono);
	font-size: var(--ds-fs-eyebrow);
	font-weight: var(--ds-fw-label);
	letter-spacing: var(--ds-ls-wide);
	text-transform: uppercase;
	color: var(--ds-muted);
	border-bottom: 2px solid transparent;
	transition: color var(--ds-dur-fast) var(--ds-ease);
}

.wc-tabs li.active a,
.wc-tabs li a:hover {
	color: var(--ds-oxblood);
	border-bottom-color: var(--ds-gold);
}

.wc-tab h2 {
	margin-bottom: var(--ds-space-sm);
	font-family: var(--ds-font-display);
	font-size: var(--ds-fs-h3);
	font-weight: 600;
	color: var(--ds-heading);
}

.wc-tab {
	color: var(--ds-body);
	line-height: var(--ds-lh-body);
}

.ds-single-product__benefits {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding-left: 1.25rem;
	list-style: disc;
}

table.woocommerce-product-attributes,
.ds-specs-table {
	width: 100%;
	border-collapse: collapse;
}

table.woocommerce-product-attributes th,
table.woocommerce-product-attributes td,
.ds-specs-table th,
.ds-specs-table td {
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--ds-line);
	text-align: left;
	font-size: var(--ds-fs-small);
}

table.woocommerce-product-attributes th,
.ds-specs-table th {
	width: 12rem;
	font-weight: 600;
	color: var(--ds-ink);
}

.ds-bulk-pricing__note {
	margin-bottom: var(--ds-space-md);
	color: var(--ds-muted);
}

.ds-bulk-pricing-table {
	width: 100%;
	margin-bottom: var(--ds-space-md);
	border-collapse: collapse;
}

.ds-bulk-pricing-table th,
.ds-bulk-pricing-table td {
	padding: 0.65rem 0.9rem;
	border-bottom: 1px solid var(--ds-line);
	text-align: left;
	font-size: var(--ds-fs-small);
}

.ds-bulk-pricing-table th {
	font-family: var(--ds-font-mono);
	font-size: var(--ds-fs-eyebrow);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ds-muted);
}

.ds-bulk-pricing-table td:last-child {
	font-weight: 600;
	color: var(--ds-oxblood);
}

/* ==========================================================================
   10. Recommendation sections (Frequently Bought Together / More from this
   Category / Popular Products) reuse `.ds-shop-extras` + `.ds-collection__grid`
   from shop-extras.css/collection.css — no bespoke styling needed here.
   ========================================================================== */

/* ==========================================================================
   10.5. Mobile sticky contact bar (Call / WhatsApp / Quote)
   ========================================================================== */
.ds-sticky-contact-bar {
	display: none;
}

@media (max-width: 39.99em) {
	.ds-sticky-contact-bar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: var(--ds-z-sticky-bar);
		display: flex;
		gap: 0.5rem;
		padding: 0.6rem calc(0.75rem + env(safe-area-inset-left)) calc(0.6rem + env(safe-area-inset-bottom)) calc(0.75rem + env(safe-area-inset-right));
		background-color: var(--ds-surface);
		border-top: 1px solid var(--ds-line);
		box-shadow: 0 -6px 20px rgba(26, 22, 20, 0.08);
	}

	/* Reserve room at the bottom of the page so the fixed bar never covers
	   the footer or the last bit of on-page content. */
	body.single-product {
		padding-bottom: calc(4rem + env(safe-area-inset-bottom));
	}
}

.ds-sticky-contact-bar__btn {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.7rem 0.5rem;
	border: 1px solid var(--ds-line-strong);
	border-radius: var(--ds-radius-md);
	background-color: var(--ds-surface);
	color: var(--ds-ink);
	font-size: var(--ds-fs-eyebrow);
	font-weight: 600;
	white-space: nowrap;
}

.ds-sticky-contact-bar__btn--primary {
	background-color: var(--ds-oxblood);
	border-color: var(--ds-oxblood);
	color: var(--ds-on-accent);
}

/* ==========================================================================
   11. Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.single_add_to_cart_button:hover,
	.ds-single-product__buy-now:hover {
		transform: none;
	}
}
