/* ==========================================================================
   SHOES HUB — SINGLE PRODUCT PAGE
   --------------------------------------------------------------------------
   Loaded only on product pages. The page shell uses the header's own
   --gutter, so the gallery starts under the logo and the buy box ends under
   the bag icon. Header, footer and every other template are untouched.

   Selectors that must beat assets/css/woocommerce.css use the
   `.woocommerce div.pdp ...` prefix on purpose.
   ========================================================================== */

/* ---------- Shell ------------------------------------------------------- */

.site-main.pdp-main {
	padding-block: var(--space-4) 0;
}

.pdp-container {
	width: 100%;
	max-width: none;
	padding-inline: var(--gutter);
}

.pdp__top {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-5);
}

.pdp__media,
.pdp__info {
	min-width: 0;
}

.pdp__media {
	position: relative;
}

@media (min-width: 1024px) {
	.pdp__top {
		grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
		gap: clamp(var(--space-6), 4vw, var(--space-8));
		align-items: start;
	}

	/* The buy-box column now carries the full description too, so it is
	   allowed to scroll with the page instead of being pinned. */
}

/* ---------- Gallery ----------------------------------------------------- */

.pdp-gallery {
	display: grid;
	gap: var(--space-2);
}

.pdp-gallery__stage {
	position: relative;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: var(--color-bg-soft);
}

.pdp-gallery__image {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.pdp-gallery__thumbs {
	display: flex;
	gap: var(--space-2);
	overflow-x: auto;
	padding-bottom: 2px;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.pdp-gallery__thumb {
	display: block;
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--color-border);
	border-radius: 0;
	background: var(--color-bg-soft);
	scroll-snap-align: start;
}

.pdp-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.pdp-gallery__thumb:hover {
	border-color: var(--color-border-strong);
}

.pdp-gallery__thumb[aria-current="true"] {
	border-color: var(--color-secondary);
	box-shadow: inset 0 0 0 1px var(--color-secondary);
}

.pdp-gallery__thumb:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 2px;
}

/* Sale badge sits on the image tile. */
.woocommerce .pdp__media span.onsale {
	top: var(--space-3);
	left: var(--space-3);
	z-index: 2;
}

@media (min-width: 768px) {
	.pdp-gallery__thumb {
		flex-basis: 64px;
		width: 64px;
		height: 64px;
	}
}

/* ---------- Buy box ----------------------------------------------------- */

.woocommerce div.pdp div.summary {
	float: none;
	width: auto;
	margin-bottom: 0;
}

.pdp__eyebrow {
	margin: 0 0 var(--space-2);
	color: var(--color-text-muted);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-medium);
	line-height: var(--leading-snug);
}

.pdp__eyebrow a {
	color: inherit;
	text-decoration: none;
}

.pdp__eyebrow a:hover {
	color: var(--color-accent-text);
}

.pdp__eyebrow-sep {
	margin-inline: var(--space-2);
	color: var(--color-border-strong);
}

.woocommerce div.pdp div.product_title {
	margin: 0 0 var(--space-3);
	font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
	font-weight: var(--font-weight-semibold);
	line-height: var(--leading-tight);
	letter-spacing: var(--tracking-tight);
	text-transform: uppercase;
}

.woocommerce div.pdp div.price {
	margin: 0 0 var(--space-2);
	color: var(--color-text);
	font-size: var(--text-xl);
	font-weight: var(--font-weight-semibold);
	line-height: var(--leading-snug);
}

.woocommerce div.pdp div.price del {
	color: var(--color-text-subtle);
	font-weight: var(--font-weight-normal);
	opacity: 1;
}

.woocommerce div.pdp div.price ins {
	text-decoration: none;
}

/* Mintpay / Koko: content and links stay exactly as the plugins print them.
   Only the type and spacing are tightened. */
.woocommerce div.pdp div.price > br {
	display: none;
}

.woocommerce div.pdp div.price .mintpay-price-breakdown,
.woocommerce div.pdp div.price .product-price-installments-not-in-variation-single {
	margin: var(--space-2) 0 0;
	color: var(--color-text-muted) !important;
	font-size: var(--text-xs) !important;
	font-weight: var(--font-weight-normal) !important;
	line-height: 1.4 !important;
}

.woocommerce div.pdp div.price .mintpay-price-breakdown img,
.woocommerce div.pdp div.price .product-price-installments-not-in-variation-single img {
	display: inline-block;
	vertical-align: middle;
}

/* The Koko plugin's own stylesheet hides its single-product instalment line
   (`.price div.product-price-installments-not-in-variation-single`). The shop
   wants both Mintpay and Koko visible, so restore it with a more specific
   selector. Its markup, links and click handlers are untouched. */
