/* ==========================================================================
   Tarhee — woocommerce.css
   Product page · Tabs · Reviews · Product cards · Sticky bar
   Everything is styled on top of the default WooCommerce markup.
   ========================================================================== */

:root {
	--icon-cart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E");
	--icon-expand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cpolyline points='9 21 3 21 3 15'/%3E%3Cline x1='21' y1='3' x2='14' y2='10'/%3E%3Cline x1='3' y1='21' x2='10' y2='14'/%3E%3C/svg%3E");
}

/* ---------- Product layout ---------- */
.single-product div.product {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	column-gap: 48px;
	row-gap: 56px;
	align-items: start;
	padding: 36px 0 70px;
}
/* Tabs, upsells, related and anything a plugin adds below the summary: full width. */
.single-product div.product > :not(.tarhee-gallery):not(.summary) { grid-column: 1 / -1; }
/* The title (h1) is the first row, above the gallery: the row gap is reduced to a smaller space under it. */
.single-product div.product > .product_title { margin-bottom: -36px; }

/* ---------- Gallery ---------- */
.tarhee-gallery {
	position: sticky;
	top: calc(var(--header-h) + 28px);
	padding-bottom: 14px;
	container-type: inline-size;
}
.admin-bar .tarhee-gallery { top: calc(var(--header-h) + 60px); }

/* Golden frame: height = 4:3 image + padding. */
.tarhee-gallery__frame {
	position: absolute;
	top: 0;
	inset-inline: 0;
	height: calc((100cqw - 28px) * .75 + 28px);
	border: 2px solid var(--gold);
	border-radius: calc(var(--radius) + 8px);
	transform: none;
	opacity: .4;
	pointer-events: none;
	transition: transform .4s var(--ease), opacity .4s;
}
.tarhee-gallery:hover .tarhee-gallery__frame { transform: none; opacity: .7; }

.tarhee-gallery .woocommerce-product-gallery {
	position: relative;
	z-index: 1;
	margin: 0;
	padding: 14px 14px 0;
}

.tarhee-gallery .flex-viewport,
.tarhee-gallery .woocommerce-product-gallery__image {
	border-radius: var(--radius);
}
.tarhee-gallery .flex-viewport {
	background: linear-gradient(135deg, #fff, #f9fafc);
	box-shadow: var(--shadow-lg);
	border: 1px solid rgba(255, 255, 255, .8);
}
.tarhee-gallery .woocommerce-product-gallery__image {
	aspect-ratio: 4 / 3;
	overflow: hidden;
}
.tarhee-gallery .woocommerce-product-gallery__image a { display: block; height: 100%; }
.tarhee-gallery .woocommerce-product-gallery__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .8s var(--ease);
}
.tarhee-gallery .woocommerce-product-gallery__image:hover img { transform: scale(1.06); }

/* Stability: no layout shift while the WooCommerce gallery / tabs scripts start.
   The gallery is visible at once (WooCommerce hides it with an inline opacity:0 until its script
   runs, which delays the main image), shows only the first image and reserves the thumbnail row
   until the slider is ready, and the slider keeps the same 4:3 box. */
.tarhee-gallery .woocommerce-product-gallery { opacity: 1 !important; }
.tarhee-gallery .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__image:not(:first-child) { display: none; }
.tarhee-gallery .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__wrapper {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border: 1px solid transparent;
	border-radius: var(--radius);
}
.tarhee-gallery .flex-viewport { aspect-ratio: 4 / 3; height: auto !important; }
.tarhee-gallery .woocommerce-product-gallery:not(:has(.flex-control-thumbs)):has(.woocommerce-product-gallery__image + .woocommerce-product-gallery__image)::after {
	content: '';
	display: block;
	height: 114px;
}

/* Badges over the image */
.tarhee-gallery__badges {
	position: absolute;
	top: 22px;
	inset-inline-end: 22px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}
.onsale {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--navy);
	color: #fff;
	font-size: .75rem;
	font-weight: var(--fw-strong);
	line-height: 1.5;
}

