/* ==========================================================================
   Single product page — Autotelic Objects
   Desktop (≥900px): image mosaic left (~2/3), narrow sticky info column right.
   Phone: images stack edge to edge, fixed buy bar at the bottom.
   Text is #000000 throughout; only the add-to-basket buttons use white text.
   Grounds: Paper #f7eded, Clay #d5c9c4.
   ========================================================================== */

.ao-pdp {
	/* --ao-ink, --ao-paper and --ao-gutter come from header.css, so the page
	   lines up with the menu bar and wordmark at every width. */
	--ao-grey: var(--ao-ink, #000); /* all text is black */
	--ao-clay: #d5c9c4;
	--ao-rule: rgba(0, 0, 0, 0.16); /* hairlines only — not for text */
	--ao-top: calc(var(--wp-admin--admin-bar--height, 0px) + 1.5rem);
	--ao-small: 0.875rem;

	/* Full width, as the header is: cancel the page padding, then use the
	   header's own gutter. */
	margin: 0 calc(-1 * var(--ao-page-pad, 24px));
	color: var(--ao-ink);
	font-size: var(--ao-small);
	line-height: 1.5;
}

/* As on the reference, the page starts flush under the menu bar, with the
   wordmark over the first image. TT5's block gap would add 24px above it. */
body.single-product .wp-site-blocks > .woocommerce.product,
body.single-product .wp-site-blocks > .wp-block-template-part + * { margin-block-start: 0; }

/* TT5's flow layout adds a top margin to every child; this page sets its own rhythm. */
.ao-pdp > *,
.ao-pdp__grid > *,
.ao-pdp__panel > * { margin-block: 0; }

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */
.ao-pdp__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
	.ao-pdp__grid {
		/* Page in sixths: photos 4/6, an empty 1/6, details + button 1/6.
		   The details column never drops below 12.5rem on narrow screens. */
		grid-template-columns: minmax(0, 4fr) minmax(0, 1fr) minmax(12.5rem, 1fr);
		gap: 0;
		padding: 0 var(--ao-gutter);
	}
	.ao-pdp__grid > .ao-gallery { grid-column: 1; }
	.ao-pdp__grid > .ao-pdp__panel { grid-column: 3; }
}

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */
/* Rows, at most five images:
   phone    full | full | full | half half
   desktop  half half | full | half half
   The classes come from inc/single-product.php (is-full = full on desktop,
   is-m-half = half on phones, is-extra = only in the viewer). */
.ao-gallery { position: relative; }

.ao-gallery__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ao-gallery__item { position: relative; margin: 0; grid-column: 1 / -1; }
.ao-gallery__item.is-m-half { grid-column: auto; }
.ao-gallery__item.is-extra,
.ao-gallery__item[hidden] { display: none; }

@media (min-width: 900px) {
	.ao-gallery__item,
	.ao-gallery__item.is-m-half { grid-column: auto; }
	.ao-gallery__item.is-full { grid-column: 1 / -1; }
}

.ao-gallery__zoom {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: var(--ao-clay);
	cursor: zoom-in;
}

.ao-gallery__img,
.ao-gallery--empty img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5; /* every image is 4:5, half-width or full-width */
	object-fit: cover;
}

.ao-gallery__zoom:focus-visible {
	outline: 2px solid var(--ao-ink);
	outline-offset: -4px;
}

/* "View more images" — white tab inset from the last image's bottom-right
   corner, as on the reference. On hover the label's underline draws in from
   the left, exactly as on the header menu links (header.css: 1px, 2px below
   the text, 0.1s ease-out). Keyboard focus shows the underline too, plus a
   thin outline so it can be found without a mouse. */
.ao-gallery__more {
	position: absolute;
	right: 1rem;
	bottom: 1rem;
	display: inline-block;
	padding: 0.5rem 0.75rem;
	border: 0;
	border-radius: 0;
	background: #fff;
	color: var(--ao-ink);
	font: inherit;
	font-size: var(--ao-small);
	line-height: 1.2;
	cursor: pointer;
}
.ao-gallery__more-label {
	position: relative;
	display: inline-block;
}
.ao-gallery__more-label::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 0;
	height: 1px;
	background: currentColor;
	transition: width 0.1s var(--ao-ease-out, cubic-bezier(0, 0, 0.58, 1));
}
.ao-gallery__more:hover .ao-gallery__more-label::after,
.ao-gallery__more:focus-visible .ao-gallery__more-label::after { width: 100%; }
.ao-gallery__more:focus-visible { outline: 1px solid var(--ao-ink); outline-offset: 0; }

