/* Same un-constraining trick as the Shop page -- Astra's centered/width-limited
   .ast-container fights the full-bleed fixed-background layout otherwise. */
body.a5-product-page .ast-container {
	display: block !important;
	max-width: none;
	width: 100%;
	margin: 0;
	padding: 0;
}
body.a5-product-page .site-content {
	overflow: visible;
}

html {
	scroll-behavior: smooth;
}

/* Same position:fixed background technique as the page heroes and the Shop
   grid -- see the long comment in a5-site-styles/site.css for why it has to
   be built this way (background-attachment:fixed doesn't render on iOS
   Safari; negative z-index silently fails to paint in this environment).
   Background-image itself is set per-product via wp_add_inline_style() in
   a5-product.php. */
.a5-product-hero {
	position: relative;
	min-height: 100vh;
	min-height: 100dvh;
	box-sizing: border-box;
	padding: 140px 24px 64px;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 48px;
}
.a5-product-hero::before {
	content: '';
	position: fixed;
	/* -40px/+80px parallax bleed -- see the long comment on
	   .a5-hero-fixed-bg::before in a5-site-styles/site.css for why. */
	top: -40px;
	left: 0;
	right: 0;
	/* Explicit height instead of bottom:0, and deliberately plain 100vh
	   (not 100dvh) -- see the long comment on .a5-hero-fixed-bg::before in
	   a5-site-styles/site.css for why. */
	height: calc(100vh + 80px);
	z-index: 0;
	background-color: #F3F3E8;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transform: translateY(var(--a5-parallax-y, 0px));
}
/* Fallback fill color shows for the instant before the background photo has
   finished downloading -- without this, dark-background pages flash white. */
.a5-product-hero--on-dark::before {
	background-color: #151616;
}
.a5-product-hero > * {
	position: relative;
	z-index: 1;
}

.a5-product-photo-col {
	flex: 0 0 auto;
	width: min(100%, 420px);
}
.a5-product-photo {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	border-radius: 24px;
	overflow: hidden;
	background-color: rgba(255, 255, 255, 0.06);
	border: none;
	padding: 0;
	margin: 0;
	cursor: zoom-in;
}
.a5-product-image-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	object-fit: cover !important;
	display: block;
	opacity: 0;
	transition: opacity 0.4s ease;
}
.a5-product-image-layer.is-active {
	opacity: 1;
}

.a5-product-photo__zoom-cue {
	position: absolute;
	right: 14px;
	bottom: 14px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background-color: rgba(21, 22, 22, 0.55);
	color: #f3f3e8;
	opacity: 0;
	transform: scale(0.85);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}
.a5-product-photo:hover .a5-product-photo__zoom-cue {
	opacity: 1;
	transform: scale(1);
}

.a5-product-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}
.a5-product-thumb {
	flex: 0 0 auto;
	width: 64px;
	aspect-ratio: 3 / 4;
	border-radius: 8px;
	overflow: hidden;
	padding: 0;
	background: none;
	cursor: pointer;
	border: 1.5px solid transparent;
	opacity: 0.6;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}
.a5-product-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.a5-product-thumb:hover {
	opacity: 0.85;
}
.a5-product-thumb.is-active {
	opacity: 1;
}
.a5-product-hero--on-dark .a5-product-thumb.is-active {
	border-color: #f3f3e8;
}
.a5-product-hero--on-light .a5-product-thumb.is-active {
	border-color: #151616;
}

.a5-product-info {
	flex: 0 1 auto;
	width: fit-content;
	min-width: 300px;
	max-width: 420px;
	display: flex;
	flex-direction: column;
	padding: 28px 32px;
	border-radius: 20px;
}

.a5-product-info__top {
	display: flex;
	flex-direction: column;
	margin-bottom: 24px;
}
.a5-product-price {
	display: block;
	font-size: 18px;
	margin-top: 6px;
}
.a5-product-price .woocommerce-Price-amount {
	color: inherit;
}
.a5-product-shipping-note {
	display: block;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: 4px;
}
.a5-product-title {
	font-size: 28px;
	font-weight: 700;
	margin: 0;
}

