/* AYATOP product page (PS-15). Tokens only. */

.ak-pdp-notices:empty { display: none; }

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	display: block;
	margin: var(--ak-space-4) 0;
	padding: var(--ak-space-4);
	border: var(--ak-border-width) solid var(--ak-color-border-strong);
	border-inline-start-width: 0.375rem;
	background: var(--ak-color-surface-default);
	list-style: none;
}
.woocommerce-message { border-color: var(--ak-color-success); }
.woocommerce-error { border-color: var(--ak-color-error); }
.woocommerce-message .button,
.woocommerce-message a.wc-forward { margin-inline-start: var(--ak-space-3); font-weight: var(--ak-weight-medium); }

.ak-pdp__main {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: var(--ak-space-6) clamp(var(--ak-space-5), 4vw, var(--ak-space-8));
	align-items: start;
	padding-block: var(--ak-space-4) var(--ak-space-section);
}

@media (max-width: 63.999rem) {
	.ak-pdp__main { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Gallery ---------- */
.ak-gallery { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: var(--ak-space-3); align-items: start; }
.ak-gallery[data-count="1"],
.ak-gallery--empty { grid-template-columns: minmax(0, 1fr); }

.ak-gallery__thumbs { display: grid; gap: var(--ak-space-2); margin: 0; padding: 0; list-style: none; max-height: 40rem; overflow-y: auto; }
.ak-gallery__thumb { display: block; width: 100%; padding: 0; border: var(--ak-border-width) solid var(--ak-color-border-subtle); background: var(--ak-color-canvas-secondary); cursor: pointer; aspect-ratio: 1 / 1; }
.ak-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ak-gallery__thumb:hover { border-color: var(--ak-color-text-primary); }
.ak-gallery__thumb[aria-current="true"] { border-color: var(--ak-color-interactive-primary); border-width: var(--ak-border-width-emphasis); }

.ak-gallery__main { position: relative; min-width: 0; }

.ak-gallery__track {
	position: relative;
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
	background: var(--ak-color-canvas-secondary);
	aspect-ratio: var(--ak-gallery-ratio, 4 / 5);
	max-height: 85vh;
}
.ak-gallery__track::-webkit-scrollbar { display: none; }

.ak-gallery__slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; }
.ak-gallery__zoom { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.ak-gallery__image { width: 100%; height: 100%; object-fit: contain; }

.ak-gallery__placeholder,
.ak-gallery--empty .ak-gallery__main { display: grid; place-items: center; min-height: 18rem; color: var(--ak-color-text-muted); background: var(--ak-color-canvas-secondary); aspect-ratio: var(--ak-gallery-ratio, 4 / 5); }

.ak-gallery__counter {
	position: absolute;
	inset-inline-end: var(--ak-space-3);
	bottom: var(--ak-space-3);
	margin: 0;
	padding: 0.125rem var(--ak-space-3);
	background: var(--ak-color-surface-default);
	border: var(--ak-border-width) solid var(--ak-color-border-subtle);
	font-size: var(--ak-type-body-small);
	font-variant-numeric: tabular-nums;
}

.ak-gallery__nav {
	position: absolute;
	top: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--ak-target-min);
	height: var(--ak-target-min);
	transform: translateY(-50%);
	border: var(--ak-border-width) solid var(--ak-color-border-strong);
	background: var(--ak-color-surface-default);
	color: var(--ak-color-text-primary);
	cursor: pointer;
}
.ak-gallery__nav--prev { inset-inline-start: var(--ak-space-3); }
.ak-gallery__nav--next { inset-inline-end: var(--ak-space-3); }
.ak-gallery__nav:hover { border-color: var(--ak-color-interactive-primary); }

.ak-gallery__dots { display: none; position: absolute; bottom: var(--ak-space-3); inset-inline: 0; justify-content: center; gap: 0.375rem; margin: 0; padding: 0; list-style: none; }
.ak-gallery__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; border: var(--ak-border-width) solid var(--ak-color-text-primary); background: var(--ak-color-surface-default); }
.ak-gallery__dot.is-current { background: var(--ak-color-text-primary); }

@media (max-width: 63.999rem) {
	.ak-gallery { grid-template-columns: minmax(0, 1fr); }
	.ak-gallery__thumbs { order: 2; grid-auto-flow: column; grid-auto-columns: 4.5rem; max-height: none; overflow-x: auto; overflow-y: hidden; padding-bottom: var(--ak-space-1); }
}