@media (prefers-reduced-motion: reduce) {
	.ao-gallery__more-label::after { transition: none; }
}

/* Viewer — every image in one column, scrolled inside the dialog.
   Desktop (as on the Loewe reference, measured at 1440px): a fixed column of
   thumbnails 24px in from the top left, 58px wide, stacked with no gap, the
   current one underlined with a 1px black rule; the X 24px in from the top
   right; images full height down the middle. Phones: no thumbnails, an
   "n of N" count top left instead. */
.ao-lightbox {
	--ao-lb-inset: 24px;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--ao-paper);
	color: var(--ao-ink);
	overflow-y: auto;
	overscroll-behavior: contain;
}
.ao-lightbox::backdrop { background: var(--ao-paper); }

/* Close — a 24px X whose edges sit on the inset, in a 36px tap target */
.ao-lightbox__close {
	position: fixed;
	top: calc(var(--ao-lb-inset) - 6px);
	right: calc(var(--ao-lb-inset) - 6px);
	z-index: 2;
	display: grid;
	place-items: center;
	padding: 6px;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--ao-ink);
	line-height: 0;
	cursor: pointer;
}
.ao-lightbox__close svg { display: block; width: 24px; height: 24px; }
.ao-lightbox__close:hover { opacity: 0.6; }
.ao-lightbox__close:focus-visible { outline: 1px solid var(--ao-ink); outline-offset: 0; }

/* Phones — as on the reference at 375px: a 56px strip across the top with
   "n of N" (14px) 16px in from the left and a 16px X 16px in from the right,
   both centred in it; the images start below the strip. */
.ao-lightbox__count { display: none; }

@media (max-width: 899.98px) {
	.ao-lightbox__count {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 1;
		display: flex;
		align-items: center;
		height: 56px;
		padding: 0 16px;
		background: var(--ao-paper);
		color: var(--ao-ink);
		font-size: 0.875rem;
		font-weight: 400;
		line-height: 1.4;
	}
	.ao-lightbox__close {
		top: 10px;  /* 36px target, centred on the strip */
		right: 6px; /* 16px icon, 16px from the edge */
		padding: 10px;
	}
	.ao-lightbox__close svg { width: 16px; height: 16px; }
	.ao-lightbox__list { padding-top: 56px; }
	.ao-lightbox__img { width: 100vw; }
}

/* Thumbnails — desktop only */
.ao-lightbox__thumbs { display: none; }

@media (min-width: 900px) {
	.ao-lightbox__thumbs {
		position: fixed;
		top: var(--ao-lb-inset);
		left: var(--ao-lb-inset);
		z-index: 2;
		display: block;
		width: 58px;
		max-height: calc(100vh - 2 * var(--ao-lb-inset));
		margin: 0;
		padding: 0;
		list-style: none;
		overflow-y: auto;
		scrollbar-width: none;
	}
	.ao-lightbox__thumbs::-webkit-scrollbar { display: none; }
	.ao-lightbox__thumbs li { margin: 0; }

	.ao-lightbox__thumb {
		position: relative;
		display: block;
		width: 100%;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: var(--ao-clay);
		cursor: pointer;
	}
	.ao-lightbox__thumb img {
		display: block;
		width: 100%;
		height: auto;
		aspect-ratio: 4 / 5;
		object-fit: cover;
	}
	/* The current one: a 1px rule along the bottom that draws in from the left */
	.ao-lightbox__thumb::after {
		content: "";
		position: absolute;
		left: 0;
		bottom: 0;
		width: 0;
		height: 1px;
		background: var(--ao-ink);
		transition: width 0.25s ease;
	}
	.ao-lightbox__thumb[aria-current="true"]::after,
	.ao-lightbox__thumb:hover::after { width: 100%; }
	.ao-lightbox__thumb:focus-visible { outline: 1px solid var(--ao-ink); outline-offset: -1px; }
}

@media (prefers-reduced-motion: reduce) {
	.ao-lightbox__thumb::after { transition: none; }
}

