/**
 * Single product — shared components.
 * Loaded on every single-product request, before the active layout's own
 * (much smaller) stylesheet. Anything used by more than one layout, or by
 * WooCommerce's own hook output regardless of layout, belongs here rather
 * than being duplicated five times.
 */

/* ---- Page-level tabs (Description/Reviews/etc.) — every layout uses these. */
.woocommerce-tabs {
	max-width: var(--lf-container);
	margin: clamp(2rem, 5vw, 3.5rem) auto 0;
	padding-inline: var(--lf-gutter);
}

.woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	list-style: none;
	padding: 0;
	border-bottom: 1px solid var(--lf-border);
	margin-bottom: 1.5rem;
}

.woocommerce-tabs ul.tabs li a {
	display: inline-block;
	padding-bottom: 0.75rem;
	font-weight: 600;
	color: var(--lf-muted);
}

.woocommerce-tabs ul.tabs li.active a {
	color: var(--lf-primary);
	border-bottom: 2px solid var(--lf-primary);
}

/* ---- Related / upsell product grids. */
.related.products,
.upsells.products {
	max-width: var(--lf-container);
	margin: clamp(2rem, 5vw, 3.5rem) auto 0;
	padding-inline: var(--lf-gutter);
}

.related.products > h2,
.upsells.products > h2 {
	margin-bottom: 1.5rem;
	font-size: var(--lf-fs-h3);
}

/* Custom layouts nest tabs/related inside their own already-padded .lf-sp
   wrapper (rather than as siblings of it, like the default layout) — drop
   the redundant max-width/padding here so spacing doesn't double up. */
.lf-sp .woocommerce-tabs,
.lf-sp .related.products,
.lf-sp .upsells.products,
.lf-sp .lf-feature-icons,
.lf-sp .lf-faq,
.lf-sp .lf-mini-reviews,
.lf-sp .lf-sp__ratings-row,
.lf-sp .lf-sp__crafted-row {
	max-width: none;
	padding-inline: 0;
	margin-inline: 0;
}

/* ---- Shared page shell used by every custom layout's outer wrapper. */
.lf-sp {
	max-width: var(--lf-container);
	margin-inline: auto;
	padding: var(--lf-gutter) var(--lf-gutter) 0;
}

.lf-sp-grid {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: clamp(1.5rem, 4vw, 3rem);
}

@media (max-width: 900px) {
	.lf-sp-grid {
		grid-template-columns: 1fr;
	}
}