.a5-product-short-desc {
	font-size: 15px;
	line-height: 1.5;
	margin: 16px 0 28px;
	max-width: 40ch;
}

.a5-product-cut {
	margin: -12px 0 28px;
	max-width: 40ch;
}
.a5-product-cut__label {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 8px;
}
.a5-product-cut__desc {
	font-size: 13px;
	line-height: 1.5;
	margin: 0;
}

.a5-product-option {
	margin-bottom: 24px;
}
.a5-product-option__label {
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.06em;
	margin-bottom: 10px;
}
.a5-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
}
.a5-swatch {
	background: none;
	border: none;
	padding: 2px 0;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	cursor: pointer;
	border-bottom: 1px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.a5-add-to-cart {
	align-self: flex-start;
	background: transparent;
	border-radius: 10px;
	padding: 14px 36px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
	margin-top: 8px;
}
.a5-add-to-cart:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.a5-product-notice {
	margin-top: 12px;
	font-size: 13px;
	min-height: 1em;
}

/* Dark-background variant (Cool Jazz, New Wave, Arcana): light/cream text. */
.a5-product-hero--on-dark .a5-product-info {
	color: #f3f3e8;
	background-color: #151616;
}
.a5-product-hero--on-dark .a5-product-price {
	color: rgba(243, 243, 232, 0.75);
}
.a5-product-hero--on-dark .a5-product-shipping-note {
	color: rgba(243, 243, 232, 0.55);
}
.a5-product-hero--on-dark .a5-product-title {
	color: #f3f3e8;
}
.a5-product-hero--on-dark .a5-product-short-desc {
	color: rgba(243, 243, 232, 0.75);
}
.a5-product-hero--on-dark .a5-product-cut__label {
	background-color: rgba(243, 243, 232, 0.12);
	color: #f3f3e8;
}
.a5-product-hero--on-dark .a5-product-cut__desc {
	color: rgba(243, 243, 232, 0.6);
}
.a5-product-hero--on-dark .a5-product-option__label {
	color: rgba(243, 243, 232, 0.6);
}
.a5-product-hero--on-dark .a5-swatch {
	color: rgba(243, 243, 232, 0.55);
}
.a5-product-hero--on-dark .a5-swatch:hover {
	color: rgba(243, 243, 232, 0.85);
}
.a5-product-hero--on-dark .a5-swatch.is-selected {
	color: #f3f3e8;
	border-bottom-color: #f3f3e8;
}
.a5-product-hero--on-dark .a5-swatch.is-disabled {
	color: rgba(243, 243, 232, 0.25);
}
.a5-product-hero--on-dark .a5-add-to-cart {
	color: #f3f3e8;
	border: 1.5px solid #f3f3e8;
}
.a5-product-hero--on-dark .a5-add-to-cart:hover:not(:disabled) {
	background-color: #f3f3e8;
	color: #151616;
}
.a5-product-hero--on-dark .a5-product-notice {
	color: rgba(243, 243, 232, 0.75);
}

/* Light-background variant (Prism, Dip Dyed): dark text so it stays legible
   against the light photo. */
.a5-product-hero--on-light .a5-product-info {
	color: #151616;
	background-color: #F3F3E8;
}
.a5-product-hero--on-light .a5-product-price {
	color: rgba(21, 22, 22, 0.7);
}
.a5-product-hero--on-light .a5-product-shipping-note {
	color: rgba(21, 22, 22, 0.55);
}
.a5-product-hero--on-light .a5-product-title {
	color: #151616;
}
.a5-product-hero--on-light .a5-product-short-desc {
	color: rgba(21, 22, 22, 0.7);
}
.a5-product-hero--on-light .a5-product-cut__label {
	background-color: rgba(21, 22, 22, 0.08);
	color: #151616;
}
.a5-product-hero--on-light .a5-product-cut__desc {
	color: rgba(21, 22, 22, 0.6);
}
.a5-product-hero--on-light .a5-product-option__label {
	color: rgba(21, 22, 22, 0.6);
}
.a5-product-hero--on-light .a5-swatch {
	color: rgba(21, 22, 22, 0.55);
}
.a5-product-hero--on-light .a5-swatch:hover {
	color: rgba(21, 22, 22, 0.85);
}
.a5-product-hero--on-light .a5-swatch.is-selected {
	color: #151616;
	border-bottom-color: #151616;
}
.a5-product-hero--on-light .a5-swatch.is-disabled {
	color: rgba(21, 22, 22, 0.25);
}
.a5-product-hero--on-light .a5-add-to-cart {
	color: #151616;
	border: 1.5px solid #151616;
}
.a5-product-hero--on-light .a5-add-to-cart:hover:not(:disabled) {
	background-color: #151616;
	color: #f3f3e8;
}
.a5-product-hero--on-light .a5-product-notice {
	color: rgba(21, 22, 22, 0.75);
}

/* Flows below the photo/info row (flex-basis:100% forces it onto its own line
   in the wrapping flex row) instead of being pinned via position:absolute to
   the bottom of the min-height:100vh hero -- that fixed offset put it right
   on top of the color-thumbnail strip for short-content products (e.g. the
   Beanie, which has no size/description text to push the row down). */
.a5-product-hero .a5-product-scroll-cue {
	flex-basis: 100%;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	text-decoration: none;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.08em;
	opacity: 0.85;
}
.a5-product-hero--on-dark .a5-product-scroll-cue {
	color: #f3f3e8;
}
.a5-product-hero--on-light .a5-product-scroll-cue {
	color: #151616;
}

/* Product details / description below the hero -- text color follows whichever
   post-hero fill variant the template applied (dark fill for dark-hero products,
   the default cream fill with dark text otherwise). */
.a5-product-details-inner {
	max-width: 720px;
	padding: 64px 24px;
	color: rgba(21, 22, 22, 0.85);
}
.a5-product-details-inner h2 {
	margin-top: 48px;
	font-size: 20px;
}
/* Belt-and-suspenders: a5_render_size_guide() (a5-product.php) renders our own
   clean size list independently of the saved description, but the supplier's
   sync will keep re-adding its own raw desktop-width table to the description
   text on every future sync regardless -- so any table that lands inside the
   description itself stays hidden rather than showing both. */
.a5-product-details-inner table {
	display: none;
}
.a5-product-details-inner ul {
	padding-left: 20px;
}
.a5-post-hero-fill--on-dark .a5-product-details-inner {
	color: rgba(243, 243, 232, 0.85);
}

/* Size guide -- a reflowing list instead of a table, so nothing ever needs
   sideways scrolling on a phone. Desktop lays each size out as a row (label +
   four stats in a line); mobile stacks the stats into a 2-column grid under
   the size label instead of forcing 5 columns into a narrow screen. */
.a5-size-guide {
	margin-top: 48px;
}
.a5-size-guide__note,
.a5-size-guide__margin {
	font-size: 13px;
	color: rgba(21, 22, 22, 0.6);
	margin: 0 0 16px;
}
.a5-post-hero-fill--on-dark .a5-size-guide__note,
.a5-post-hero-fill--on-dark .a5-size-guide__margin {
	color: rgba(243, 243, 232, 0.6);
}
.a5-size-guide__margin {
	margin: 16px 0 0;
}
.a5-size-guide__list {
	border-top: 1px solid rgba(21, 22, 22, 0.12);
}
.a5-post-hero-fill--on-dark .a5-size-guide__list {
	border-color: rgba(243, 243, 232, 0.15);
}
.a5-size-guide__row {
	display: flex;
	align-items: baseline;
	gap: 20px;
	padding: 14px 0;
	border-bottom: 1px solid rgba(21, 22, 22, 0.12);
}
.a5-post-hero-fill--on-dark .a5-size-guide__row {
	border-color: rgba(243, 243, 232, 0.15);
}
.a5-size-guide__label {
	flex: 0 0 40px;
	font-weight: 700;
	font-size: 15px;
}
.a5-size-guide__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 24px;
	flex: 1;
}
.a5-size-guide__stat {
	font-size: 14px;
	color: rgba(21, 22, 22, 0.8);
}
.a5-post-hero-fill--on-dark .a5-size-guide__stat {
	color: rgba(243, 243, 232, 0.8);
}
.a5-size-guide__stat b {
	font-weight: 600;
	margin-right: 4px;
}
.a5-size-guide__cm {
	color: rgba(21, 22, 22, 0.5);
}
.a5-post-hero-fill--on-dark .a5-size-guide__cm {
	color: rgba(243, 243, 232, 0.5);
}