.ao-lightbox__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ao-lightbox__item { margin: 0; }
.ao-lightbox__img {
	display: block;
	/* Full height on wide screens, full width on narrow ones; always 4:5. */
	width: min(100vw, 80vh);
	width: min(100vw, 80dvh);
	height: auto;
	aspect-ratio: 4 / 5;
	margin: 0 auto;
	object-fit: cover;
	background: var(--ao-clay);
}

/* --------------------------------------------------------------------------
   Info panel
   -------------------------------------------------------------------------- */
.ao-pdp__panel { padding: 1.5rem var(--ao-gutter) 2rem; }

/* Two stacks in the column: product info (.ao-pdp__sticky) and the
   price + button (.ao-pdp__purchase). */
.ao-pdp__sticky,
.ao-pdp__purchase {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.ao-pdp__sticky > *,
.ao-pdp__purchase > * { margin-block: 0 !important; }
.ao-pdp__purchase { margin-top: 0.75rem !important; }

/* Desktop scroll behaviour, measured on the reference at 1440×900:
   - the info starts right under the menu bar; once the bar slides away it
     sticks 17px from the top of the window, and follows the bar back down
     when it returns (same 0.5s);
   - the button is held 24px above the bottom of the window the whole way
     down the gallery, then settles 24px above the gallery's last image and
     scrolls away with it.
   The column is as tall as the gallery (grid row), which is what releases
   both at the end. */
@media (min-width: 900px) {
	.ao-pdp__panel {
		display: flex;
		flex-direction: column;
		padding: 0 0 var(--ao-gutter, 30px); /* button rests one side-margin above the gallery's end */
	}
	/* `top` itself is set in header.css: --ao-top + the menu bar's height,
	   which header.js publishes (72px showing, 0 hidden) and animates. */
	.ao-pdp__sticky {
		position: sticky;
		width: 100%; /* the full sixth; right edge on the basket icon's edge */
		--ao-top: calc(var(--wp-admin--admin-bar--height, 0px) + 1px);   /* bar showing: right under it */
	}
	body:has(.ao-hidden) .ao-pdp__sticky {
		--ao-top: calc(var(--wp-admin--admin-bar--height, 0px) + 17px);  /* bar hidden: 17px from the top */
	}
	/* As on the reference, the info's box reaches down past the window by the
	   height of the button block (--ao-purchase-h, measured by the script).
	   So at the end of the gallery the info starts to scroll away that much
	   before the button does, and the two leave as one stack, never overlapping. */
	.ao-pdp__sticky {
		min-height: calc(100vh - var(--ao-top) - var(--ao-header-h, 0px) + var(--ao-purchase-h, 0px));
	}
	.ao-pdp__purchase {
		position: sticky;
		bottom: var(--ao-gutter, 30px); /* same as the page's side margins */
		margin-top: auto !important;
		padding-top: 0.75rem;
		width: 100%;
		background: var(--ao-paper); /* on a short window it passes over the info */
	}
}

/* Breadcrumbs */
.ao-pdp .ao-pdp__crumbs,
.ao-pdp .ao-pdp__crumbs a {
	font-size: 0.75rem;
	color: var(--ao-grey);
	text-decoration: none;
}
.ao-pdp .ao-pdp__crumbs a:hover { color: var(--ao-ink); text-decoration: underline; }

/* Title */
.ao-pdp .ao-pdp__title {
	font-size: 48px;
	font-weight: 300;
	line-height: 1.05;
	letter-spacing: 0;
}

/* Designers notes: title, then the description cut to three lines with "…" */
/* 24px everywhere around the notes: product title → "Designers notes" →
   text → "All details". The column's own gap is 12px, so the block adds 12px
   above and below itself. */
.ao-pdp .ao-dn { padding-block: 12px; }
.ao-pdp .ao-dn__title {
	margin: 0 0 24px;
	font-family: inherit;
	font-size: var(--ao-small);
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0;
	text-transform: none;
}
.ao-pdp .ao-dn__text {
	margin: 0;
	font-size: var(--ao-small);
	line-height: 1.5;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
}

/* Short description (no longer in the template; kept in case it returns) */
.ao-pdp .ao-pdp__excerpt,
.ao-pdp .ao-pdp__excerpt p {
	margin: 0;
	font-size: var(--ao-small);
}
.ao-pdp__excerpt .wp-block-post-excerpt__more-text { display: none; }

/* Attributes under "All details", as on the reference: one row per
   attribute, each with a 1px line above, 16px above and below its text,
   name left / value right, 14px. Options (variation attributes) open a
   panel; colours etc. with their own pictures show four of them under the
   row, the chosen one underlined, "+n" when there are more. */
.ao-pdp .ao-pdp__sticky > .ao-attrs { margin-top: 12px !important; }
.ao-pdp .ao-attrs {
	margin: 0;
	font-size: var(--ao-small);
	line-height: 1.4;
}
.ao-pdp .ao-attrs__row {
	border-top: 1px solid var(--ao-ink);
	padding: 16px 0;
}
.ao-pdp .ao-attrs__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ao-ink);
	font: inherit;
	text-align: left;
}
.ao-pdp .ao-attrs__label { display: inline-flex; align-items: center; gap: 4px; }
.ao-pdp .ao-attrs__value { text-align: right; }
.ao-pdp .ao-sel__head { cursor: pointer; }
.ao-pdp .ao-sel__head:hover .ao-attrs__label { text-decoration: underline; } /* as "All details" */
.ao-pdp .ao-sel__head:focus-visible { outline: 1px solid var(--ao-ink); outline-offset: 3px; }
/* ▸ before the name of every attribute with options */
.ao-pdp .ao-sel__arrow {
	display: block;
	width: 0;
	height: 0;
	border-left: 0.35em solid currentColor;
	border-block: 0.25em solid transparent;
	margin-right: 4px;
}