/* Lightbox trigger (added by WooCommerce JS) */
.woocommerce-product-gallery__trigger {
	position: absolute;
	top: 26px;
	inset-inline-start: 26px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	box-shadow: var(--shadow-sm);
	font-size: 0;
	transition: transform .25s var(--ease);
}
.woocommerce-product-gallery__trigger:hover { transform: scale(1.08); }
.woocommerce-product-gallery__trigger::before {
	content: '';
	width: 18px;
	height: 18px;
	background: var(--navy);
	-webkit-mask: var(--icon-expand) center / contain no-repeat;
	mask: var(--icon-expand) center / contain no-repeat;
}

/* Thumbnails */
.tarhee-gallery .flex-control-thumbs {
	display: flex;
	gap: 12px;
	margin: 36px 0 0;
	padding: 6px 8px;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}
.tarhee-gallery .flex-control-thumbs::-webkit-scrollbar { display: none; }
.tarhee-gallery .flex-control-thumbs li {
	flex: 0 0 auto;
	width: 88px;
	height: 66px;
	margin: 0;
	transition: transform .3s var(--ease);
}
.tarhee-gallery .flex-control-thumbs li:hover { transform: translateY(-3px); }
.tarhee-gallery .flex-control-thumbs img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 2px solid transparent;
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-sm);
	cursor: pointer;
	transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.tarhee-gallery .flex-control-thumbs img.flex-active {
	border-color: var(--gold);
	box-shadow: 0 8px 20px color-mix(in srgb, var(--gold) 30%, transparent);
}

/* ---------- Summary ---------- */
.single-product .summary { min-width: 0; padding-top: 4px; }

.product_title {
	position: relative;
	margin-bottom: 14px;
	padding-bottom: 16px;
	font-size: 1.7rem;
	font-weight: var(--fw-heading);
	line-height: 1.5;
	letter-spacing: -.01em;
	color: var(--navy);
}
.product_title::after {
	content: '';
	position: absolute;
	bottom: 0;
	inset-inline-start: 0;
	width: 64px;
	height: 3px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--gold), transparent);
}

/* Stars (WooCommerce rating markup, drawn with an SVG mask: no icon font, no glyph/letter-spacing/RTL drift between the grey and gold layers) */
.star-rating {
	--tarhee-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24'%3E%3Cpolygon points='13.5,2 16.59,8.26 23.5,9.27 18.5,14.14 19.68,21.02 13.5,17.77 7.32,21.02 8.5,14.14 3.5,9.27 10.41,8.26'/%3E%3C/svg%3E");
	position: relative;
	display: inline-block;
	width: 5.625em;
	height: 1em;
	font-size: 1rem;
	line-height: 1;
	overflow: hidden;
	vertical-align: -.125em;
	white-space: nowrap;
}
.star-rating::before,
.star-rating span::before {
	content: '';
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	width: 5.625em;
	background: #d9dce5;
	-webkit-mask: var(--tarhee-star) repeat-x 0 0 / 1.125em 1em;
	mask: var(--tarhee-star) repeat-x 0 0 / 1.125em 1em;
}
.star-rating span {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	overflow: hidden;
	text-indent: 100vw;
	white-space: nowrap;
}
.star-rating span::before { background: var(--gold); }

.tarhee-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 24px;
	font-size: .9rem;
}
.tarhee-rating__count { font-size: .82rem; color: var(--muted); }
.tarhee-rating__count:hover { color: var(--gold); }