@media (max-width: 560px) {
	.a5-size-guide__row {
		flex-direction: column;
		gap: 8px;
	}
	.a5-size-guide__stats {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 6px 16px;
		width: 100%;
	}
}

/* Fly-to-cart dot -- a single element animated from the Add to Cart button to
   the header's Bag link on a successful add; removed from the DOM once it
   arrives (see product.js). */
.a5-fly-dot {
	position: fixed;
	top: 0;
	left: 0;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	z-index: 10000;
	pointer-events: none;
	opacity: 1;
	transform: translate(0, 0) scale(1);
	transition: transform 0.65s cubic-bezier(0.55, 0, 0.1, 1), opacity 0.65s ease;
}

/* Click-to-zoom modal -- built once in JS and reused across image clicks. */
.a5-zoom-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	box-sizing: border-box;
	background-color: rgba(21, 22, 22, 0.9);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.a5-zoom-modal.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.25s ease;
}
.a5-zoom-modal img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 8px;
	transform: scale(0.96);
	transition: transform 0.25s ease;
}
.a5-zoom-modal.is-open img {
	transform: scale(1);
}
.a5-zoom-modal__close {
	position: absolute;
	top: 20px;
	right: 24px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid rgba(243, 243, 232, 0.4);
	background: transparent;
	color: #f3f3e8;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.a5-zoom-modal__close:hover {
	background-color: rgba(243, 243, 232, 0.12);
}

