/* ==========================================================================
   Single product page.
   ========================================================================== */

.woocommerce-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 28px; font-size: 0.86rem; color: var(--muted); }
.woocommerce-breadcrumb .sep { opacity: 0.6; }
.woocommerce-breadcrumb a { color: var(--ink); font-weight: 600; }
.woocommerce-breadcrumb a:hover { color: var(--accent); }

.woocommerce div.product {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: 40px clamp(32px, 5vw, 72px);
	align-items: start;
}
.woocommerce div.product > * { min-width: 0; }
.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .related,
.woocommerce div.product .upsells { grid-column: 1 / -1; }

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

.woocommerce div.product div.images {
	float: none !important; /* Beat WooCommerce's 48% float layout. */
	width: auto !important;
	margin: 0;
	top: auto !important; /* Never offset the photos on phones. */
}
/* The photos scroll with the page (no pinning), so nothing ever runs over them.
   WooCommerce sets position: relative on the gallery; keep it that way. */
.woocommerce div.product div.images { position: relative !important; }
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper { margin: 0; }
.woocommerce div.product .woocommerce-product-gallery__image {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	cursor: zoom-in;
}
/* :not(.zoomImg): the hover-zoom copy of the photo must stay full size. */
.woocommerce div.product .woocommerce-product-gallery__image img:not(.zoomImg) {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: contain;
	padding: 6%;
	border-radius: 0;
}
.woocommerce div.product .woocommerce-product-gallery__image .zoomImg { padding: 0; background: #fff; }

/* Thumbnails: one row of five, swipe or scroll for more. WooCommerce sizes
   them at 25% of their cell, hence the !important. */
.woocommerce div.product div.images .flex-control-thumbs {
	position: relative;
	display: flex;
	gap: 10px;
	margin: 12px 0 0;
	padding: 2px 2px 8px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
	scrollbar-color: var(--line) transparent;
}
.woocommerce div.product div.images .flex-control-thumbs li {
	flex: 0 0 calc((100% - 40px) / 5) !important;
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	scroll-snap-align: start;
}
.woocommerce div.product div.images .flex-control-thumbs li img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: contain;
	padding: 6%;
	background: #fff;
	border: 2px solid var(--line);
	border-radius: 12px;
	opacity: 0.65;
	cursor: pointer;
	transition: opacity 0.2s, border-color 0.2s;
}
.woocommerce div.product div.images .flex-control-thumbs li img:hover { opacity: 1; }
.woocommerce div.product div.images .flex-control-thumbs li img.flex-active { opacity: 1; border-color: var(--ink); }
@media (max-width: 560px) {
	.woocommerce div.product div.images .flex-control-thumbs li { flex-basis: calc((100% - 30px) / 4.4) !important; }
}

/* Previous / next on the main photo */
.woocommerce div.product div.images .flex-viewport { position: relative; border-radius: var(--radius); }
.gallery-nav {
	position: absolute;
	top: 50%;
	z-index: 4;
	display: grid;
	place-items: center;
	width: 42px; height: 42px;
	margin-top: -21px;
	padding: 0;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid var(--line);
	border-radius: 50%;
	box-shadow: var(--shadow);
	color: var(--ink);
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}
.gallery-nav:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.gallery-nav--prev { left: 12px; }
.gallery-nav--next { right: 12px; }
.gallery-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: none) { .gallery-nav { display: none; } } /* touch: swipe instead */
.woocommerce div.product .woocommerce-product-gallery__trigger {
	top: 14px; right: 14px;
	width: 40px; height: 40px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 50%;
	box-shadow: var(--shadow);
}
.woocommerce div.product .onsale { top: 18px; left: 18px; z-index: 3; }

/* Summary ---------------------------------------------------------------- */

.woocommerce div.product div.summary { float: none !important; width: auto !important; clear: none !important; margin: 0; }
.woocommerce div.product .product_title { margin: 0 0 12px; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.12; }

.single-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 0.9rem; color: var(--muted); }
.single-brand a { display: inline-flex; font-weight: 800; color: var(--ink); }
.single-brand a:hover { color: var(--accent); }
.single-brand .brand-logo { --brand-fill: 1; width: 120px; height: 36px; }
.single-brand .brand-logo img { mix-blend-mode: multiply; object-fit: contain; width: calc(100% * var(--bw)); height: calc(100% * var(--s)); }

