/*
 * Single product page - supplemental styles for pieces the compiled
 * Tailwind build (dist/style.css) doesn't cover: the gallery/placeholder,
 * meta pills, stock indicator, and the native WooCommerce reviews list +
 * comment form (comments API markup - restyled here rather than rebuilt,
 * so review submission keeps working exactly as WooCommerce expects).
 * Depends on shop.css (.lm-card/.lm-badge/.lm-wish/.lm-stars) and cart.css
 * (.lm-qty-btn/.lm-qty-input), which this page also enqueues.
 */

.lm-gallery {
	position: relative;
	overflow: hidden;
	border-radius: 1.5rem;
	border: 1px solid color-mix(in oklch, var(--border) 60%, transparent);
	background: var(--card);
}
.lm-gallery img {
	aspect-ratio: 1 / 1;
	width: 100%;
	object-fit: cover;
	display: block;
}
.lm-gallery-placeholder {
	aspect-ratio: 1 / 1;
	width: 100%;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, color-mix(in oklch, var(--primary) 15%, transparent), var(--secondary), var(--card));
	color: color-mix(in oklch, var(--muted-foreground) 60%, transparent);
}

.lm-gallery-thumbs {
	margin-top: 0.75rem;
	display: flex;
	gap: 0.625rem;
}
.lm-gallery-thumb {
	width: 4.5rem;
	height: 4.5rem;
	flex-shrink: 0;
	border-radius: 0.75rem;
	overflow: hidden;
	border: 1px solid var(--border);
	opacity: 0.65;
	transition: opacity 0.2s, border-color 0.2s;
	cursor: pointer;
	padding: 0;
	background: none;
}
.lm-gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.lm-gallery-thumb.is-active,
.lm-gallery-thumb:hover {
	opacity: 1;
	border-color: var(--primary);
}

.lm-meta-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.lm-meta-pill {
	display: inline-flex;
	align-items: center;
	border-radius: 9999px;
	padding: 0.35rem 0.875rem;
	font-size: 0.62rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	background: color-mix(in oklch, var(--primary) 10%, transparent);
	color: var(--primary);
	transition: background-color 0.2s;
}
.lm-meta-pill:hover {
	background: color-mix(in oklch, var(--primary) 18%, transparent);
}

.lm-stock {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.75rem;
}
.lm-stock-dot {
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 9999px;
	background: currentColor;
	flex-shrink: 0;
}
.lm-stock--in {
	color: var(--success);
}
.lm-stock--out {
	color: var(--sale);
}

.lm-trust-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.75rem;
}
.lm-trust-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.65rem;
	line-height: 1.3;
	color: var(--muted-foreground);
}
.lm-trust-item i {
	color: var(--primary);
	font-size: 1rem;
	flex-shrink: 0;
}

/* ---------- WooCommerce reviews (comments API) ---------- */

.woocommerce-Reviews-title {
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 1.5rem;
	color: var(--foreground);
}
.woocommerce-Reviews-title span {
	font-style: normal;
}

.commentlist {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}
.commentlist .comment_container {
	display: flex;
	gap: 1rem;
	border-radius: 1rem;
	border: 1px solid color-mix(in oklch, var(--border) 60%, transparent);
	background: color-mix(in oklch, var(--card) 55%, transparent);
	padding: 1.25rem;
}
.commentlist img.avatar {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 9999px;
	flex-shrink: 0;
}
.commentlist .comment-text {
	flex: 1 1 auto;
	min-width: 0;
}
.commentlist .star-rating {
	margin-bottom: 0.4rem;
}
.commentlist .woocommerce-review__author {
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--foreground);
}
.commentlist .woocommerce-review__dash {
	color: var(--muted-foreground);
	margin: 0 0.25rem;
}
.commentlist .woocommerce-review__published-date {
	font-size: 0.7rem;
	color: var(--muted-foreground);
}
.commentlist .description p {
	margin-top: 0.5rem;
	font-size: 0.82rem;
	line-height: 1.6;
	color: var(--muted-foreground);
}

