/**
 * Single product — sticky ATC + related carousel + PDP above-the-fold (W3-5).
 */

/*
 * PDP-ATF-01 — selling fold: price · stock · variations · ATC before meta/features.
 * Root cause A: Dina outputs .product_meta before .price inside .price-con.
 * Root cause B: .product-page-style-two .price|features use flex:0 0 100% which
 * collapses/overlaps when the summary is a column flex — break that basis.
 */
body.lihome-theme.single-product .summary.entry-summary {
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
}

body.lihome-theme.single-product .summary.entry-summary > * {
	flex: 0 0 auto !important;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
}

body.lihome-theme.single-product .summary .ptitle-con {
	order: 1;
}

body.lihome-theme.single-product .summary .lihome-pdp-badges {
	order: 2;
}

body.lihome-theme.single-product .summary .woocommerce-product-rating {
	order: 3;
}

body.lihome-theme.single-product .summary .price-con {
	order: 4;
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	justify-content: flex-start !important;
	gap: 8px;
	height: auto !important;
}

body.lihome-theme.single-product .summary .price-con > * {
	flex: 0 0 auto !important;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
}

body.lihome-theme.single-product .summary .product-features {
	order: 6;
}

body.lihome-theme.single-product .summary .lihome-bale-product-hint,
body.lihome-theme.single-product .summary .product_extra,
body.lihome-theme.single-product .summary .add_prod_info,
body.lihome-theme.single-product .summary .product-tags {
	order: 7;
}

body.lihome-theme.single-product .summary .price-con > .price {
	order: 1;
	justify-content: flex-start !important;
	padding-block: 2px !important;
}

body.lihome-theme.single-product .summary .price-con > .stock,
body.lihome-theme.single-product .summary .price-con > p.stock {
	order: 2;
}

body.lihome-theme.single-product .summary .price-con > form.cart {
	order: 3;
}

body.lihome-theme.single-product .summary .price-con > .lihome-pdp-trust {
	order: 4;
}

body.lihome-theme.single-product .summary .price-con > .product_meta {
	order: 8;
	margin-top: 4px;
	padding-top: 8px;
	border-top: 1px dashed var(--lihome-border);
	font-size: 0.78rem;
	line-height: 1.5;
	color: var(--lihome-text-muted);
}

body.lihome-theme.single-product .summary .price-con > .product_meta a {
	color: inherit;
}

/* Commerce badges */
.lihome-pdp-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 8px;
}

.lihome-pdp-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.3;
}

.lihome-pdp-badge--sale {
	background: color-mix(in srgb, var(--lihome-accent) 16%, transparent);
	color: var(--lihome-accent);
}

.lihome-pdp-badge--best {
	background: color-mix(in srgb, var(--lihome-primary) 14%, transparent);
	color: var(--lihome-primary);
}

.lihome-pdp-badge--pick {
	background: color-mix(in srgb, var(--lihome-brand) 14%, transparent);
	color: var(--lihome-brand);
}

/* Compact trust strip */
.lihome-pdp-trust {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 4px;
	margin: 0 0 10px;
	padding: 8px 6px;
	list-style: none;
	border: 1px solid var(--lihome-border);
	border-radius: var(--lihome-radius-md, 12px);
	background: color-mix(in srgb, var(--lihome-surface-rail, var(--lihome-surface)) 92%, var(--lihome-brand-soft));
}

.lihome-pdp-trust-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	text-align: center;
	min-width: 0;
}

.lihome-pdp-trust-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--lihome-primary) 10%, transparent);
	color: var(--lihome-primary);
	font-size: 0.78rem;
}

.lihome-pdp-trust-label,
a.lihome-pdp-trust-phone {
	font-size: 0.68rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--lihome-text);
	text-decoration: none;
}

a.lihome-pdp-trust-phone:hover,
a.lihome-pdp-trust-phone:focus-visible {
	color: var(--lihome-brand);
}