.single-rating { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: 0.9rem; }
.single-rating .stars { font-size: 1.05rem; }
.single-rating__link { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.single-rating__link:hover { color: var(--accent); }

.woocommerce div.product p.price,
.woocommerce div.product span.price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin: 0 0 18px;
	font-size: clamp(1.9rem, 3.4vw, 2.5rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	color: var(--ink);
}
.woocommerce div.product p.price ins { order: 1; text-decoration: none; background: none; color: var(--accent); }
.woocommerce div.product p.price del { order: 2; font-size: 1.1rem; font-weight: 500; color: var(--muted); opacity: 1; }
.woocommerce-product-details__short-description { margin: 0 0 22px; color: #3b3b44; }
.woocommerce-product-details__short-description p:last-child { margin-bottom: 0; }

/* Urgency: countdown + stock bar */
.urgency { margin: 0 0 22px; padding: 18px 20px; background: var(--mist); border-radius: var(--radius); }
.urgency__title { margin: 0 0 10px; font-weight: 800; }
.urgency__low { margin: 0; font-weight: 700; color: var(--accent-dark); }
.stockbar { margin-bottom: 14px; }
.stockbar__labels { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 0.84rem; color: var(--muted); }
.stockbar__track { height: 10px; overflow: hidden; background: #dcdce2; border-radius: 99px; }
.stockbar__fill {
	display: block;
	width: var(--pct);
	height: 100%;
	background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, #ff5a5a 10px 20px);
	background-size: 28px 28px;
	border-radius: 99px;
	animation: stripes 1.2s linear infinite;
}
@keyframes stripes { to { background-position: 28px 0; } }
.urgency .countdown { max-width: 340px; }
.urgency .countdown b { font-size: 1.4rem; }

/* Buy row ---------------------------------------------------------------- */

.woocommerce div.product form.cart { display: flex; flex-wrap: wrap; align-items: stretch; gap: 14px; margin: 0 0 22px; }
.woocommerce div.product form.cart .variations { width: 100%; }
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; gap: 14px; width: 100%; }
.woocommerce div.product form.cart .woocommerce-variation { width: 100%; margin: 0; }
.woocommerce div.product form.cart .woocommerce-variation-price { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.woocommerce div.product form.cart .woocommerce-variation-availability p { margin: 0 0 10px; font-weight: 700; }

.woocommerce .quantity { display: inline-flex; align-items: stretch; border: 2px solid var(--line); border-radius: 999px; background: #fff; overflow: hidden; }
.woocommerce .quantity:focus-within { border-color: var(--ink); }
.woocommerce .quantity .qty { width: 52px; padding: 0; border: 0; text-align: center; font-weight: 800; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.woocommerce .quantity .qty::-webkit-outer-spin-button, .woocommerce .quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.woocommerce .quantity .qty:focus { outline: 0; }
.qty-btn { display: grid; place-items: center; width: 44px; padding: 0; border: 0; background: transparent; font-size: 1.3rem; line-height: 1; transition: background 0.2s, color 0.2s; }
.qty-btn:hover { background: var(--ink); color: #fff; }

.woocommerce div.product .single_add_to_cart_button {
	flex: 1;
	min-width: 190px;
	min-height: 52px;
	padding: 16px 32px;
	font-size: 1rem;
	background: var(--accent);
	box-shadow: 0 12px 28px rgba(245, 5, 5, 0.3);
}
.woocommerce div.product .single_add_to_cart_button:hover { background: var(--accent-dark); }
.woocommerce div.product .single_add_to_cart_button.disabled, .woocommerce div.product .single_add_to_cart_button:disabled { opacity: 0.45; box-shadow: none; transform: none; cursor: not-allowed; }

/* Variation swatches (built by product.js) */
.woocommerce div.product form.cart table.variations { margin: 0 0 6px; border: 0; }
.woocommerce div.product form.cart table.variations tr { display: block; margin-bottom: 18px; }
.woocommerce div.product form.cart table.variations th,
.woocommerce div.product form.cart table.variations td { display: block; padding: 0; border: 0; background: none; }
.woocommerce div.product form.cart table.variations th.label { margin-bottom: 8px; }
.woocommerce div.product form.cart table.variations th,
.woocommerce div.product form.cart table.variations td { text-align: left; }
.woocommerce div.product form.cart table.variations label { font-weight: 800; }
.woocommerce div.product form.cart .reset_variations { display: inline-block; margin-top: 8px; font-size: 0.85rem; color: var(--muted); text-decoration: underline; }
select.is-swatched { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
	min-width: 48px;
	height: 44px;
	padding: 0 18px;
	font-weight: 700;
	background: #fff;
	border: 2px solid var(--line);
	border-radius: 12px;
	transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.swatch:hover:not(:disabled) { border-color: var(--ink); }
.swatch[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.swatch:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.swatch--color { width: 44px; min-width: 0; padding: 0; border-radius: 50%; background: var(--sw); position: relative; }
.swatch--color[aria-pressed="true"] { background: var(--sw); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); border-color: transparent; }
.swatch--color.is-light { border-color: #cfcfd6; }

/* Perks, info, share */

.info { display: grid; gap: 8px; margin: 0 0 20px; font-size: 0.92rem; }
.info > div { display: flex; gap: 10px; }
.info dt { min-width: 96px; margin: 0; color: var(--muted); }
.info dd { margin: 0; font-weight: 600; }
.info a:hover { color: var(--accent); }
.info__stock.is-in { color: #0e8a3f; }
.info__stock.is-out { color: var(--accent-dark); }
.info__stock.is-back { color: #b36b00; }

.share { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.share__label { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.share ul { display: flex; gap: 8px; }
.share a, .share button {
	display: grid; place-items: center;
	width: 40px; height: 40px; padding: 0;
	border: 1px solid var(--line); border-radius: 50%;
	background: #fff; color: var(--ink);
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.25s var(--ease);
}
.share a:hover, .share button:hover { background: var(--ink); border-color: var(--ink); color: #fff; transform: translateY(-3px); }
.share button.is-done { background: #0e8a3f; border-color: #0e8a3f; color: #fff; }

/* Tabs ------------------------------------------------------------------- */

.woocommerce div.product .woocommerce-tabs { margin-top: 8px; }
.woocommerce div.product .woocommerce-tabs ul.tabs { display: flex; flex-wrap: wrap; gap: 4px 30px; margin: 0 0 28px; padding: 0; border-bottom: 1px solid var(--line); overflow: visible; }
.woocommerce div.product .woocommerce-tabs ul.tabs::before, .woocommerce div.product .woocommerce-tabs ul.tabs::after { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li { margin: 0; padding: 0; border: 0; background: none; border-radius: 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li::before, .woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a { display: block; padding: 12px 0 16px; font-weight: 800; color: var(--muted); }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: var(--ink); box-shadow: 0 3px 0 var(--accent); }
@media (max-width: 760px) {
	/* Five tabs do not fit on a phone: one row, swipe sideways. */
	.woocommerce div.product .woocommerce-tabs ul.tabs { flex-wrap: nowrap; gap: 0 24px; overflow-x: auto; scrollbar-width: none; }
	.woocommerce div.product .woocommerce-tabs ul.tabs::-webkit-scrollbar { display: none; }
	.woocommerce div.product .woocommerce-tabs ul.tabs li { flex: none; }
	.woocommerce div.product .woocommerce-tabs ul.tabs li a { white-space: nowrap; }
}
.woocommerce div.product .woocommerce-Tabs-panel { max-width: 920px; }
.woocommerce div.product .woocommerce-Tabs-panel > h2:first-child { font-size: 1.4rem; }
.woocommerce div.product .woocommerce-Tabs-panel img { height: auto; border-radius: var(--radius-sm); }
.woocommerce table.shop_attributes { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); border-collapse: separate; overflow: hidden; }
.woocommerce table.shop_attributes th { width: 30%; padding: 12px 16px; background: var(--mist); font-weight: 700; }
.woocommerce table.shop_attributes td { padding: 12px 16px; font-style: normal; }
.woocommerce table.shop_attributes td p { margin: 0; padding: 0; }

/* Key specs under the short description */
.specs { display: grid; gap: 7px; margin: 0 0 20px; padding: 14px 16px; list-style: none; background: var(--mist); border-radius: var(--radius-sm); font-size: 0.9rem; }
.specs li { display: flex; justify-content: space-between; gap: 16px; }
.specs span { color: var(--muted); }
.specs b { text-align: right; font-weight: 700; }

/* What's in the box */
.inbox { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: box; }
.inbox li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 600; counter-increment: box; }
.inbox li::before { content: counter(box, decimal-leading-zero); flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 0.78rem; font-weight: 800; }

/* FAQ, and any <details> written into a description */
.woocommerce-Tabs-panel details { margin: 0 0 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.woocommerce-Tabs-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; font-weight: 700; cursor: pointer; list-style: none; }
.woocommerce-Tabs-panel summary::-webkit-details-marker { display: none; }
.woocommerce-Tabs-panel summary::after { content: "+"; flex: none; font-size: 1.4rem; line-height: 1; color: var(--accent); }
.woocommerce-Tabs-panel details[open] > summary::after { content: "\2013"; }
.woocommerce-Tabs-panel details > :not(summary) { margin: 0; padding: 0 20px 18px; color: var(--muted); }

/* Description text */
.woocommerce-Tabs-panel--description p { margin: 0 0 1em; line-height: 1.75; }
.woocommerce-Tabs-panel--description h2,
.woocommerce-Tabs-panel--description h3,
.woocommerce-Tabs-panel--description h4 { margin: 1.8em 0 0.6em; font-size: 1.2rem; font-weight: 800; line-height: 1.3; }
.woocommerce-Tabs-panel--description ul,
.woocommerce-Tabs-panel--description ol { margin: 0 0 1.2em; padding-left: 1.3em; list-style: disc; }
.woocommerce-Tabs-panel--description ol { list-style: decimal; }
.woocommerce-Tabs-panel--description li { margin: 0 0 0.5em; line-height: 1.65; }
.woocommerce-Tabs-panel--description table { width: 100%; margin: 0 0 1.4em; border-collapse: collapse; }
.woocommerce-Tabs-panel--description td,
.woocommerce-Tabs-panel--description th { padding: 10px 14px; border: 1px solid var(--line); text-align: left; }

#reviews .comment-reply-title { font-size: 1.2rem; font-weight: 800; }
#review_form #respond .comment-form-rating label { font-weight: 700; }
.woocommerce p.stars a { color: var(--star); }
#reviews ol.commentlist { padding: 0; }
#reviews ol.commentlist li .comment_container { display: flex; gap: 16px; }
#reviews ol.commentlist li img.avatar { position: static; width: 48px; height: 48px; border: 0; padding: 0; border-radius: 50%; }
#reviews ol.commentlist li .comment-text { flex: 1; margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* Related and upsell */
.woocommerce div.product .related > h2,
.woocommerce div.product .upsells > h2 { position: relative; margin-bottom: 24px; padding-bottom: 12px; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; }
.woocommerce div.product .related > h2::after,
.woocommerce div.product .upsells > h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 4px; background: var(--accent); border-radius: 4px; }

/* Sticky buy bar (phones) ------------------------------------------------ */

.buybar { display: none; }
@media (max-width: 860px) {
	.woocommerce div.product { grid-template-columns: 1fr; gap: 28px; }
	.woocommerce div.product div.images { position: relative !important; }
	.buybar {
		position: fixed;
		left: 0; right: 0; bottom: 0;
		z-index: 58;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 14px;
		padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
		background: rgba(255, 255, 255, 0.96);
		-webkit-backdrop-filter: blur(12px);
		backdrop-filter: blur(12px);
		border-top: 1px solid var(--line);
		box-shadow: 0 -10px 30px rgba(11, 11, 13, 0.1);
		transform: translateY(110%);
		transition: transform 0.4s var(--ease);
	}
	.buybar.is-visible { transform: none; }
	.buybar__info { display: grid; min-width: 0; line-height: 1.25; }
	.buybar__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; font-weight: 700; }
	.buybar__price { font-weight: 800; font-size: 1.05rem; }
	.buybar__price del { display: none; }
	.buybar__price ins { text-decoration: none; color: var(--accent); }
	.buybar .btn { flex: none; padding: 14px 22px; }
	.to-top { bottom: 84px; }
	.woocommerce div.product .flex-control-thumbs { grid-template-columns: repeat(4, 1fr); }
}

/* Inline "choose your options" note, replaces the browser pop-up */
.ace-vnotice {
	margin: 0 0 14px;
	padding: 12px 14px;
	border: 1px solid color-mix(in srgb, var(--accent) 45%, #fff);
	border-left-width: 4px;
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--accent) 6%, #fff);
	font-size: 0.95rem;
	font-weight: 600;
	animation: ace-vnotice-in 0.25s ease-out;
}
.woocommerce div.product form.cart table.variations tr.is-missing td { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
@keyframes ace-vnotice-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ace-vnotice { animation: none; } }

/* Gallery: before the carousel plugin (vargal) has built its slider, the photos
   are still a plain list. Show only the first one, so they never appear stacked
   under each other (and the page does not jump when the carousel starts). The
   direct-child selector stops matching once the plugin wraps them in its viewport. */
.vargal-product-gallery__wrapper > .vargal-woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:nth-child(n + 2) { display: none; }