/* Price card */
.tarhee-price-card {
	position: relative;
	margin-bottom: 20px;
	padding: 24px 22px;
	background: linear-gradient(135deg, #fff 0%, #fdfbf5 100%);
	border: 1.5px solid var(--gold-soft);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.tarhee-price-card::before,
.tarhee-price-card::after {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	border: 0 solid var(--gold);
	pointer-events: none;
}
.tarhee-price-card::before {
	top: 8px;
	inset-inline-start: 8px;
	border-block-start-width: 2px;
	border-inline-start-width: 2px;
	border-start-start-radius: 8px;
}
.tarhee-price-card::after {
	bottom: 8px;
	inset-inline-end: 8px;
	border-block-end-width: 2px;
	border-inline-end-width: 2px;
	border-end-end-radius: 8px;
}

.tarhee-price-card .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin: 0 0 4px;
	font-size: 2.15rem;
	font-weight: var(--fw-heading);
	letter-spacing: -.02em;
	color: var(--navy);
}
.price .woocommerce-Price-currencySymbol {
	margin-inline-start: .3em;
	font-size: .9rem;
	font-weight: var(--fw-medium);
	color: var(--muted);
}
.price ins { background: transparent; text-decoration: none; }
.price del { font-size: 1rem; font-weight: var(--fw-medium); color: #5b6472; text-decoration: line-through; } /* 0.4.0: solid color instead of muted + opacity .8, so the struck price keeps a 4.5:1+ contrast ratio */
.price del .woocommerce-Price-currencySymbol { font-size: .75rem; color: inherit; }
/* Sale price: the discounted price comes first (right side in RTL), the struck old price follows it. */
.tarhee-price-card .price ins { order: 1; }
.tarhee-price-card .price del { order: 2; }
.tarhee-price-card .price .woocommerce-Price-currencySymbol,
.tarhee-sticky__price .woocommerce-Price-currencySymbol { letter-spacing: 0; }
li.product .price del { margin-inline-end: .4em; }
.price .woocommerce-price-suffix { font-size: .78rem; font-weight: var(--fw-medium); color: var(--muted); }

.tarhee-price-note {
	margin-bottom: 20px;
	padding: 18px 22px;
	font-size: .78rem;
	color: var(--muted);
	background: linear-gradient(135deg, #fff 0%, #fdfbf5 100%);
	border: 1.5px solid var(--gold-soft);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.tarhee-price-note p + p { margin-top: 6px; }
.tarhee-price-card > :last-child { margin-bottom: 0; }

/* ---------- Add to cart ---------- */
.summary form.cart { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.summary form.variations_form { display: block; }
.woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; gap: 12px; }

.single_add_to_cart_button,
.tarhee-cta {
	position: relative;
	overflow: hidden;
	display: flex;
	flex: 1 1 100%;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 19px;
	border: 0;
	border-radius: var(--radius);
	background: linear-gradient(135deg, var(--cta) 0%, var(--cta-2) 100%);
	color: #fff;
	font-size: 1.05rem;
	font-weight: var(--fw-strong);
	line-height: 1.5;
	box-shadow: 0 10px 30px rgba(13, 26, 56, .28);
	transition: transform .35s var(--ease), box-shadow .35s var(--ease), opacity .2s;
}
/* Shimmer */
.single_add_to_cart_button::before,
.tarhee-cta::before {
	content: '';
	position: absolute;
	top: 0;
	inset-inline-start: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
	transition: inset-inline-start .7s var(--ease);
	pointer-events: none;
}
.single_add_to_cart_button:hover::before,
.tarhee-cta:hover::before { inset-inline-start: 100%; }
/* Cart icon (drawn with CSS, placed before the text) */
.single_add_to_cart_button::after {
	content: '';
	order: -1;
	width: 1.2em;
	height: 1.2em;
	background: currentColor;
	-webkit-mask: var(--icon-cart) center / contain no-repeat;
	mask: var(--icon-cart) center / contain no-repeat;
}
.single_add_to_cart_button:hover,
.tarhee-cta:hover {
	transform: translateY(-3px);
	box-shadow: 0 16px 40px rgba(13, 26, 56, .4);
}
.single_add_to_cart_button:active,
.tarhee-cta:active { transform: translateY(-1px); }
.single_add_to_cart_button.loading { opacity: .7; pointer-events: none; }
.single_add_to_cart_button:disabled,
.single_add_to_cart_button.disabled {
	opacity: .5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.quantity { flex: 0 0 auto; }
.quantity input.qty { width: 84px; padding: 16px 8px; text-align: center; font-weight: var(--fw-strong); }
.added_to_cart { width: 100%; font-size: .85rem; font-weight: var(--fw-label); color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); }

/* Variations */
table.variations { width: 100%; margin-bottom: 16px; border-collapse: collapse; }
table.variations th,
table.variations td { display: block; padding: 0; text-align: start; }
table.variations tr + tr { display: block; margin-top: 14px; }
table.variations label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: var(--fw-label); color: var(--navy); }
.reset_variations { display: inline-block; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.woocommerce-variation { margin-bottom: 14px; }
.woocommerce-variation-price .price { font-size: 1.4rem; margin: 0 0 6px; }
.woocommerce-variation-availability { font-size: .85rem; color: var(--muted); }

/* Stock */
.stock { margin: 0 0 12px; font-size: .85rem; font-weight: var(--fw-label); color: var(--success); }
.stock.out-of-stock { color: var(--danger); }

/* Wishlist plugins (YITH / TI) hook into the summary themselves */
.summary :is(.yith-wcwl-add-to-wishlist, .tinv-wraper) { margin-top: 12px; }
.summary :is(.yith-wcwl-add-to-wishlist, .tinv-wraper) :is(a, button) {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 15px;
	background: #fff;
	color: var(--navy);
	border: 1.5px solid var(--border);
	border-radius: var(--radius);
	font-size: .92rem;
	font-weight: var(--fw-label);
	transition: all .25s var(--ease);
}
.summary :is(.yith-wcwl-add-to-wishlist, .tinv-wraper) :is(a, button):hover {
	border-color: var(--gold);
	background: var(--gold-soft);
	transform: translateY(-2px);
	box-shadow: var(--shadow-sm);
}

/* ---------- Key facts ---------- */
.tarhee-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 26px 0 0; }
.tarhee-fact {
	position: relative;
	overflow: hidden;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	transition: transform .2s, box-shadow .2s;
}
.tarhee-fact::before {
	content: '';
	position: absolute;
	top: 0;
	inset-inline-start: 0;
	width: 3px;
	height: 100%;
	background: var(--gold);
	transform: scaleY(0);
	transform-origin: top;
	transition: transform .3s var(--ease);
}
.tarhee-fact:hover { transform: translateX(-2px); box-shadow: var(--shadow-sm); }
.tarhee-fact:hover::before { transform: scaleY(1); }
.tarhee-fact dt { margin-bottom: 3px; font-size: .72rem; font-weight: var(--fw-medium); color: var(--muted); }
.tarhee-fact dd { margin: 0; font-size: .9rem; font-weight: var(--fw-label); color: var(--navy); }

/* SKU / categories / tags (hidden by default, enabled in the Customizer) */
.product_meta { display: grid; gap: 4px; margin-top: 22px; font-size: .8rem; color: var(--muted); }
.product_meta a { color: var(--navy); }
.product_meta a:hover { color: var(--gold); }

/* ---------- Tabs ---------- */
.woocommerce-tabs {
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.woocommerce-tabs ul.tabs {
	display: flex;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	border-bottom: 1px solid var(--border);
	background: linear-gradient(180deg, #fafbfd, #fff);
	scrollbar-width: none;
}
.woocommerce-tabs ul.tabs::-webkit-scrollbar { display: none; }
.woocommerce-tabs ul.tabs li { margin: 0; }
.woocommerce-tabs ul.tabs a {
	position: relative;
	display: block;
	padding: 20px 28px;
	font-size: .95rem;
	font-weight: var(--fw-label);
	white-space: nowrap;
	color: var(--muted);
}
.woocommerce-tabs ul.tabs a:hover,
.woocommerce-tabs ul.tabs li.active a { color: var(--navy); }
.woocommerce-tabs ul.tabs li.active a::after {
	content: '';
	position: absolute;
	bottom: 0;
	inset-inline: 14px;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: linear-gradient(90deg, var(--gold), var(--gold-light));
	animation: tarhee-tab-in .3s var(--ease);
}

.woocommerce-Tabs-panel { padding: 32px; animation: tarhee-fade-in .35s var(--ease); }
.woocommerce-Tabs-panel > :first-child { margin-top: 0; }
.woocommerce-Tabs-panel p { margin: 0 0 16px; font-size: .95rem; color: #3a4256; }
.woocommerce-Tabs-panel ul,
.woocommerce-Tabs-panel ol { margin: 0 0 16px; padding-inline-start: 1.3em; font-size: .95rem; color: #3a4256; }
.woocommerce-Tabs-panel li::marker { color: var(--gold); }
.woocommerce-Tabs-panel h2,
.woocommerce-Tabs-panel h3 {
	position: relative;
	margin: 26px 0 12px;
	padding-inline-start: 14px;
	font-size: 1.05rem;
	font-weight: var(--fw-strong);
	line-height: 1.6;
	color: var(--navy);
}
.woocommerce-Tabs-panel h2::before,
.woocommerce-Tabs-panel h3::before {
	content: '';
	position: absolute;
	inset-inline-start: 0;
	top: 50%;
	width: 5px;
	height: 18px;
	border-radius: 3px;
	background: linear-gradient(180deg, var(--gold), var(--gold-light));
	transform: translateY(-50%);
}

/* Specifications */
.tarhee-specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 0; }
.tarhee-spec {
	padding: 16px 18px;
	background: linear-gradient(135deg, #fafbfd, #fff);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	transition: border-color .2s, box-shadow .2s;
}
.tarhee-spec:hover { border-color: var(--gold-soft); box-shadow: var(--shadow-sm); }
.tarhee-spec dt { margin-bottom: 5px; font-size: .74rem; color: var(--muted); }
.tarhee-spec dd { margin: 0; font-size: .92rem; font-weight: var(--fw-strong); color: var(--navy); }

/* ---------- Reviews ---------- */
#reviews .woocommerce-Reviews-title { margin-top: 0; }
#reviews .woocommerce-noreviews { color: var(--muted); }
#reviews ol.commentlist { display: grid; gap: 14px; margin: 0 0 28px; padding: 0; list-style: none; }
#reviews .comment_container {
	display: flex;
	gap: 14px;
	padding: 16px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}
#reviews .comment_container img.avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; }
#reviews .comment-text { flex: 1; min-width: 0; }
#reviews .comment-text .star-rating { margin-bottom: 6px; font-size: .9rem; }
#reviews .comment-text .meta { margin: 0 0 8px; font-size: .8rem; color: var(--muted); }
#reviews .woocommerce-review__author { font-weight: var(--fw-strong); color: var(--navy); }
#reviews .woocommerce-review__dash { display: none; }
#reviews .comment-text .description p { margin: 0; }

#reviews .woocommerce-pagination { margin-top: 20px; }
#reviews .woocommerce-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	min-width: 0;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	list-style: none;
}
#reviews .woocommerce-pagination ul.page-numbers li { margin: 0; border: 0; float: none; }
.tarhee-review-extra { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; font-size: .86rem; color: var(--muted); }
.tarhee-review-extra strong { color: var(--navy); font-weight: var(--fw-strong); }
/* Heading tags chosen in the settings (h4, p, div ...) keep the look of the default h2 / h3 headings. */
.woocommerce-Tabs-panel .tarhee-hd {
	position: relative;
	margin: 26px 0 12px;
	padding-inline-start: 14px;
	font-size: 1.05rem;
	font-weight: var(--fw-strong);
	line-height: 1.6;
	color: var(--navy);
}
.woocommerce-Tabs-panel .tarhee-hd::before {
	content: '';
	position: absolute;
	inset-inline-start: 0;
	top: 50%;
	width: 5px;
	height: 18px;
	border-radius: 3px;
	background: linear-gradient(180deg, var(--gold), var(--gold-light));
	transform: translateY(-50%);
}
#reviews .woocommerce-Reviews-title.tarhee-hd { margin-top: 0; }

#review_form #reply-title { display: block; margin-bottom: 14px; font-size: 1.05rem; font-weight: var(--fw-strong); color: var(--navy); }
#review_form .comment-form-rating label,
#review_form .comment-form-comment label { display: block; margin-bottom: 6px; font-size: .86rem; font-weight: var(--fw-label); color: var(--navy); }
#review_form .required { color: var(--danger); }

/* Star picker (WooCommerce JS replaces the select with p.stars) */
p.stars { margin: 0; line-height: 1; }
p.stars span { display: inline-flex; gap: 4px; }
p.stars a {
	position: relative;
	display: inline-block;
	width: 1.2em;
	height: 1.2em;
	font-size: 1.5rem;
	text-indent: -999em;
	overflow: hidden;
	text-decoration: none;
}
p.stars a::before {
	content: '\2606';
	position: absolute;
	inset: 0;
	text-indent: 0;
	color: var(--gold);
	line-height: 1.2;
}
p.stars:hover a::before { content: '\2605'; }
p.stars a:hover ~ a::before { content: '\2606'; }
p.stars.selected a.active::before { content: '\2605'; }
p.stars.selected a.active ~ a::before { content: '\2606'; }
p.stars.selected a:not(.active)::before { content: '\2605'; }

/* ---------- Related / upsells ---------- */
section.related > h2,
section.related > .tarhee-sec-title,
section.up-sells > h2 {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 24px;
	font-size: 1.3rem;
	font-weight: var(--fw-heading);
	color: var(--navy);
}
section.related > h2::before,
section.related > .tarhee-sec-title::before,
section.up-sells > h2::before {
	content: '';
	width: 6px;
	height: 26px;
	border-radius: 3px;
	background: linear-gradient(180deg, var(--gold), var(--gold-light));
}

/* ---------- Product cards ---------- */
ul.products {
	display: grid;
	grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}
ul.products.columns-1 { --cols: 1; }
ul.products.columns-2 { --cols: 2; }
ul.products.columns-3 { --cols: 3; }
ul.products.columns-4 { --cols: 4; }
ul.products.columns-5 { --cols: 5; }
ul.products.columns-6 { --cols: 6; }

ul.products li.product {
	position: relative;
	overflow: hidden;
	margin: 0;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
ul.products li.product::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: var(--radius);
	box-shadow: inset 0 0 0 0 var(--gold);
	transition: box-shadow .35s;
	pointer-events: none;
}
ul.products li.product:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(13, 26, 56, .14); }
ul.products li.product:hover::after { box-shadow: inset 0 0 0 2px var(--gold); }

.woocommerce-LoopProduct-link { display: block; }
.tarhee-card-media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; contain: paint; }
.tarhee-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s var(--ease);
}
.tarhee-card-media::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 50%, rgba(13, 26, 56, .5));
	opacity: 0;
	transition: opacity .3s;
	pointer-events: none;
}
li.product:hover .tarhee-card-media img { transform: scale(1.08); }
li.product:hover .tarhee-card-media::after { opacity: 1; }
.tarhee-card-media .onsale { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; }