/* ---- Gallery (bottom-thumbs or left-rail-thumbs). */
.lf-gallery--bottom {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.lf-gallery--left {
	display: grid;
	grid-template-columns: 88px 1fr;
	gap: 0.75rem;
}

.lf-gallery--left .lf-gallery-thumbs {
	order: -1;
	flex-direction: column;
}

.lf-gallery-main {
	position: relative;
	border-radius: var(--lf-radius);
	overflow: hidden;
	background: var(--lf-card-background);
}

.lf-gallery-main img {
	width: 100%;
	height: auto;
	display: block;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.lf-gallery-badge {
	position: absolute;
	top: 1rem;
	inset-inline-start: 1rem;
	background: var(--lf-primary);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	padding: 0.35rem 0.75rem;
	border-radius: var(--lf-radius-sm);
	z-index: 2;
}

.lf-gallery-thumbs {
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.lf-gallery--left .lf-gallery-thumbs {
	flex-wrap: nowrap;
	overflow-y: auto;
	max-height: 480px;
}

.lf-gallery-thumb {
	padding: 0;
	border: 2px solid transparent;
	border-radius: var(--lf-radius-sm);
	overflow: hidden;
	background: none;
	cursor: pointer;
	line-height: 0;
	flex: 0 0 auto;
	width: 72px;
}

.lf-gallery-thumb img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}

.lf-gallery-thumb.is-active,
.lf-gallery-thumb:hover {
	border-color: var(--lf-primary);
}

@media (max-width: 640px) {
	.lf-gallery--left {
		grid-template-columns: 1fr;
	}
	.lf-gallery--left .lf-gallery-thumbs {
		order: 0;
		flex-direction: row;
		max-height: none;
	}
}

/* ---- Generic pill badge (sale flag, "Organic Certified", etc.). */
.lf-badge {
	display: inline-block;
	background: var(--lf-accent);
	color: var(--lf-primary-dark, var(--lf-primary));
	font-size: 0.75rem;
	font-weight: 700;
	padding: 0.3rem 0.8rem;
	border-radius: var(--lf-radius-pill);
	margin-bottom: 0.75rem;
}

/* ---- Star rating + review count, independent of WooCommerce's own markup
   so custom layouts can place it precisely. */
.lf-stars {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	color: #f5a623;
	font-size: 0.9rem;
}

.lf-stars .lf-stars__value {
	color: var(--lf-text);
	font-weight: 700;
}

.lf-review-count {
	color: var(--lf-muted);
	font-size: 0.85rem;
}

/* ---- Price row with savings badge. */
.lf-price-row {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 0.75rem;
}

.lf-price-row .price {
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--lf-text);
}

.lf-price-row .price del {
	color: var(--lf-muted);
	font-weight: 400;
	font-size: 1.1rem;
	margin-inline-end: 0.4rem;
}

.lf-savings {
	background: #e5f6ec;
	color: #1a7f4b;
	font-size: 0.8rem;
	font-weight: 700;
	padding: 0.25rem 0.6rem;
	border-radius: var(--lf-radius-sm);
}

/* ---- Color swatches. */
.lf-swatches {
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
	margin-bottom: 0.5rem;
}

.lf-swatch {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid var(--lf-border);
	cursor: pointer;
	padding: 0;
}

.lf-swatch.is-active {
	border-color: var(--lf-text);
	box-shadow: 0 0 0 2px var(--lf-card-background), 0 0 0 4px var(--lf-text);
}

/* ---- Size / strap pill selectors. */
.lf-size-pills {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-bottom: 0.5rem;
}

.lf-size-pill {
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.9rem;
	border: 1px solid var(--lf-border);
	border-radius: var(--lf-radius-sm);
	background: var(--lf-card-background);
	font-weight: 600;
	cursor: pointer;
}

.lf-size-pill.is-active {
	border-color: var(--lf-text);
	background: var(--lf-text);
	color: #fff;
}

.lf-size-guide-link {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: underline;
	color: var(--lf-muted);
	margin-bottom: 0.75rem;
}

.lf-size-guide-link:hover {
	color: var(--lf-primary);
}

/* ---- Buttons shared by every layout's add-to-cart / wishlist row. */
.lf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 48px;
	padding: 0 1.75rem;
	border-radius: var(--lf-radius-pill);
	font-weight: 700;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
}

.lf-btn--primary {
	background: var(--lf-primary);
	color: #fff;
}

.lf-btn--primary:hover {
	background: var(--lf-primary-dark, var(--lf-primary));
	color: #fff;
}

.lf-btn--dark {
	background: var(--lf-secondary);
	color: #fff;
}

.lf-btn--outline {
	background: transparent;
	border-color: var(--lf-text);
	color: var(--lf-text);
}

.lf-icon-btn {
	width: 48px;
	height: 48px;
	min-height: 48px;
	padding: 0;
	border-radius: var(--lf-radius-sm);
	border: 1px solid var(--lf-border);
	background: var(--lf-card-background);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.lf-icon-btn[aria-pressed="true"] {
	border-color: var(--lf-primary);
	color: var(--lf-primary);
}

/* ---- Quantity stepper (shared class hooked up by assets/js/product.js). */
.lf-qty-stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--lf-border);
	border-radius: var(--lf-radius-sm);
	overflow: hidden;
}