.ao-pdp .ao-sel__thumbs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	padding-top: 16px;
}
.ao-pdp .ao-sel__thumb,
.ao-pdp .ao-sel__more {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.04);
	color: var(--ao-ink);
	font: inherit;
	font-size: 12px;
	cursor: pointer;
	overflow: hidden;
}
.ao-pdp .ao-sel__thumb[hidden],
.ao-pdp .ao-sel__more[hidden] { display: none; }
.ao-pdp .ao-sel__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
/* the underline: chosen, and on hover */
.ao-pdp .ao-sel__thumb::after,
.ao-pdp .ao-sel__more::after,
.ao-picker .ao-picker__img::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 1px;
	background: var(--ao-ink);
}
.ao-pdp .ao-sel__thumb[aria-pressed="true"]::after,
.ao-picker .ao-picker__opt[aria-pressed="true"] .ao-picker__img::after { width: 100%; }
@media (hover: hover) {
	.ao-pdp .ao-sel__thumb:hover::after,
	.ao-pdp .ao-sel__more:hover::after,
	.ao-picker .ao-picker__opt:hover .ao-picker__img::after { width: 100%; }
}
.ao-pdp .ao-sel__thumb.is-unavailable img,
.ao-picker .ao-picker__opt.is-unavailable { opacity: 0.35; }
.ao-picker .ao-picker__opt.is-unavailable { cursor: default; }

/* WooCommerce's selects stay in the form (hidden); the rows above drive them. */
.ao-pdp .ao-pdp__buy form.ao-has-sel table.variations { display: none; }

/* The panel: the same drawer and size as All details; pictures 2 across
   with names under them. */
.ao-picker .ao-picker__list {
	margin: 0;
	padding: 0;
	list-style: none;
}
.ao-picker--pictures .ao-picker__list {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	row-gap: 32px;
}
.ao-picker .ao-picker__opt {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ao-ink);
	font: inherit;
	font-size: 14px;
	text-align: left;
	cursor: pointer;
}
.ao-picker .ao-picker__img {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	background: rgba(0, 0, 0, 0.04);
	overflow: hidden;
}
.ao-picker .ao-picker__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ao-picker--pictures .ao-picker__name { display: block; padding: 16px 12px 0; }
/* Panel title: 18px, as on the reference (the details drawer keeps 48px) */
.ao-pd-drawer.ao-picker .ao-picker__title {
	font-size: 18px;
	font-weight: 400;
	line-height: 1.25;
}
/* No pictures: a list of rows, each with a line above, the chosen one ▸ */
.ao-picker:not(.ao-picker--pictures) .ao-picker__opt {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 16px 0;
	border-top: 1px solid var(--ao-ink);
}
.ao-picker:not(.ao-picker--pictures) .ao-picker__opt[aria-pressed="true"]::before {
	content: "";
	border-left: 0.35em solid currentColor;
	border-block: 0.25em solid transparent;
}
@media (hover: hover) {
	.ao-picker:not(.ao-picker--pictures) .ao-picker__opt:hover .ao-picker__name { text-decoration: underline; }
}