@media (max-width: 767px) {
	/* Tighten gallery so summary starts earlier in the first viewport */
	body.lihome-theme.single-product .woocommerce-product-gallery .flex-viewport {
		max-height: min(52vw, 320px);
	}

	body.lihome-theme.single-product .woocommerce-product-gallery .flex-viewport img {
		max-height: min(52vw, 320px);
		width: auto;
		margin-inline: auto;
		object-fit: contain;
	}

	body.lihome-theme.single-product .woocommerce-product-gallery .flex-control-thumbs {
		margin-top: 6px !important;
		gap: 6px;
	}

	body.lihome-theme.single-product .woocommerce-product-gallery .flex-control-thumbs li {
		width: 52px !important;
		margin: 0 !important;
	}

	body.lihome-theme.single-product .summary .ptitle-con {
		margin-bottom: 4px;
	}

	body.lihome-theme.single-product .summary .product_title {
		font-size: 1.05rem;
		line-height: 1.45;
		margin-bottom: 0;
	}

	body.lihome-theme.single-product .summary .price-con > .price {
		font-size: 1.15rem;
		margin: 0;
	}

	body.lihome-theme.single-product .summary .price-con > .stock {
		margin: 0;
		font-size: 0.82rem;
	}

	body.lihome-theme.single-product .summary .product-features {
		margin-top: 8px;
		padding: 8px 10px;
		font-size: 0.8rem;
	}

	body.lihome-theme.single-product .summary .lihome-pdp-trust {
		padding: 5px 2px;
		gap: 2px;
		margin-bottom: 6px;
	}

	body.lihome-theme.single-product .summary .lihome-pdp-trust-ico {
		width: 22px;
		height: 22px;
		font-size: 0.7rem;
	}

	body.lihome-theme.single-product .summary .lihome-pdp-trust-label {
		font-size: 0.6rem;
	}

	body.lihome-theme.single-product .summary .price-con form.cart table.variations {
		margin: 0 !important;
	}

	body.lihome-theme.single-product .summary .price-con form.cart table.variations td,
	body.lihome-theme.single-product .summary .price-con form.cart table.variations th {
		padding: 4px 0 !important;
		line-height: 1.35;
	}

	body.lihome-theme.single-product .summary .price-con form.cart .quantity {
		margin-bottom: 0 !important;
	}

	/* DS-002 — sticky ATC uses Palette A+ tokens (overrides parent green) */
	body.lihome-theme .dina-mobile-sticky-add .single_add_to_cart_button,
	body.lihome-theme .dina-mobile-sticky-add .button,
	body.lihome-theme .dina-mobile-sticky-add .go-to-add {
		background: var(--lihome-primary) !important;
		border-color: var(--lihome-primary-hover) !important;
		color: #fff !important;
		min-height: 44px !important;
		font-size: 0.85rem !important;
		padding: 8px 12px !important;
	}

	body.lihome-theme.single-product .dina-related-product {
		position: relative;
	}

	body.lihome-theme.single-product .dina-related-product .owl-carousel {
		padding-inline: 2px;
	}

	body.lihome-theme.single-product .dina-related-product .owl-stage-outer {
		overflow: hidden;
		max-width: 100%;
	}

	body.lihome-theme.single-product .dina-related-product .owl-item {
		padding-inline: 2px;
	}

	body.lihome-theme.single-product .dina-related-product .mini-product {
		background: var(--lihome-surface);
		border: 1px solid var(--lihome-border);
	}

	body.lihome-theme.single-product .dina-related-product .owl-nav {
		display: flex;
		justify-content: space-between;
		position: absolute;
		inset-inline: 0;
		top: 38%;
		transform: translateY(-50%);
		pointer-events: none;
		z-index: 2;
	}

	body.lihome-theme.single-product .dina-related-product .owl-nav button {
		pointer-events: auto;
		width: 34px;
		height: 34px;
		border-radius: 50%;
		background: var(--lihome-surface) !important;
		box-shadow: var(--lihome-shadow-md);
	}
}