.woocommerce-loop-product__title {
	margin: 0;
	padding: 14px 16px;
	font-size: .86rem;
	font-weight: var(--fw-label);
	line-height: 1.5;
	color: var(--text);
}
li.product .price { display: block; padding: 0 16px 14px; font-size: .85rem; font-weight: var(--fw-strong); color: var(--navy); }

/* ---------- Sticky purchase bar (mobile) ---------- */
.tarhee-sticky {
	position: fixed;
	inset: auto 0 0;
	z-index: 60;
	display: none;
	align-items: center;
	gap: 14px;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	background: rgba(255, 255, 255, .92);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	backdrop-filter: blur(20px) saturate(160%);
	border-top: 1px solid var(--border);
	box-shadow: 0 -8px 28px rgba(13, 26, 56, .1);
}
.tarhee-sticky__price { flex: 0 0 auto; }
.tarhee-sticky__price .lbl { display: block; font-size: .68rem; color: var(--muted); }
.tarhee-sticky__price .val { font-size: 1.05rem; font-weight: var(--fw-heading); color: var(--navy); }
.tarhee-sticky__price .woocommerce-Price-currencySymbol { font-size: .75rem; font-weight: var(--fw-medium); }
.tarhee-sticky__price del { display: block; font-size: .72rem; font-weight: var(--fw-medium); line-height: 1.3; color: #5b6472; text-decoration: line-through; }
.tarhee-sticky__price del .woocommerce-Price-currencySymbol { color: inherit; }
.tarhee-sticky__price ins { background: transparent; text-decoration: none; }
/* On sale: the struck price takes the label's place, so the bar keeps its height and the button its width. */
.tarhee-sticky__price:has(del) .lbl { display: none; }
.tarhee-sticky .tarhee-cta { flex: 1; padding: 13px; font-size: .88rem; box-shadow: 0 6px 18px rgba(13, 26, 56, .2); }

/* ---------- Motion ---------- */
@keyframes tarhee-tab-in {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}
@keyframes tarhee-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.single-product div.product { grid-template-columns: minmax(0, 1fr); row-gap: 40px; padding: 24px 0 40px; }
	/* relative (not static): the tilted frame is positioned against the gallery, and a static gallery let it spill over the whole page width. */
	.tarhee-gallery,
	.admin-bar .tarhee-gallery { position: relative; top: auto; width: min(100%, 640px); justify-self: center; }
	ul.products { --cols: 2 !important; gap: 16px; }
	.tarhee-sticky { display: flex; }
	body.has-sticky-bar { padding-bottom: 84px; }
	.product_title { font-size: 1.4rem; }
	.single-product div.product > .product_title { margin-bottom: -26px; }
	.tarhee-price-card .price { font-size: 1.8rem; }
	.woocommerce-tabs ul.tabs a { padding: 16px 18px; font-size: .86rem; }
	.woocommerce-Tabs-panel { padding: 22px; }
}