@media (max-width: 39.999rem) {
	.ak-gallery__thumbs,
	.ak-gallery__nav { display: none; }
	.ak-gallery__dots { display: flex; }
	.ak-gallery__counter { inset-inline-end: var(--ak-space-2); top: var(--ak-space-2); bottom: auto; }
}

/* ---------- Purchase panel ---------- */
.ak-pdp__brand { margin: 0 0 var(--ak-space-2); font-size: var(--ak-type-body-small); color: var(--ak-color-text-secondary); }
.ak-pdp__brand a { color: inherit; }
.ak-pdp__title { margin: 0 0 var(--ak-space-3); font-size: var(--ak-type-h1); }
.ak-pdp__price { margin: 0; font-size: 1.375rem; }
.ak-pdp__price .woocommerce-Price-amount { font-weight: var(--ak-weight-medium); }

.ak-pdp__availability { display: flex; align-items: center; gap: var(--ak-space-2); margin: var(--ak-space-2) 0 var(--ak-space-4); font-size: var(--ak-type-body-small); font-weight: var(--ak-weight-medium); }
.ak-pdp__availability--in,
.ak-pdp__availability--low { color: var(--ak-color-success); }
.ak-pdp__availability--out,
.ak-pdp__availability--unavailable { color: var(--ak-color-error); }
.ak-pdp__availability--backorder { color: var(--ak-color-warning); }

.ak-pdp__short { margin-bottom: var(--ak-space-5); color: var(--ak-color-text-secondary); }

/* Variations: WooCommerce's table becomes simple stacked rows */
.ak-pdp table.variations,
.ak-pdp table.variations tbody,
.ak-pdp table.variations tr,
.ak-pdp table.variations th,
.ak-pdp table.variations td { display: block; padding: 0; border: 0; text-align: start; }
.ak-pdp table.variations { margin: 0 0 var(--ak-space-4); }
.ak-pdp table.variations tr + tr { margin-top: var(--ak-space-4); }
.ak-pdp table.variations th { margin-bottom: var(--ak-space-2); font-size: var(--ak-type-label); font-weight: var(--ak-weight-medium); }
.ak-pdp table.variations th label { font-weight: inherit; }

.ak-pdp table.variations select { width: 100%; min-height: var(--ak-target-min); padding: var(--ak-space-3) var(--ak-space-4); border: var(--ak-border-width) solid var(--ak-color-border-strong); border-radius: var(--ak-radius-control); background: var(--ak-color-surface-default); font: inherit; }
.ak-pdp .ak-options-enhanced select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }

.ak-options { display: flex; flex-wrap: wrap; gap: var(--ak-space-2); }
.ak-options.has-error { outline: var(--ak-border-width-emphasis) solid var(--ak-color-error); outline-offset: 0.375rem; }
.ak-options__guide { margin-bottom: var(--ak-space-2); }
.ak-option { min-width: var(--ak-target-min); }
.ak-option:hover:not([aria-disabled="true"]) { border-color: var(--ak-color-text-primary); }

.ak-pdp a.reset_variations { display: inline-block; margin-top: var(--ak-space-2); font-size: var(--ak-type-body-small); }
.ak-pdp .woocommerce-variation-price,
.ak-pdp .woocommerce-variation-availability { display: none; }
.ak-pdp .woocommerce-variation-description { margin-bottom: var(--ak-space-3); color: var(--ak-color-text-secondary); font-size: var(--ak-type-body-small); }
.ak-pdp .single_variation:empty { display: none; }

/* Quantity and Add to Basket on one row */
.ak-pdp form.cart:not(.variations_form),
.ak-pdp .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; gap: var(--ak-space-3); align-items: stretch; margin: 0; }