/* "All details" trigger */
.ao-details__open,
.ao-buybar__details,
.ao-buybar__opt {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ao-ink);
	font: inherit;
	font-size: var(--ao-small);
	cursor: pointer;
}
.ao-details__open::before,
.ao-buybar__details::before,
.ao-buybar__opt::before {
	content: "";
	border-left: 0.35em solid currentColor;
	border-block: 0.25em solid transparent;
}
.ao-details__open:hover { text-decoration: underline; }

/* Price — shown inside the button instead; the block stays in the template for
   WooCommerce structured data and in case it's wanted back. */
.ao-pdp .ao-pdp__price { display: none !important; }

.ao-pdp .ao-pdp__price,
.ao-pdp .ao-pdp__price .amount {
	font-size: 1rem;
	color: var(--ao-ink);
}
.ao-pdp .ao-pdp__price del { color: var(--ao-grey); }
.ao-pdp .ao-pdp__price ins { text-decoration: none; }

/* --------------------------------------------------------------------------
   Add to basket (WooCommerce's classic form inside the block)
   -------------------------------------------------------------------------- */
.ao-pdp .ao-pdp__buy form.cart {
	display: block; /* quantity is hidden, so nothing sits beside the button */
	margin: 0 !important;  /* WooCommerce adds 28px below the form… */
	padding: 0 !important; /* …and padding; the button spans the column and sits on the 24px line */
}