/* 0.5.0: mobile only - the gallery frame is a little smaller (92%), so the first screen takes less height.
   The image keeps its 4:3 box (no crop, no stretch) and the frame follows it; `sizes` in single-product.php matches. */
@media (max-width: 674px) {
	.tarhee-gallery,
	.admin-bar .tarhee-gallery { width: min(92%, 640px); }
}

@media (max-width: 560px) {
	ul.products { --cols: 1 !important; }
	.tarhee-specs { grid-template-columns: 1fr; }
	.woocommerce-Tabs-panel { padding: 16px; }
	.woocommerce-tabs ul.tabs a { padding: 14px 14px; }
	.tarhee-price-card { padding: 20px 16px; }
	.tarhee-price-note { padding: 16px; }
	.tarhee-gallery .woocommerce-product-gallery { padding: 10px 10px 0; }
	.tarhee-gallery__badges { top: 16px; inset-inline-end: 16px; }
	.woocommerce-product-gallery__trigger { top: 18px; inset-inline-start: 18px; }
	.quantity input.qty { width: 72px; }
	.product_title { font-size: 1.25rem; }
	.tarhee-price-card .price { font-size: 1.6rem; }
	.tarhee-gallery .flex-control-thumbs li { width: 76px; height: 58px; }
	.tarhee-gallery .woocommerce-product-gallery:not(:has(.flex-control-thumbs)):has(.woocommerce-product-gallery__image + .woocommerce-product-gallery__image)::after { height: 106px; }
}