.woocommerce-noreviews {
	margin-top: 1rem;
	font-size: 0.85rem;
	color: var(--muted-foreground);
}

#review_form_wrapper {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid color-mix(in oklch, var(--border) 60%, transparent);
}
.comment-reply-title {
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 1.25rem;
	color: var(--foreground);
}
.comment-form-rating select {
	max-width: 12rem;
}
/* WooCommerce's single-product.js progressively enhances #rating into a
 * sprite-based "N of 5 stars" widget (p.stars/.star-1..5) styled entirely
 * by woocommerce-general.css, which this theme dequeues site-wide - so
 * it renders as broken plain text. Force the plain, already-styled
 * <select> back into view instead of rebuilding that sprite widget. */
#respond .stars {
	display: none !important;
}
#respond #rating {
	display: block !important;
}
.comment-notes,
.comment-form p.logged-in-as {
	font-size: 0.8rem;
	color: var(--muted-foreground);
}
.required-field-message,
.comment-notes .required {
	color: var(--sale);
}
.lm-review-submit {
	margin-top: 0.5rem;
	display: inline-flex;
	align-items: center;
	border-radius: 9999px;
	background: var(--primary);
	color: var(--primary-foreground);
	border: 0;
	cursor: pointer;
	padding: 0.7rem 1.75rem;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	transition: opacity 0.2s;
}
.lm-review-submit:hover {
	opacity: 0.9;
}

/* WooCommerce core star-rating markup (used by the reviews list) - the
 * default font-icon version relies on woocommerce-general.css, which this
 * theme dequeues site-wide, so it's rebuilt here with a plain unicode
 * star overlay instead of depending on that icon font. */
.star-rating {
	position: relative;
	display: inline-block;
	width: 5.4em;
	font-size: 0.8rem;
	line-height: 1;
	letter-spacing: 0.15em;
	font-style: normal;
}
.star-rating::before {
	content: "\2605\2605\2605\2605\2605";
	display: block;
	color: var(--border);
}
.star-rating span {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	display: block;
}
.star-rating span::before {
	content: "\2605\2605\2605\2605\2605";
	display: block;
	color: var(--primary);
}

/*
 * DM Sans sets wider than the Jost it replaced, so "Aggiungi al carrello"
 * wrapped inside the pill next to the quantity stepper on phones. Give the
 * button its own full-width row there instead of shrinking the label.
 */
@media (max-width: 30rem) {
	.lm-pd-add {
		flex: 1 0 100%;
	}
}

/* ---------- Description card: DESCRIZIONE / CONSIGLI D'USO / INGREDIENTI ---------- */

/*
 * The card used to be one pale block: a 0.75rem wide-tracked label over
 * muted-foreground body copy, which the shop owner found too faint to read.
 * Headings now sit at full ink weight and the body moved off the muted tone
 * onto the foreground ink. "Black" here is the design's warm near-black
 * (--foreground), not #000, which the palette deliberately never uses.
 */
.lm-pdp-heading {
	font-size: 1.05rem;
	/* DM Sans is a variable face (wght 100-1000), so the axis is set
	 * explicitly alongside font-weight: with a variable font the two must
	 * agree, and stating the axis removes any doubt about the weight
	 * actually being applied. */
	font-weight: 800;
	font-variation-settings: "wght" 800;
	line-height: 1.3;
	/* Was 0.12em. Wide tracking on small caps is what made 700 read as
	 * light: the letterforms get separated and the stroke weight stops
	 * registering as a block. */
	letter-spacing: 0.04em;
	text-transform: uppercase;
	/* Shop owner asked twice for plain black here: the design's warm ink
	 * (--foreground, #312319) still read as brown to them. Deliberate
	 * deviation from the palette's no-pure-black rule, scoped to this label. */
	color: #000;
}

.lm-pdp-heading--next {
	margin-top: 2.25rem;
	padding-top: 1.75rem;
	border-top: 1px solid color-mix(in oklch, var(--border) 60%, transparent);
}

.lm-pdp-body {
	margin-top: 0.9rem;
	max-width: 42rem;
	font-size: 0.9375rem;
	line-height: 1.75;
	color: var(--foreground);
}