/* Variations — select per attribute, full width, hairline box */
.ao-pdp__buy table.variations {
	width: 100%;
	margin: 0 0 0.5rem;
	border: 0;
	border-collapse: collapse;
}
.ao-pdp__buy table.variations tr { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
.ao-pdp__buy table.variations th,
.ao-pdp__buy table.variations td { padding: 0; border: 0; text-align: left; background: none; }
.ao-pdp__buy table.variations label { font-size: 0.75rem; font-weight: 400; color: var(--ao-grey); }
.ao-pdp__buy table.variations select {
	width: 100%;
	height: 2.75rem;
	padding: 0 0.75rem;
	border: 1px solid var(--ao-ink);
	border-radius: 0;
	background: transparent;
	color: var(--ao-ink);
	font: inherit;
}
.ao-pdp__buy .reset_variations { font-size: 0.75rem; color: var(--ao-grey); }
.ao-pdp__buy .single_variation_wrap { width: 100%; }
.ao-pdp__buy .woocommerce-variation-add-to-cart { display: flex; gap: 0.5rem; }
.ao-pdp__buy .woocommerce-variation-price { margin-bottom: 0.5rem; }

/* No quantity selector — one piece per add to basket (still editable in the basket) */
.ao-pdp__buy .quantity { display: none !important; }

/* The one dominant button */
.ao-pdp .ao-pdp__buy .single_add_to_cart_button {
	/* Black block, half as tall as it is wide; label and price at top left. */
	flex: 1 1 100%;
	width: 100%;
	aspect-ratio: 2 / 1;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 1.1rem 1.25rem;
	display: flex !important; /* woocommerce-blocktheme.css sets inline-block, which centres the text */
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 0.15rem;
	border: 1px solid var(--ao-ink);
	border-radius: 0;
	background: var(--ao-ink);
	color: #fff;
	font: inherit;
	font-size: 1.0625rem;
	line-height: 1.3;
	text-align: left;
	letter-spacing: 0;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}
.ao-pdp .ao-pdp__buy .single_add_to_cart_button .ao-btn__label,
.ao-pdp .ao-pdp__buy .single_add_to_cart_button .ao-btn__price { display: block; }
/* Desktop type: 140% line height, label and price stacked with no gap. */
@media (min-width: 900px) {
	.ao-pdp .ao-pdp__buy .single_add_to_cart_button {
		/* 14px text; label 25px across and 22px down from the top-left corner
		   (1px border + padding; the top allows for the line's half-leading) */
		padding: 20px 24px;
		gap: 0;
		font-size: 14px;
		line-height: 1.4;
	}
}
.ao-pdp .ao-pdp__buy .single_add_to_cart_button:hover {
	background: transparent;
	color: var(--ao-ink);
}
.ao-pdp .ao-pdp__buy .single_add_to_cart_button.disabled,
.ao-pdp .ao-pdp__buy .single_add_to_cart_button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.ao-pdp .ao-pdp__buy .stock { width: 100%; margin: 0; font-size: 0.75rem; color: var(--ao-grey); }
/* Products without options: WooCommerce prints the stock line straight in
   the block, not inside the variation box. Same spacing as with options:
   20px under the delivery line, 24px above the button. */
.ao-pdp .ao-pdp__buy > .stock { margin: 8px 0 24px !important; }

/* Service notes */
.ao-notes {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.75rem;
	color: var(--ao-grey);
}

/* --------------------------------------------------------------------------
   Details drawer — built to match the basket drawer (minicart.css):
   desktop panel from the right, landing on the gallery's right edge (same
   width formula); 900–1023px half the window; phones a sheet from the bottom.
   Opens in 0.5s easing out, closes in 0.3s; scrim 30% black. The script adds
   .is-open after showModal() and waits for the slide before close().
   -------------------------------------------------------------------------- */
.ao-pd-drawer {
	/* Phones: the whole screen, sliding up from the bottom (as the basket) */
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
	border: 0;
	background: var(--ao-paper);
	color: var(--ao-ink);
	font-size: 14px;
	line-height: 1.4;
	overflow: hidden;
	outline: none;
	transform: translateY(100%);
	transition: transform 0.3s cubic-bezier(0.42, 0, 1, 1); /* closing */
}
.ao-pd-drawer[open] { display: flex; flex-direction: column; }
.ao-pd-drawer.is-open {
	transform: none;
	transition: transform 0.5s ease-out; /* opening */
}
.ao-pd-drawer::backdrop {
	background: rgba(0, 0, 0, 0.3);
	animation: ao-pd-scrim 0.2s cubic-bezier(0.42, 0, 1, 1);
}
@keyframes ao-pd-scrim { from { opacity: 0; } }
/* As the basket: the page behind doesn't scroll while the panel is open
   (and with the scrollbar gone, both panels land on the same edge). */
html:has(.ao-pd-drawer[open]) { overflow: hidden; }

@media (min-width: 900px) {
	.ao-pd-drawer {
		inset: 0 0 0 auto;
		width: 50%;
		height: 100%;
		max-height: none;
		padding: 0;
		transform: translateX(100%);
	}
}
@media (min-width: 1024px) {
	.ao-pd-drawer {
		/* identical to .ao-mc__panel: right edge of the window to the right
		   edge of the gallery (% = the viewport) */
		--ao-mc-inner: calc(100% - 2 * var(--ao-gutter, 30px));
		width: calc(var(--ao-gutter, 30px) + var(--ao-mc-inner) / 5 + 0.8 * max(12.5rem, var(--ao-mc-inner) / 6));
	}
}

.ao-pd-drawer__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	min-height: 72px;
	padding: 24px 24px 0;
	box-sizing: border-box; /* as the basket: 72px including the padding */
	flex: none;
}
.ao-pd-drawer .ao-pd-drawer__title {
	margin: 0;
	font: inherit;
	font-size: 48px; /* as the product title on the page */
	font-weight: 300;
	line-height: 1.05;
}
.ao-pd-drawer__close {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ao-ink);
	cursor: pointer;
	flex: none;
}
.ao-pd-drawer__close .ao-icon { display: block; width: 20px; height: 20px; }
.ao-pd-drawer__close:focus-visible { outline: 1px solid var(--ao-ink); outline-offset: 3px; }
.ao-pd-drawer__body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 24px; /* 24px under the title, the same as above it */
	display: flex;
	flex-direction: column;
}
.ao-pd-drawer__body > .ao-pd-section:first-child { margin-top: 0; }
/* Colour … Shipping sit at the bottom of the panel; on a long description
   they follow it, at least 24px below. */
.ao-pd-drawer__details { margin-top: auto; padding-top: 24px; }
.ao-pd-drawer__details > .ao-pd-section:first-child { margin-top: 0; }

@media (max-width: 1023px) {
	.ao-pd-drawer__head { min-height: 60px; padding: 16px 16px 0; }
	.ao-pd-drawer__body { padding: 16px; } /* 16px under the title, as above it */
}