@media (min-width: 768px) {
	.lihome-pdp-trust {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		padding: 10px 12px;
		gap: 8px;
	}

	.lihome-pdp-trust-label,
	a.lihome-pdp-trust-phone {
		font-size: 0.75rem;
	}
}

/*
 * Wave 4 — PDP complements (AOV): "این‌ها کنار هم عالی می‌شن"
 */
.lihome-pdp-complements {
	margin: 20px 0 8px;
	padding: 14px 12px 16px;
	border-radius: var(--lihome-radius-lg, 16px);
	border: 1px solid color-mix(in srgb, var(--lihome-brand) 22%, var(--lihome-border));
	background:
		linear-gradient(
			155deg,
			color-mix(in srgb, var(--lihome-brand-soft) 75%, #fff) 0%,
			var(--lihome-surface) 55%,
			var(--lihome-surface-rail, var(--lihome-surface)) 100%
		);
}

.lihome-pdp-complements-header {
	margin-bottom: 12px;
}

.lihome-pdp-complements-kicker {
	margin: 0 0 4px;
	display: inline-flex;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--lihome-brand);
	background: color-mix(in srgb, var(--lihome-brand) 12%, transparent);
}

.lihome-pdp-complements-title {
	margin: 0 0 4px;
	font-size: 1.05rem;
	line-height: 1.45;
	color: var(--lihome-text);
}

.lihome-pdp-complements-sub {
	margin: 0;
	font-size: 0.8rem;
	line-height: 1.5;
	color: var(--lihome-text-muted);
}

.lihome-pdp-complements-track {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

@media (min-width: 768px) {
	.lihome-pdp-complements {
		padding: 18px 16px 20px;
	}

	.lihome-pdp-complements-track {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 12px;
	}

	.lihome-pdp-complements-title {
		font-size: 1.15rem;
	}
}

.lihome-complement-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: var(--lihome-radius-md, 12px);
	border: 1px solid var(--lihome-border);
	background: var(--lihome-surface);
	overflow: hidden;
	box-shadow: 0 3px 12px rgba(45, 42, 38, 0.05);
}

.lihome-complement-card-media {
	display: block;
	aspect-ratio: 1 / 1;
	background: color-mix(in srgb, var(--lihome-surface-rail, #f5f2ee) 80%, #fff);
	overflow: hidden;
}

.lihome-complement-card-media img,
.lihome-complement-card-media .lihome-rail-card-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.lihome-complement-card-ph {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--lihome-border);
}

.lihome-complement-card-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px 8px 10px;
	flex: 1 1 auto;
}

.lihome-complement-card-title {
	margin: 0;
	font-size: 0.78rem;
	line-height: 1.45;
	font-weight: 600;
}

.lihome-complement-card-title a {
	color: var(--lihome-text);
	text-decoration: none;
}

.lihome-complement-card-price {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--lihome-primary);
}

.lihome-complement-card-actions {
	margin-top: auto;
}

.lihome-complement-card-actions .lihome-loop-add-to-cart,
.lihome-complement-card-actions .button {
	min-height: 36px !important;
	font-size: 0.75rem !important;
}

body.lihome-theme.dina-dark .lihome-pdp-complements {
	background:
		linear-gradient(
			155deg,
			color-mix(in srgb, var(--lihome-brand) 22%, var(--lihome-surface-rail)) 0%,
			var(--lihome-surface) 100%
		);
	border-color: color-mix(in srgb, var(--lihome-brand) 36%, var(--lihome-border));
}

body.lihome-theme.dina-dark .lihome-complement-card {
	background: var(--lihome-surface);
	border-color: var(--lihome-border);
}



/*
 * Wave 4 — Product set / bundle (solution commerce)
 */
