/* Kicks World – product details popup. Side panel on desktops, a wide sheet with the photos beside the details on tablets, bottom sheet on phones. */

/* ---- "Show details" button (after the short description) ---- */
.kw-pdm-open {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	column-gap: 1rem;
	width: 100%;
	margin-top: 0.25rem;
	padding: 0.95rem 1.1rem;
	border: 1px solid var(--kw-ink, #1c1917);
	background: transparent;
	color: var(--kw-ink, #1c1917);
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease;
}
.kw-pdm-open__label {
	font: 600 0.78rem/1.2 var(--kw-sans, inherit);
	letter-spacing: 0.14em;
	text-transform: uppercase;
}
.kw-pdm-open__hint {
	grid-column: 1;
	font: 400 0.8rem/1.3 var(--kw-sans, inherit);
	color: var(--kw-muted, #6b6560);
	transition: color 0.25s ease;
}
.kw-pdm-open__icon {
	grid-column: 2;
	grid-row: 1 / span 2;
	transition: transform 0.25s ease;
}
.kw-pdm-open:hover,
.kw-pdm-open:focus-visible {
	background: var(--kw-ink, #1c1917);
	color: var(--kw-paper, #faf8f4);
}
.kw-pdm-open:hover .kw-pdm-open__hint,
.kw-pdm-open:focus-visible .kw-pdm-open__hint {
	color: inherit;
	opacity: 0.8;
}
.kw-pdm-open:hover .kw-pdm-open__icon {
	transform: translateX(3px);
}
.kw-pdm-open:focus-visible {
	outline: 2px solid var(--kw-ink, #1c1917);
	outline-offset: 3px;
}
@media (max-width: 767px) {
	body .kw-pdp__summary > .kw-pdm-open {
		order: 11; /* follows the short description, which follows the delivery box */
	}
}

/* ---- Dialog ---- */
/* Scroll lock: body.kw-lock (the theme's) plus the scrollbar's width as body padding, set by the script –
   the same way the cart drawer keeps the page from shifting. */

.kw-pdm {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: hidden;
	/* "clip" (not just hidden): the browser focusing a button in the still off-screen panel on open must not
	   scroll the dialog, or the panel would appear in place instead of gliding in. */
	overflow: clip;
}
/* The native backdrop can't fade in, so it stays clear and an overlay inside the dialog does the work –
   the same tint, blur and timing as the cart drawer's overlay. */
.kw-pdm::backdrop {
	background: transparent;
}
.kw-pdm__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(30, 24, 20, 0.4);
}
@media (hover: hover) and (pointer: fine) {
	.kw-pdm__overlay {
		-webkit-backdrop-filter: blur(2px);
		backdrop-filter: blur(2px);
	}
}

.kw-pdm__panel {
	position: absolute;
	display: flex;
	flex-direction: column;
	background: var(--kw-paper, #faf8f4);
	color: var(--kw-ink, #1c1917);
	outline: none;
}

/* The motion copies the cart drawer: overlay fades, panel glides in (0.62s, soft ease-out), its parts
   settle one after another, and it leaves quicker (0.34s, accelerating). Fixed keyframes per direction. */
.kw-pdm.is-open .kw-pdm__overlay {
	animation: kw-pdm-fade-in 0.45s ease backwards;
}
.kw-pdm.is-closing .kw-pdm__overlay {
	animation: kw-pdm-fade-out 0.34s ease forwards;
}
.kw-pdm.is-open .kw-pdm__head { animation-delay: 0.14s; }
.kw-pdm.is-open .kw-pdm__body { animation-delay: 0.2s; }
.kw-pdm.is-open .kw-pdm__buy { animation-delay: 0.26s; }

/* Desktop: panel opens from the right, like the cart drawer. */
@media (min-width: 1024px) {
	.kw-pdm__panel {
		inset: 0 0 0 auto;
		width: min(580px, 92vw);
		box-shadow: -24px 0 60px -30px rgba(30, 24, 20, 0.45);
	}
	.kw-pdm .kw-pdm__grab {
		display: none; /* the drag handle is for the phone and tablet sheets */
	}
	.kw-pdm.is-open .kw-pdm__panel {
		animation: kw-pdm-in-right 0.62s cubic-bezier(0.22, 1, 0.36, 1) backwards;
	}
	.kw-pdm.is-closing .kw-pdm__panel {
		animation: kw-pdm-out-right 0.34s cubic-bezier(0.55, 0, 0.75, 0.2) forwards;
	}
	.kw-pdm.is-open .kw-pdm__head,
	.kw-pdm.is-open .kw-pdm__body,
	.kw-pdm.is-open .kw-pdm__buy {
		animation-name: kw-pdm-settle-x;
		animation-duration: 0.55s;
		animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
		animation-fill-mode: backwards;
	}
}

/* Phones: bottom sheet that opens from the bottom. */
@media (max-width: 767px) {
	.kw-pdm__panel {
		inset: auto 0 0 0;
		height: min(92dvh, 100%);
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -24px 60px -30px rgba(30, 24, 20, 0.45);
	}
	.kw-pdm.is-open .kw-pdm__panel {
		animation: kw-pdm-in-up 0.62s cubic-bezier(0.22, 1, 0.36, 1) backwards;
	}
	.kw-pdm.is-closing .kw-pdm__panel {
		animation: kw-pdm-out-down 0.34s cubic-bezier(0.55, 0, 0.75, 0.2) forwards;
	}
	.kw-pdm.is-open .kw-pdm__head,
	.kw-pdm.is-open .kw-pdm__body,
	.kw-pdm.is-open .kw-pdm__buy {
		animation-name: kw-pdm-settle-y;
		animation-duration: 0.55s;
		animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
		animation-fill-mode: backwards;
	}
}

@keyframes kw-pdm-fade-in { from { opacity: 0; } }
@keyframes kw-pdm-fade-out { to { opacity: 0; } }
@keyframes kw-pdm-in-right { from { transform: translate3d(100%, 0, 0); } to { transform: none; } }
@keyframes kw-pdm-out-right { to { transform: translate3d(100%, 0, 0); } }
@keyframes kw-pdm-in-up { from { transform: translate3d(0, 100%, 0); } to { transform: none; } }
@keyframes kw-pdm-out-down { to { transform: translate3d(0, 100%, 0); } }
@keyframes kw-pdm-settle-x { from { opacity: 0; transform: translate3d(18px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes kw-pdm-settle-y { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }

.kw-pdm__grab {
	display: flex;
	justify-content: center;
	padding: 0.6rem 0 0;
}
.kw-pdm__grab span {
	width: 40px;
	height: 4px;
	border-radius: 4px;
	background: var(--kw-line-strong, rgba(0, 0, 0, 0.22));
}

.kw-pdm__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 1.5rem 1rem;
	border-bottom: 1px solid var(--kw-line, rgba(0, 0, 0, 0.12));
}
.kw-pdm__eyebrow {
	margin: 0 0 0.3rem;
	font: 600 0.7rem/1 var(--kw-sans, inherit);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--kw-gold-deep, #8a6a3d);
}
.kw-pdm__title {
	margin: 0;
	font-family: var(--kw-serif, serif);
	font-weight: 400;
	font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.65rem);
	line-height: 1.2;
}
.kw-pdm__close {
	flex: none;
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: -0.3rem -0.5rem 0 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--kw-ink, #1c1917);
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.kw-pdm__close:hover {
	background: var(--kw-sand, rgba(0, 0, 0, 0.06));
}
.kw-pdm__close:focus-visible {
	outline: 2px solid var(--kw-ink, #1c1917);
	outline-offset: 2px;
}

.kw-pdm__body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 0.5rem 1.5rem 1.5rem;
}
.kw-pdm__body .kw-pdp__details {
	margin: 0;
}

/* ---- Image gallery (tablets and desktops) ---- */
.kw-pdm__gallery {
	margin: 1rem 0 0;
}
.kw-pdm__stage {
	position: relative;
	border-radius: var(--kw-radius-md, 8px);
	overflow: hidden;
	background: var(--kw-cream, #f4f1ea);
}
.kw-pdm__track {
	position: relative;
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.kw-pdm__track::-webkit-scrollbar {
	display: none;
}
.kw-pdm__track:focus-visible {
	outline: 2px solid var(--kw-ink, #1c1917);
	outline-offset: -2px;
}
.kw-pdm__slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
}
.kw-pdm__figure {
	position: relative;
	height: clamp(260px, 44vh, 400px);
	margin: 0;
}
/* The whole photo always fits (portrait or square), centred on the cream stage. */
.kw-pdm .kw-pdm__img {
	position: absolute;
	inset: 1rem;
	display: block;
	width: calc(100% - 2rem);
	height: calc(100% - 2rem);
	max-width: none;
	object-fit: contain;
	mix-blend-mode: multiply; /* white photo backgrounds melt into the cream stage */
}
.kw-pdm__nav {
	position: absolute;
	top: 50%;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin-top: -20px;
	border: 1px solid var(--kw-line, rgba(0, 0, 0, 0.12));
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--kw-ink, #1c1917);
	box-shadow: 0 8px 18px -12px rgba(30, 24, 20, 0.45);
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
}
.kw-pdm__nav--prev { left: 12px; transform: translateX(-4px); }
.kw-pdm__nav--next { right: 12px; transform: translateX(4px); }
.kw-pdm__stage:hover .kw-pdm__nav,
.kw-pdm__nav:focus-visible {
	opacity: 1;
	transform: none;
}
.kw-pdm__nav:hover {
	background: #fff;
}
.kw-pdm__nav:disabled {
	opacity: 0 !important;
	pointer-events: none;
}
.kw-pdm__nav:focus-visible {
	outline: 2px solid var(--kw-ink, #1c1917);
	outline-offset: 2px;
}
@media (hover: none) {
	.kw-pdm__nav {
		opacity: 1;
		transform: none;
	}
}
.kw-pdm__count {
	position: absolute;
	right: 12px;
	bottom: 12px;
	margin: 0;
	padding: 0.3rem 0.6rem;
	border-radius: 999px;
	background: rgba(30, 24, 20, 0.72);
	color: var(--kw-cream, #f4f1ea);
	font: 600 0.7rem/1 var(--kw-sans, inherit);
	letter-spacing: 0.08em;
	font-variant-numeric: tabular-nums;
}
.kw-pdm__thumbs {
	display: flex;
	gap: 0.6rem;
	margin-top: 0.75rem;
}
.kw-pdm__thumb {
	flex: none;
	width: 64px;
	height: 64px;
	padding: 0;
	border: 1px solid var(--kw-line, rgba(0, 0, 0, 0.12));
	border-radius: var(--kw-radius, 4px);
	overflow: hidden;
	background: var(--kw-cream, #f4f1ea);
	cursor: pointer;
	opacity: 0.65;
	transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.kw-pdm__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.kw-pdm__thumb:hover {
	opacity: 1;
	transform: translateY(-2px);
}
.kw-pdm__thumb.is-active {
	opacity: 1;
	border-color: var(--kw-ink, #1c1917);
	box-shadow: inset 0 0 0 1px var(--kw-ink, #1c1917);
}
.kw-pdm__thumb:focus-visible {
	outline: 2px solid var(--kw-ink, #1c1917);
	outline-offset: 2px;
}

/* Scent pills under the images */
.kw-pdm__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin: 1rem 0 0.25rem;
}

/* The bottom sheet on phones stays compact: no gallery there. */
@media (max-width: 767px) {
	.kw-pdm__gallery {
		display: none;
	}
	.kw-pdm__chips {
		margin-top: 0.75rem;
	}
}

/* ---- Buy bar ---- */
.kw-pdm__buy {
	display: grid;
	gap: 0.85rem;
	padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--kw-line, rgba(0, 0, 0, 0.12));
	background: var(--kw-paper, #faf8f4);
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.04);
}
.kw-pdm__product {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-width: 0;
}
.kw-pdm__pic {
	flex: none;
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: var(--kw-radius, 4px);
	background: var(--kw-cream, #f3efe8);
}
.kw-pdm__meta {
	min-width: 0;
}
.kw-pdm__name {
	margin: 0 0 0.15rem;
	font: 500 0.88rem/1.3 var(--kw-sans, inherit);
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
}
.kw-pdm__price {
	font: 600 1rem/1.2 var(--kw-sans, inherit);
}
.kw-pdm__price del {
	margin-right: 0.4rem;
	font-weight: 400;
	font-size: 0.85rem;
	color: var(--kw-muted, #6b6560);
}
.kw-pdm__price ins {
	text-decoration: none;
}

.kw-pdm__actions {
	display: grid;
	grid-template-columns: auto 1fr 1fr;
	gap: 0.6rem;
}
.kw-pdm__qty {
	display: inline-flex;
	align-items: center;
	height: 3rem;
	border: 1px solid var(--kw-line-strong, rgba(0, 0, 0, 0.22));
}
.kw-pdm__qty button {
	width: 2.4rem;
	height: 100%;
	border: 0;
	background: transparent;
	color: var(--kw-ink, #1c1917);
	font-size: 1.1rem;
	cursor: pointer;
}
.kw-pdm__qty button:disabled {
	opacity: 0.35;
	cursor: default;
}
.kw-pdm__qty output {
	min-width: 1.6rem;
	text-align: center;
	font: 500 0.95rem/1 var(--kw-sans, inherit);
}

.kw-pdm__add,
.kw-pdm__now,
.kw-pdm__notify {
	height: 3rem;
	padding: 0 1rem;
	border: 1px solid var(--kw-ink, #1c1917);
	font: 600 0.76rem/1 var(--kw-sans, inherit);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, opacity 0.2s ease;
}
.kw-pdm__add {
	background: var(--kw-ink, #1c1917);
	color: var(--kw-paper, #faf8f4);
}
.kw-pdm__add:hover {
	background: var(--kw-roast, #2b2622);
}
.kw-pdm__now,
.kw-pdm__notify {
	background: transparent;
	color: var(--kw-ink, #1c1917);
}
.kw-pdm__now:hover,
.kw-pdm__notify:hover {
	background: var(--kw-ink, #1c1917);
	color: var(--kw-paper, #faf8f4);
}
.kw-pdm__now[aria-busy="true"] {
	opacity: 0.7;
	cursor: progress;
}
.kw-pdm__add:focus-visible,
.kw-pdm__now:focus-visible,
.kw-pdm__notify:focus-visible,
.kw-pdm__qty button:focus-visible {
	outline: 2px solid var(--kw-ink, #1c1917);
	outline-offset: 2px;
}

.kw-pdm__actions--oos {
	grid-template-columns: auto 1fr;
	align-items: center;
}
.kw-pdm__oos {
	margin: 0;
	font: 600 0.8rem/1 var(--kw-sans, inherit);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--kw-sale, #9b2c2c);
}

/* Narrow phones: quantity + Add to cart on one row, Buy now full width below. */
@media (max-width: 420px) {
	.kw-pdm__head {
		padding: 0.9rem 1.1rem 0.85rem;
	}
	.kw-pdm__body {
		padding: 0.25rem 1.1rem 1.25rem;
	}
	.kw-pdm__buy {
		padding: 0.85rem 1.1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
		gap: 0.7rem;
	}
	.kw-pdm__actions {
		grid-template-columns: auto 1fr;
	}
	.kw-pdm__now {
		grid-column: 1 / -1;
	}
	.kw-pdm__actions--oos {
		grid-template-columns: 1fr;
	}
}

/* Tablets (portrait): a wide sheet from the bottom with the photos beside the details. */
@media (min-width: 768px) and (max-width: 1023px) {
	.kw-pdm__panel {
		inset: auto 0 0 0;
		width: min(760px, calc(100% - 48px));
		height: auto; /* fits its content; the details scroll inside once it reaches the cap */
		max-height: min(88dvh, calc(100% - 40px));
		margin: 0 auto;
		border-radius: 20px 20px 0 0;
		box-shadow: 0 -24px 60px -30px rgba(30, 24, 20, 0.45);
		overflow: hidden;
	}
	.kw-pdm.is-open .kw-pdm__panel {
		animation: kw-pdm-in-up 0.62s cubic-bezier(0.22, 1, 0.36, 1) backwards;
	}
	.kw-pdm.is-closing .kw-pdm__panel {
		animation: kw-pdm-out-down 0.34s cubic-bezier(0.55, 0, 0.75, 0.2) forwards;
	}
	.kw-pdm.is-open .kw-pdm__head,
	.kw-pdm.is-open .kw-pdm__body,
	.kw-pdm.is-open .kw-pdm__buy {
		animation-name: kw-pdm-settle-y;
		animation-duration: 0.55s;
		animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
		animation-fill-mode: backwards;
	}
	.kw-pdm__head {
		padding: 0.85rem 1.75rem 1rem;
	}
	/* Photos on the left stay in view while the details on the right scroll. */
	.kw-pdm__body {
		display: grid;
		grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
		align-items: start;
		column-gap: 1.75rem;
		padding: 1.25rem 1.75rem 1.75rem;
	}
	.kw-pdm__gallery {
		position: sticky;
		top: 0;
		margin: 0;
	}
	.kw-pdm__figure {
		height: clamp(280px, 36vh, 400px);
	}
	.kw-pdm__thumbs {
		flex-wrap: wrap;
	}
	.kw-pdm__chips {
		margin-top: 0;
	}
	/* Buy bar on one row: product on the left, quantity and buttons on the right. */
	.kw-pdm__buy {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		column-gap: 1.25rem;
		padding: 1rem 1.75rem calc(1rem + env(safe-area-inset-bottom, 0px));
	}
	.kw-pdm__actions {
		grid-template-columns: auto minmax(9rem, auto) minmax(9rem, auto);
	}
	.kw-pdm__actions--oos {
		grid-template-columns: auto minmax(12rem, auto);
	}
}
/* Without the gallery (a product with no photos) the details use the full width. */
@media (min-width: 768px) and (max-width: 1023px) {
	.kw-pdm__body:not(:has(.kw-pdm__gallery)) {
		display: block;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kw-pdm .kw-pdm__overlay,
	.kw-pdm .kw-pdm__panel,
	.kw-pdm .kw-pdm__head,
	.kw-pdm .kw-pdm__body,
	.kw-pdm .kw-pdm__buy {
		animation: none !important;
	}
	.kw-pdm-open,
	.kw-pdm-open__icon {
		transition: none;
	}
}