@media (prefers-reduced-motion: reduce) {
	.ao-pd-drawer,
	.ao-pd-drawer.is-open { transition: none; }
	.ao-pd-drawer::backdrop { animation: none; }
}

.ao-pd-drawer__desc p { margin: 0 0 0.75rem; }
/* Headings inside a product description read at text size here, as on the
   reference's details panel: a label is set apart by space, not by size. */
.ao-pd-drawer .ao-pd-drawer__desc :is(h1, h2, h3, h4, h5, h6) {
	margin: 1.25rem 0 0.25rem;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
}
.ao-pd-drawer .ao-pd-drawer__desc > :first-child { margin-top: 0; }

/* Colour / Size / Material / Care: one section each, a Medium label then
   the text, no lines between them. */
.ao-pd-section { margin-top: 1.25rem; }
.ao-pd-drawer .ao-pd-section__title {
	margin: 0 0 0.25rem;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500; /* Founders Grotesk Medium */
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
}
.ao-pd-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 0.25rem;
}
.ao-pd-section__head .ao-pd-section__title { margin-bottom: 0 !important; }
/* Option switches (Size: cm·in; Shipping: UK·USA·Europe·World): Light,
   right-aligned on the heading row; the option shown is underlined. */
.ao-units { font-size: 14px; font-weight: 300; line-height: 1.4; white-space: nowrap; }
.ao-units__btn {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ao-ink);
	font: inherit;
	cursor: pointer;
	text-decoration: none;
	text-underline-offset: 3px;
}
.ao-units__btn[aria-pressed="true"] { text-decoration: underline; text-decoration-thickness: 1px; }
.ao-units__sep { margin: 0 0.15em; }
.ao-units__btn:focus-visible { outline: 1px solid var(--ao-ink); outline-offset: 2px; }
.ao-opt[hidden] { display: none; }
.ao-pd-section--light .ao-pd-section__body { font-weight: 300; } /* Handmade, Shipping */
.ao-pd-section__body p { margin: 0 0 0.5rem; }
.ao-pd-section__body p:last-child { margin-bottom: 0; }

.ao-pd-drawer__specs { margin: 1.25rem 0; }
.ao-pd-drawer__specs div {
	display: grid;
	grid-template-columns: 7rem 1fr;
	gap: 1rem;
	padding: 0.5rem 0;
	border-top: 1px solid var(--ao-rule);
}
.ao-pd-drawer__specs dt { color: var(--ao-grey); }
.ao-pd-drawer__specs dd { margin: 0; }

.ao-acc { border-top: 1px solid var(--ao-rule); }
.ao-acc:last-child { border-bottom: 1px solid var(--ao-rule); }
.ao-acc summary {
	display: flex;
	justify-content: space-between;
	padding: 0.875rem 0;
	list-style: none;
	cursor: pointer;
}
.ao-acc summary::-webkit-details-marker { display: none; }
.ao-acc summary::after { content: "+"; }
.ao-acc[open] summary::after { content: "–"; }
.ao-acc__body { padding-bottom: 1rem; }
.ao-acc__body p { margin: 0 0 0.5rem; }

/* --------------------------------------------------------------------------
   Elsewhere in the collection — as the reference's "You may like":
   18px title with back/next in its row (desktop); four products edge to edge
   on desktop, one product per click; on phones a row to swipe, two in view
   with the next peeking in. Name under each image; price on hover (desktop),
   always shown on phones. Text lines up with the left edge of its image.
   -------------------------------------------------------------------------- */
.ao-related {
	padding: 4rem var(--ao-gutter) 3rem;
}
.ao-related__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}
.ao-pdp .ao-related__title {
	margin: 0;
	font-family: inherit;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0;
}
.ao-related__nav { display: none; gap: 8px; }
.ao-related__btn {
	display: grid;
	place-items: center;
	width: 32px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ao-ink);
	cursor: pointer;
}
.ao-related__btn .ao-icon { display: block; width: 20px; height: 20px; }
.ao-related__btn:disabled { opacity: 0.3; cursor: default; }
.ao-related__btn:focus-visible { outline: 1px solid var(--ao-ink); outline-offset: 2px; }