.lihome-pdp-set {
	margin: 18px 0 10px;
	padding: 14px 12px 16px;
	border-radius: var(--lihome-radius-lg, 16px);
	border: 1px solid color-mix(in srgb, var(--lihome-primary) 28%, var(--lihome-border));
	background:
		linear-gradient(
			150deg,
			color-mix(in srgb, var(--lihome-primary) 10%, #fff) 0%,
			var(--lihome-surface) 48%,
			color-mix(in srgb, var(--lihome-accent) 6%, var(--lihome-surface)) 100%
		);
	box-shadow: 0 6px 20px rgba(45, 42, 38, 0.06);
}

.lihome-pdp-set-kicker {
	margin: 0 0 4px;
	display: inline-flex;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--lihome-primary);
	background: color-mix(in srgb, var(--lihome-primary) 12%, transparent);
}

.lihome-pdp-set-title {
	margin: 0 0 4px;
	font-size: 1.08rem;
	line-height: 1.45;
	color: var(--lihome-text);
}

.lihome-pdp-set-sub {
	margin: 0 0 12px;
	font-size: 0.8rem;
	line-height: 1.5;
	color: var(--lihome-text-muted);
}

.lihome-pdp-set-list {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lihome-pdp-set-item {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 10px;
	align-items: center;
	padding: 8px;
	border-radius: var(--lihome-radius-md, 12px);
	border: 1px solid var(--lihome-border);
	background: var(--lihome-surface);
}

.lihome-pdp-set-item.is-current {
	border-color: color-mix(in srgb, var(--lihome-brand) 40%, var(--lihome-border));
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--lihome-brand) 18%, transparent);
}

.lihome-pdp-set-media {
	display: block;
	width: 64px;
	height: 64px;
	border-radius: 10px;
	overflow: hidden;
	background: color-mix(in srgb, var(--lihome-surface-rail, #f5f2ee) 80%, #fff);
}

.lihome-pdp-set-media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.lihome-pdp-set-item-title {
	display: block;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.45;
	color: var(--lihome-text);
	text-decoration: none;
}

.lihome-pdp-set-current-tag {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 1px 6px;
	border-radius: 999px;
	font-size: 0.65rem;
	font-weight: 700;
	color: var(--lihome-brand);
	background: color-mix(in srgb, var(--lihome-brand) 12%, transparent);
	vertical-align: middle;
}

.lihome-pdp-set-item-price {
	margin-top: 2px;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--lihome-primary);
}

.lihome-pdp-set-pricing {
	margin-bottom: 12px;
	padding: 10px 12px;
	border-radius: 12px;
	background: color-mix(in srgb, var(--lihome-surface-rail, #f5f2ee) 70%, #fff);
	border: 1px dashed color-mix(in srgb, var(--lihome-primary) 25%, var(--lihome-border));
}

.lihome-pdp-set-pricing-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	font-size: 0.84rem;
	margin-bottom: 6px;
}

.lihome-pdp-set-pricing-row--set {
	font-size: 0.95rem;
	font-weight: 700;
}

.lihome-pdp-set-solo {
	text-decoration: line-through;
	opacity: 0.72;
	font-weight: 600;
}

.lihome-pdp-set-deal {
	color: var(--lihome-accent);
}

.lihome-pdp-set-save {
	margin: 4px 0 0;
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--lihome-brand);
}

.lihome-pdp-set-add {
	width: 100%;
	min-height: 44px;
}

.lihome-pdp-set-status {
	margin: 8px 0 0;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--lihome-text);
}

body.lihome-theme.dina-dark .lihome-pdp-set {
	background:
		linear-gradient(
			150deg,
			color-mix(in srgb, var(--lihome-primary) 22%, var(--lihome-surface-rail)) 0%,
			var(--lihome-surface) 100%
		);
	border-color: color-mix(in srgb, var(--lihome-primary) 36%, var(--lihome-border));
}

body.lihome-theme.dina-dark .lihome-pdp-set-item,
body.lihome-theme.dina-dark .lihome-pdp-set-pricing {
	background: var(--lihome-surface);
	border-color: var(--lihome-border);
}

@media (min-width: 768px) {
	.lihome-pdp-set {
		padding: 18px 16px 20px;
	}

	.lihome-pdp-set-title {
		font-size: 1.2rem;
	}

	.lihome-pdp-set-add {
		width: auto;
		min-width: 240px;
	}
}