.woocommerce div.pdp div.price div.product-price-installments-not-in-variation-single {
	display: block !important;
}

/* Stock line: under the price, filled when a size is selected. */
.pdp-stock {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	min-height: 1.6em;
	margin: var(--space-1) 0 0;
	color: var(--color-text-muted);
	font-size: var(--text-md);
	font-weight: var(--font-weight-medium);
	line-height: var(--leading-snug);
	text-transform: uppercase;
}

.pdp-stock[data-empty="1"] {
	visibility: hidden;
}

.pdp-stock[hidden] {
	display: none;
}

.pdp-stock::before {
	content: "";
	flex: 0 0 8px;
	width: 8px;
	height: 8px;
	border-radius: var(--radius-pill);
	background: currentColor;
}

.pdp-stock--in {
	color: var(--color-text-muted);
}

.pdp-stock--out {
	color: var(--color-text-muted);
}

/* ---------- Size swatches ---------------------------------------------- */

.pdp-swatches {
	margin-top: var(--space-4);
}

.pdp-swatches + .pdp-swatches {
	margin-top: var(--space-3);
}

.pdp-swatches__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-3);
	margin-bottom: var(--space-2);
}

.pdp-swatches__label {
	color: var(--color-text);
	font-size: var(--text-xs);
	font-weight: var(--font-weight-semibold);
	letter-spacing: var(--tracking-wide);
	line-height: var(--leading-snug);
	text-transform: uppercase;
}

.pdp-swatches__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
	gap: var(--space-2);
}

/* Sizes sit five to a row so the palette stays compact and predictable. */
.pdp-swatches--size .pdp-swatches__list {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pdp-swatch {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 48px;
	padding: var(--space-2);
	border: 1px solid var(--color-border-strong);
	border-radius: 0;
	background: var(--color-surface);
	color: var(--color-text);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-medium);
	line-height: 1.2;
	text-align: center;
	word-break: break-word;
	transition: border-color var(--dur-fast) var(--ease),
		background-color var(--dur-fast) var(--ease),
		color var(--dur-fast) var(--ease);
}

.pdp-swatch:hover:not(:disabled) {
	border-color: var(--color-secondary);
}

.pdp-swatch:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 2px;
}

.pdp-swatch.is-selected,
.pdp-swatch[aria-pressed="true"] {
	border-color: var(--color-secondary);
	background: var(--color-secondary);
	color: var(--color-on-secondary);
}

/* Sold-out or unavailable sizes stay visible but greyed out. Only an
   in-stock size can be selected. */
.pdp-swatch:disabled,
.pdp-swatch.is-sold-out,
.pdp-swatch.is-disabled {
	border-color: var(--color-border);
	background: var(--color-bg-soft);
	color: var(--color-text-subtle);
	text-decoration: line-through;
	cursor: not-allowed;
	opacity: 1;
}

/* A sold-out default selection must not look selected/navy. */
.pdp-swatch.is-selected:disabled,
.pdp-swatch.is-selected.is-sold-out,
.pdp-swatch[aria-pressed="true"]:disabled {
	border-color: var(--color-border);
	background: var(--color-bg-soft);
	color: var(--color-text-subtle);
}

/* The real selects stay in the DOM for WooCommerce; hidden once the
   swatches exist. */