.ak-pdp .quantity { display: inline-flex; align-items: center; border: var(--ak-border-width) solid var(--ak-color-border-strong); border-radius: var(--ak-radius-control); background: var(--ak-color-surface-default); }
.ak-pdp .quantity input.qty { width: 3.25rem; min-height: var(--ak-target-min); padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.ak-pdp .quantity input.qty::-webkit-outer-spin-button,
.ak-pdp .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ak-pdp .quantity .ak-qty__button { width: 2.5rem; height: var(--ak-target-min); }

.ak-pdp .single_add_to_cart_button {
	flex: 1 1 12rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--ak-space-2);
	min-height: 3.25rem;
	padding: var(--ak-space-3) var(--ak-space-6);
	border: var(--ak-border-width) solid var(--ak-color-interactive-primary);
	border-radius: var(--ak-radius-control);
	background: var(--ak-color-interactive-primary);
	color: var(--ak-color-text-on-interactive);
	font-family: var(--ak-font-ui);
	font-size: var(--ak-type-button);
	font-weight: var(--ak-weight-medium);
	cursor: pointer;
}
.ak-pdp .single_add_to_cart_button:hover { background: var(--ak-color-interactive-primary-hover); border-color: var(--ak-color-interactive-primary-hover); }
.ak-pdp .single_add_to_cart_button.disabled { background: var(--ak-color-canvas-secondary); color: var(--ak-color-text-muted); border: var(--ak-border-width) dashed var(--ak-color-border-strong); cursor: pointer; }
.ak-pdp .single_add_to_cart_button[aria-busy="true"] { cursor: progress; pointer-events: none; }
.ak-pdp .single_add_to_cart_button[aria-busy="true"]::after { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ak-spin 0.8s linear infinite; }

/* Grouped products: quantity per row */
.ak-pdp .woocommerce-grouped-product-list { width: 100%; margin-bottom: var(--ak-space-4); }
.ak-pdp .woocommerce-grouped-product-list td { padding: var(--ak-space-2) var(--ak-space-3) var(--ak-space-2) 0; border-bottom: var(--ak-border-width) solid var(--ak-color-border-subtle); vertical-align: middle; }

.ak-pdp__feedback { margin-top: var(--ak-space-4); }
.ak-pdp__feedback:empty { display: none; }
.ak-pdp__secondary:empty { display: none; }
.ak-pdp__secondary { margin-top: var(--ak-space-4); }

.ak-pdp__policy { display: flex; flex-wrap: wrap; gap: var(--ak-space-2) var(--ak-space-5); margin: var(--ak-space-5) 0 0; padding: var(--ak-space-4) 0 0; border-top: var(--ak-border-width) solid var(--ak-color-border-subtle); list-style: none; font-size: var(--ak-type-body-small); }

/* ---------- Information accordion ---------- */
.ak-pdp__info { padding-bottom: var(--ak-space-section); }
.ak-accordion { border-top: var(--ak-border-width) solid var(--ak-color-border-subtle); }
.ak-accordion__item { border-bottom: var(--ak-border-width) solid var(--ak-color-border-subtle); }

.ak-accordion__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ak-space-4);
	min-height: 3.5rem;
	padding-block: var(--ak-space-2);
	font-family: var(--ak-font-display);
	font-size: var(--ak-type-h4);
	cursor: pointer;
	list-style: none;
}
.ak-accordion__summary::-webkit-details-marker { display: none; }
.ak-accordion__item[open] > .ak-accordion__summary .ak-icon { transform: rotate(180deg); }
.ak-accordion__body { padding-bottom: var(--ak-space-5); }

.ak-spec { margin: 0; }
.ak-spec__row { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); gap: var(--ak-space-4); padding-block: var(--ak-space-2); border-bottom: var(--ak-border-width) solid var(--ak-color-border-subtle); }
.ak-spec__row:last-child { border-bottom: 0; }
.ak-spec dt { font-weight: var(--ak-weight-medium); color: var(--ak-color-text-secondary); }
.ak-spec dd { margin: 0; }
.ak-spec__text { max-width: var(--ak-measure-reading); }
.ak-spec__text h3 { margin: var(--ak-space-4) 0 var(--ak-space-2); font-size: var(--ak-type-h5); }

@media (max-width: 39.999rem) {
	.ak-spec__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* ---------- Reviews ---------- */
.ak-pdp__reviews { padding-bottom: var(--ak-space-section); }
.ak-reviews__title { margin-bottom: var(--ak-space-5); }
.ak-reviews__summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ak-space-5) var(--ak-space-7); margin-bottom: var(--ak-space-6); padding-bottom: var(--ak-space-5); border-bottom: var(--ak-border-width) solid var(--ak-color-border-subtle); }
.ak-reviews__average { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ak-space-3); margin: 0; }
.ak-reviews__score { font-family: var(--ak-font-display); font-size: var(--ak-type-h1); line-height: 1; }
.ak-reviews__count { color: var(--ak-color-text-secondary); font-size: var(--ak-type-body-small); }
.ak-reviews__bars { display: grid; gap: var(--ak-space-1); margin: 0; padding: 0; list-style: none; }
.ak-reviews__bar { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 2rem; align-items: center; gap: var(--ak-space-3); font-size: var(--ak-type-body-small); }
.ak-reviews__bar-track { display: block; height: 0.5rem; background: var(--ak-color-canvas-secondary); border: var(--ak-border-width) solid var(--ak-color-border-subtle); }
.ak-reviews__bar-track span { display: block; height: 100%; background: var(--ak-color-text-primary); }
.ak-reviews__bar-count { text-align: end; font-variant-numeric: tabular-nums; }