.lf-qty-stepper button {
	width: 44px;
	height: 48px;
	border: none;
	background: var(--lf-background);
	font-size: 1.1rem;
	cursor: pointer;
}

.lf-qty-stepper input.qty {
	width: 48px;
	height: 48px;
	border: none;
	border-inline: 1px solid var(--lf-border);
	text-align: center;
	font-weight: 700;
}

/* ---- "N people are viewing this" live-social-proof line. */
.lf-viewers {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	color: var(--lf-muted);
	margin-bottom: 1rem;
}

.lf-viewers strong {
	color: var(--lf-text);
}

/* ---- Feature-icon tiles ("Why this product" / spec strip). */
.lf-feature-icons {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1.5rem;
	max-width: var(--lf-container);
	margin: clamp(2rem, 5vw, 3rem) auto;
	padding-inline: var(--lf-gutter);
	text-align: center;
	list-style: none;
}

.lf-feature-icons__icon {
	width: 44px;
	height: 44px;
	margin: 0 auto 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--lf-accent);
	color: var(--lf-primary-dark, var(--lf-primary));
}

.lf-feature-icons h3 {
	font-size: 1rem;
	margin-bottom: 0.25rem;
}

.lf-feature-icons p {
	color: var(--lf-muted);
	font-size: 0.85rem;
	margin: 0;
}

/* ---- FAQ accordion. */
.lf-faq {
	max-width: var(--lf-container);
	margin: 0 auto clamp(2rem, 5vw, 3rem);
	padding-inline: var(--lf-gutter);
}

.lf-faq-item {
	border-bottom: 1px solid var(--lf-border);
}

.lf-faq-question {
	width: 100%;
	text-align: start;
	background: none;
	border: none;
	padding: 1rem 0;
	font-weight: 700;
	font-size: 1rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	color: var(--lf-text);
}

.lf-faq-question .lf-faq-icon {
	transition: transform var(--lf-transition);
}

.lf-faq-item.is-open .lf-faq-question .lf-faq-icon {
	transform: rotate(45deg);
}

.lf-faq-answer {
	display: none;
	padding: 0 0 1rem;
	color: var(--lf-muted);
}

.lf-faq-item.is-open .lf-faq-answer {
	display: block;
}

/* ---- Rating bars (Comfort/Durability/Fit style). */
.lf-rating-bars {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem 1.5rem;
}

.lf-rating-bar__label {
	display: flex;
	justify-content: space-between;
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.lf-rating-bar__track {
	height: 6px;
	border-radius: var(--lf-radius-pill);
	background: var(--lf-border);
	overflow: hidden;
}

.lf-rating-bar__fill {
	height: 100%;
	background: var(--lf-primary);
	border-radius: var(--lf-radius-pill);
}

/* ---- Lifestyle image + pull-quote panel. */
.lf-quote-panel {
	position: relative;
	border-radius: var(--lf-radius);
	overflow: hidden;
	min-height: 260px;
	display: flex;
	align-items: flex-end;
	background-size: cover;
	background-position: center;
}

.lf-quote-panel::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.65) 100%);
}

.lf-quote-panel blockquote {
	position: relative;
	z-index: 1;
	color: #fff;
	padding: 1.75rem;
	font-size: 1.1rem;
	font-style: italic;
	margin: 0;
}

/* ---- Small customer review mini-cards. */
.lf-mini-reviews {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
	max-width: var(--lf-container);
	margin: 0 auto clamp(2rem, 5vw, 3rem);
	padding-inline: var(--lf-gutter);
}

.lf-mini-review {
	border: 1px solid var(--lf-border);
	border-radius: var(--lf-radius-sm);
	padding: 1rem;
	background: var(--lf-card-background);
}

.lf-mini-review__author {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.5rem;
	font-weight: 700;
	font-size: 0.85rem;
}

.lf-mini-review__avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
}