.ao-related__track {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc(100% / 2.2); /* phones: two, and the next peeking in */
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.ao-related__track::-webkit-scrollbar { display: none; }
.ao-related__item { margin: 0; scroll-snap-align: start; min-width: 0; }
.ao-related__item a {
	display: block;
	color: var(--ao-ink);
	text-decoration: none;
}
.ao-related__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	background: var(--ao-clay);
}
.ao-related__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 16px 0 0;
	font-size: 14px;
	line-height: 1.4;
}
.ao-related__price,
.ao-related__price .amount { color: var(--ao-ink); }
.ao-related__price del { opacity: 0.6; }
.ao-related__price ins { text-decoration: none; }

@media (min-width: 900px) {
	.ao-related__nav { display: flex; }
	.ao-related__track {
		grid-auto-columns: 25%; /* four in view, edge to edge */
		overflow-x: hidden; /* moved by the buttons (and trackpads) */
	}
}
@media (min-width: 900px) and (hover: hover) {
	.ao-related__price { opacity: 0; transition: opacity 0.2s; }
	.ao-related__item a:hover .ao-related__price,
	.ao-related__item a:focus-visible .ao-related__price { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.ao-related__track { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   Phone buy bar
   -------------------------------------------------------------------------- */
.ao-buybar { display: none; }

@media (max-width: 899.98px) {
	.ao-buybar {
		position: fixed;
		/* sits on top of the header's bottom tab bar, as on the reference */
		inset: auto 0 calc(var(--ao-tabbar-h, 0px) + env(safe-area-inset-bottom)) 0;
		z-index: 40; /* under the header (50), so it hides behind the tab bar */
		display: grid;
		grid-template-columns: minmax(0, 1fr) 8.5rem;
		min-height: 6.5rem;
		background: var(--ao-paper);
		border: 0; /* no outline */
		transition: transform 0.25s ease;
	}
	.ao-buybar.is-hidden {
		transform: translateY(calc(100% + var(--ao-tabbar-h, 0px)));
		visibility: hidden;
		transition: transform 0.25s ease, visibility 0s linear 0.25s;
	}

	.ao-buybar__info {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 0.875rem 1rem;
	}
	.ao-buybar__name { font-size: var(--ao-small); line-height: 1.3; }
	/* "▸ All details   ▸ Colour", 24px apart as on the reference */
	.ao-buybar__links { display: flex; flex-wrap: wrap; gap: 4px 24px; }

	.ao-buybar__cta {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
		padding: 0.875rem 1rem;
		border: 0;
		border-radius: 0;
		background: var(--ao-ink);
		color: #fff;
		font: inherit;
		font-size: var(--ao-small);
		text-align: left;
		cursor: pointer;
	}
	.ao-buybar__label,
	.ao-buybar__price { display: block; }
	.ao-buybar__price,
	.ao-buybar__price .amount { color: #fff; }
	.ao-buybar__price del { opacity: 0.7; }
	.ao-buybar__price ins { text-decoration: none; }

	/* Keep the footer clear of the bar */
	body.has-ao-buybar { padding-bottom: calc(var(--ao-tabbar-h, 0px) + 6.5rem + env(safe-area-inset-bottom)); }
}

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

/* --------------------------------------------------------------------------
   Other gallery plugins (Woo Product Gallery Slider) print their own slider
   above this layout. This template has its own gallery, so hide theirs.
   Deactivating that plugin is the cleaner fix.
   -------------------------------------------------------------------------- */
body.single-product .woo-product-gallery-slider { display: none !important; }

/* --------------------------------------------------------------------------
   Phone scroll hint, as on the reference: until the visitor first scrolls,
   the photo column lifts 48px and drops back (0.75s, ease-in-out) about 4s
   after load and then every 8s. The script adds/removes .is-hinting.
   -------------------------------------------------------------------------- */
@keyframes ao-gallery-hint {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-48px); }
}
@media (max-width: 899.98px) {
	.ao-gallery.is-hinting { animation: ao-gallery-hint 750ms ease-in-out 1; }
}
@media (prefers-reduced-motion: reduce) {
	.ao-gallery.is-hinting { animation: none; }
}

/* Estimated delivery, above Add to basket (inc/delivery.php) */
.ao-pdp .ao-pdp__delivery { margin: 0; }

/* Per-variation Size / Designers notes: parts the script hides */
.ao-dn[hidden],
.ao-pd-section[hidden],
.ao-pd-section .ao-units[hidden] { display: none !important; }