.ak-review-list { margin: 0; padding: 0; list-style: none; }
.ak-review { padding-block: var(--ak-space-5); border-top: var(--ak-border-width) solid var(--ak-color-border-subtle); }
.ak-review:first-child { border-top: 0; padding-top: 0; }
.ak-review__head { display: grid; gap: var(--ak-space-1); margin-bottom: var(--ak-space-2); }
.ak-review__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ak-space-1) var(--ak-space-3); margin: 0; font-size: var(--ak-type-body-small); color: var(--ak-color-text-secondary); }
.ak-review__author { color: var(--ak-color-text-primary); }
.ak-review__verified { padding: 0 var(--ak-space-2); border: var(--ak-border-width) solid var(--ak-color-border-strong); border-radius: var(--ak-radius-badge); font-size: var(--ak-type-meta); }
.ak-review__text p { max-width: var(--ak-measure-reading); }
.ak-reviews__empty,
.ak-reviews__note { color: var(--ak-color-text-secondary); }

.ak-reviews__form { margin-top: var(--ak-space-6); padding-top: var(--ak-space-5); border-top: var(--ak-border-width) solid var(--ak-color-border-subtle); }
.ak-reviews__form-title { margin-bottom: var(--ak-space-4); font-size: var(--ak-type-h3); }
.ak-reviews__form form { display: grid; gap: var(--ak-space-4); max-width: 36rem; }
.ak-reviews__form .form-submit { margin: 0; }
.ak-rating-input { margin: 0; padding: 0; border: 0; }
.ak-rating-input legend { margin-bottom: var(--ak-space-2); padding: 0; font-size: var(--ak-type-label); font-weight: var(--ak-weight-medium); }

@media (max-width: 47.999rem) {
	.ak-reviews__summary { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Full-screen image viewer ---------- */
.ak-viewer { position: fixed; inset: 0; z-index: var(--ak-z-modal); display: flex; flex-direction: column; background: var(--ak-color-surface-default); padding-top: env(safe-area-inset-top, 0px); }
.ak-viewer[hidden] { display: none; }
.ak-viewer__bar { display: flex; align-items: center; justify-content: space-between; padding: var(--ak-space-2) var(--ak-space-4); }
.ak-viewer__count { margin: 0; font-variant-numeric: tabular-nums; color: var(--ak-color-text-secondary); }
.ak-viewer__stage { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; min-height: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
.ak-viewer__figure { display: grid; place-items: center; height: 100%; min-height: 0; margin: 0; padding: var(--ak-space-2); }
.ak-viewer__image { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.ak-viewer__nav { display: inline-flex; align-items: center; justify-content: center; width: var(--ak-target-min); height: var(--ak-target-min); margin-inline: var(--ak-space-2); border: var(--ak-border-width) solid var(--ak-color-border-strong); background: var(--ak-color-surface-default); color: var(--ak-color-text-primary); cursor: pointer; }
.ak-viewer__nav[hidden] { display: none; }

/* ---------- Sticky purchase bar (phones only) ---------- */
.ak-sticky-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: var(--ak-z-header); padding: var(--ak-space-3) var(--ak-page-gutter); padding-bottom: max(var(--ak-space-3), env(safe-area-inset-bottom, 0px)); background: var(--ak-color-surface-default); border-top: var(--ak-border-width) solid var(--ak-color-border-subtle); box-shadow: var(--ak-shadow-overlay); }
.ak-sticky-bar[hidden] { display: none; }
.ak-sticky-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--ak-space-4); }
.ak-sticky-bar__price { margin: 0; font-weight: var(--ak-weight-medium); }
.ak-sticky-bar .ak-button { flex: 0 1 14rem; }
html.ak-has-sticky body { padding-bottom: 5rem; }

@media (min-width: 48rem) {
	.ak-sticky-bar { display: none !important; }
	html.ak-has-sticky body { padding-bottom: 0; }
}

/* ---------- Without JavaScript ---------- */
html:not(.ak-js) .ak-gallery__nav,
html:not(.ak-js) .ak-gallery__dots { display: none; }