/* Sticky mini add-to-cart bar -- shows once the main product info card has
   scrolled out of view, mirrors the main form's disabled/label state. */
.a5-sticky-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 500;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 24px;
	background-color: #f3f3e8;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.a5-sticky-bar.is-visible {
	transform: translateY(0);
}
.a5-sticky-bar img {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
}
.a5-sticky-bar__info {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	color: #151616;
}
.a5-sticky-bar__title {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.a5-sticky-bar__price {
	font-size: 12px;
	color: rgba(21, 22, 22, 0.65);
}
.a5-sticky-bar__button {
	flex-shrink: 0;
	color: #151616 !important;
	border: 1.5px solid #151616 !important;
	padding: 10px 22px !important;
	margin-top: 0 !important;
}
.a5-sticky-bar__button:hover:not(:disabled) {
	background-color: #151616 !important;
	color: #f3f3e8 !important;
}

@media (max-width: 780px) {
	.a5-product-hero {
		padding: 120px 20px 56px;
		flex-direction: column;
	}
	.a5-product-hero::before {
		background-position: right center;
	}
	/* DiscStack01's column subject sits ~80% across the source photo, not at
	   its right edge -- the generic "right center" crop above pushes past it,
	   cropping the discs out almost entirely on narrow viewports. */
	body.postid-1926 .a5-product-hero::before {
		background-position: 80% center;
	}
	.a5-product-photo-col {
		width: 100%;
		max-width: 420px;
	}
	.a5-product-info {
		max-width: 100%;
	}
	.a5-product-details-inner {
		padding: 48px 20px;
	}
	/* The 2px-padding tap target is fine with a mouse pointer but is small
	   enough on a touch screen to cause mis-taps between adjacent swatches
	   (or on the gap between them, registering nothing) -- bigger padding
	   here without changing the desktop sizing. */
	.a5-swatch {
		padding: 8px 2px;
	}
	.a5-swatches {
		gap: 4px 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.a5-fly-dot {
		display: none;
	}
	.a5-product-image-layer,
	.a5-zoom-modal,
	.a5-zoom-modal img,
	.a5-sticky-bar {
		transition: none !important;
	}
}