@media (max-width: 420px) {
	.tarhee-facts { grid-template-columns: 1fr; }
}

/* Tabs: only the first panel before the WooCommerce script picks the active one (no jump). */
.woocommerce-tabs .woocommerce-Tabs-panel:not(:first-of-type) { display: none; }

/* Content inside tabs must never widen the page */
.woocommerce-Tabs-panel { overflow-wrap: anywhere; }
.woocommerce-Tabs-panel :is(img, iframe, video, embed) { max-width: 100%; height: auto; }
.woocommerce-Tabs-panel table { display: block; max-width: 100%; overflow-x: auto; }
.tarhee-sticky__price { min-width: 0; }
.tarhee-sticky .tarhee-cta { min-width: 0; }

/* No hover lift on touch screens (avoids sticky hover states) */
@media (hover: none) {
	ul.products li.product:hover { transform: none; box-shadow: none; }
	li.product:hover .tarhee-card-media img { transform: none; }
	.tarhee-gallery .woocommerce-product-gallery__image:hover img { transform: none; }
}

/* ==========================================================================
   0.3.9: add-to-cart / sticky bar fallbacks for older mobile browsers.
   ========================================================================== */

/* No color-mix(): --cta-2 is invalid, the gradient dropped and the white text sat on white. */
@supports not (color: color-mix(in srgb, red 50%, white)) {
	.single_add_to_cart_button,
	.tarhee-cta { background: var(--cta); }
}

/* No inset / logical properties: pin the sticky bar and the shimmer with physical offsets. */
@supports not (inset-inline-start: 0) {
	.tarhee-sticky { left: 0; right: 0; bottom: 0; }
	html[dir='rtl'] .single_add_to_cart_button::before,
	html[dir='rtl'] .tarhee-cta::before { right: -100%; }
	html:not([dir='rtl']) .single_add_to_cart_button::before,
	html:not([dir='rtl']) .tarhee-cta::before { left: -100%; }
	html[dir='rtl'] .single_add_to_cart_button:hover::before,
	html[dir='rtl'] .tarhee-cta:hover::before { right: 100%; }
	html:not([dir='rtl']) .single_add_to_cart_button:hover::before,
	html:not([dir='rtl']) .tarhee-cta:hover::before { left: 100%; }
}