.pdp-swatches-ready .variations {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.pdp-swatches-ready .reset_variations {
	display: none;
}

/* ---------- Add to cart ------------------------------------------------ */

.woocommerce div.pdp form.cart {
	display: block;
	gap: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

/* One pair per order; the quantity is changed in the cart. */
.woocommerce div.pdp.product-type-simple .quantity,
.woocommerce div.pdp.product-type-variable .quantity {
	display: none !important;
}

.woocommerce div.pdp form.cart button.single_add_to_cart_button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	margin-top: var(--space-4);
	padding-inline: var(--space-5);
	border-radius: var(--radius-btn);
	background: var(--color-primary);
	color: var(--color-on-primary);
	font-size: var(--text-base);
	font-weight: var(--font-weight-semibold);
}

.woocommerce div.pdp form.cart button.single_add_to_cart_button:hover {
	background: var(--color-primary-hover);
}

.woocommerce div.pdp form.cart button.single_add_to_cart_button.disabled,
.woocommerce div.pdp form.cart button.single_add_to_cart_button:disabled {
	background: var(--color-primary);
	color: var(--color-on-primary);
	opacity: 0.45;
	cursor: not-allowed;
}

.woocommerce div.pdp form.cart button.single_add_to_cart_button.disabled:hover,
.woocommerce div.pdp form.cart button.single_add_to_cart_button:disabled:hover {
	background: var(--color-primary);
}

.woocommerce div.pdp .single_variation_wrap {
	margin-top: var(--space-3);
}

/* The selected variation's price is mirrored into the top .price. WooCommerce
   still prints the same price under the size selector; hide that copy. */
.woocommerce div.pdp .woocommerce-variation-price {
	display: none !important;
}

/* Koko's line for the selected variation, now at the top of the buy box. */
.woocommerce div.pdp div.price .koko-product-price-installment-in-variation {
	margin: var(--space-2) 0 0;
	color: var(--color-text-muted) !important;
	font-size: var(--text-xs) !important;
	font-weight: var(--font-weight-normal) !important;
	line-height: 1.4 !important;
}

.woocommerce div.pdp .woocommerce-variation-description {
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

/* WooCommerce's own stock lines are replaced by .pdp-stock. */
.woocommerce div.pdp .stock,
.woocommerce div.pdp .woocommerce-variation-availability {
	display: none;
}

/* ---------- Short description ------------------------------------------ */

.pdp__short {
	margin-top: var(--space-4);
	padding-top: var(--space-4);
	border-top: 1px solid var(--color-border);
	color: var(--color-text-muted);
	font-size: var(--text-sm);
	line-height: var(--leading-normal);
	overflow-wrap: break-word;
}

.pdp__short p {
	margin: 0 0 var(--space-2);
}

.pdp__short p:last-child {
	margin-bottom: 0;
}

.pdp__short ul,
.pdp__short ol {
	margin: 0;
	padding-left: 1.1em;
}

.pdp__short li + li {
	margin-top: var(--space-1);
}

.pdp__short h2,
.pdp__short h3,
.pdp__short h4 {
	margin: 0 0 var(--space-1);
	color: var(--color-text);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-semibold);
}

.pdp__short a {
	color: var(--color-accent-text);
}

/* Scraper specs rendered as a clean list. */
.pdp-specs {
	display: grid;
	gap: var(--space-1);
	margin: 0;
}

.pdp-specs__row {
	display: flex;
	gap: var(--space-2);
}

.pdp-specs dt {
	flex: 0 0 7.5em;
	color: var(--color-text-subtle);
}

.pdp-specs dd {
	margin: 0;
	color: var(--color-text);
}

/* ---------- Description section ---------------------------------------- */

.pdp-description {
	margin-top: var(--space-5);
	padding-top: var(--space-4);
	border-top: 1px solid var(--color-border);
}

.pdp-section-title {
	margin: 0 0 var(--space-3);
	font-size: var(--text-xl);
	font-weight: var(--font-weight-semibold);
	line-height: var(--leading-snug);
	letter-spacing: var(--tracking-tight);
	text-transform: uppercase;
}

.pdp-description__body {
	max-width: 78ch;
	color: var(--color-text-muted);
	font-size: var(--text-base);
	overflow-wrap: break-word;
}

.pdp-description__body p {
	margin: 0 0 var(--space-3);
}

.pdp-description__body ul,
.pdp-description__body ol {
	margin: 0 0 var(--space-3);
	padding-left: 1.2em;
}

.pdp-description__body li + li {
	margin-top: var(--space-1);
}

.pdp-description__body strong {
	color: var(--color-text);
}

/* ---------- Related products ------------------------------------------- */

.woocommerce div.pdp .related,
.woocommerce div.pdp .upsells {
	margin-top: var(--space-7);
	padding-top: var(--space-6);
	border-top: 1px solid var(--color-border);
}

.woocommerce div.pdp .related > h2,
.woocommerce div.pdp .upsells > h2 {
	margin: 0 0 var(--space-4);
	font-size: var(--text-xl);
	font-weight: var(--font-weight-semibold);
	line-height: var(--leading-snug);
	letter-spacing: var(--tracking-tight);
	text-transform: uppercase;
}

/* The shared loop grid carries a large bottom margin for the shop. On the
   PDP it stacked with the main padding and the footer margin into a dead
   white band, so drop it here. */
.woocommerce div.pdp .related ul.products,
.woocommerce div.pdp .upsells ul.products {
	margin-bottom: 0;
}

/* Phones/tablets show four related cards in a 2x2 grid; desktop keeps three. */
@media (min-width: 1024px) {
	.woocommerce div.pdp .related ul.products li.product:nth-child(4) {
		display: none;
	}
}

/* Give the PDP a normal gap to the footer instead of grid margin + main
   padding + the global footer margin all adding up. */
.single-product .site-footer {
	margin-top: var(--space-6);
}

/* ---------- Motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.pdp-swatch {
		transition: none;
	}
}