.lm-pdp-body p + p {
	margin-top: 0.85rem;
}

/* Sub-headings authored inside the description itself (Caratteristiche,
 * Specifiche, Principi attivi). */
.lm-pdp-body h3 {
	margin-top: 1.6rem;
	margin-bottom: 0.15rem;
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 1.3rem;
	line-height: 1.2;
	color: var(--foreground);
}

.lm-pdp-body ul {
	margin-top: 0.6rem;
	padding-left: 1.15rem;
	list-style: disc;
}

.lm-pdp-body li + li {
	margin-top: 0.35rem;
}

.lm-pdp-body strong {
	font-weight: 600;
	color: var(--foreground);
}

.lm-pdp-body em {
	color: var(--muted-foreground);
}

/* ---------- Price block ----------
 *
 * The shop owner asked for the price to "catch the visitor's eye" and sent a
 * reference where the figure sits in its own tinted panel with a discount flag
 * next to it. Rebuilt here in the site's own palette: the panel and the flag
 * reuse --sale, the same token the -N% badge over the gallery already uses, so
 * no new accent colour enters the design.
 *
 * Plain CSS rather than Tailwind utilities, for the usual reason on this site:
 * dist/style.css is compiled off-server and can't be rebuilt from here, so
 * anything it doesn't already ship lives in this file.
 */
.lm-price-box {
	/* --sale itself (oklch L 0.7) is too light to carry text on a pale panel:
	 * it lands around 2.9:1, under the 3:1 large-text floor. Deepening it
	 * toward the warm ink keeps it unmistakably the "deal" colour while
	 * clearing AA, and it is derived from the tokens rather than a new hex,
	 * so it follows --sale if the palette ever moves. */
	--lm-sale-ink: color-mix(in oklch, var(--sale) 70%, var(--foreground));

	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	border-radius: 1.5rem;
	border: 1px solid color-mix(in oklch, var(--border) 70%, transparent);
	background: color-mix(in oklch, var(--secondary) 60%, transparent);
	padding: 1rem 1.25rem;
}

/* Only a discounted product gets the warm sale panel. At full price it stays
 * on the neutral panel, so the tint reads as a real signal and not decoration
 * that is always on. */
.lm-price-box.is-sale {
	border-color: color-mix(in oklch, var(--sale) 32%, transparent);
	background: color-mix(in oklch, var(--sale) 9%, var(--card));
}

.lm-price-main {
	min-width: 0;
}

.lm-price-figures {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.65rem;
}

.lm-price-now {
	font-family: var(--font-display);
	/* DM Sans is a variable face, so the axis is stated next to font-weight -
	 * same reason as .lm-pdp-heading above. */
	font-weight: 700;
	font-variation-settings: "wght" 700;
	font-size: clamp(1.125rem, 0.8rem + 1.1vw, 1.5rem);
	line-height: 1.05;
	letter-spacing: -0.015em;
	color: var(--foreground);
}

.lm-price-box.is-sale .lm-price-now {
	color: var(--lm-sale-ink);
}

.lm-price-was {
	font-size: 1rem;
	line-height: 1.2;
	color: var(--muted-foreground);
	text-decoration: line-through;
}

.lm-price-note {
	margin-top: 0.4rem;
	font-size: 0.8rem;
	line-height: 1.4;
	color: var(--foreground);
}

.lm-price-note strong {
	font-weight: 700;
	font-variation-settings: "wght" 700;
	color: var(--lm-sale-ink);
}

.lm-price-flag {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	border-radius: 9999px;
	background: var(--lm-sale-ink);
	color: var(--sale-foreground);
	padding: 0.5rem 1.05rem;
	font-size: 0.85rem;
	font-weight: 700;
	font-variation-settings: "wght" 700;
	letter-spacing: 0.02em;
	line-height: 1;
}

/* Price row: the VAT note sits on the same baseline as the figure. */
.lm-vat-note {
	font-size: 0.75rem;
	line-height: 1.2;
	color: var(--muted-foreground);
}
