/* =========================================================
   ERTH Living Spaces — Single product page
   Gallery + summary + tabs + trust + related
   ========================================================= */

.single-product .sp-wrap {
	max-width: 1280px;
	margin: 0 auto;
	padding: 22px 24px 70px;
}

/* ---------- Breadcrumbs ---------- */
.sp-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 12.5px;
	color: #6E6A63;
	margin-bottom: 18px;
}

.sp-crumbs a {
	color: #6E6A63;
	text-decoration: none;
	transition: color .25s cubic-bezier(.22, .61, .36, 1);
}

.sp-crumbs a:hover {
	color: #1B3B2B;
}

/* ---------- Layout ---------- */
.single-product div.product {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
	gap: 46px;
	align-items: start;
}

.single-product div.product > .woocommerce-tabs,
.single-product div.product > .related,
.single-product div.product > .upsells,
.single-product div.product > .sp-trust,
.single-product div.product > .woocommerce-notices-wrapper {
	grid-column: 1 / -1;
}

/* ---------- Gallery ---------- */
.single-product div.product .woocommerce-product-gallery {
	float: none;
	width: 100%;
	margin: 0;
	position: relative;
}

.single-product div.product .woocommerce-product-gallery__wrapper {
	border-radius: 18px;
	overflow: hidden;
	background: #F4F1EA;
}

.single-product div.product .woocommerce-product-gallery img {
	border-radius: 18px;
	display: block;
	width: 100%;
	height: auto;
}

.single-product div.product .flex-control-thumbs {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.single-product div.product .flex-control-thumbs li {
	width: 100%;
	margin: 0;
	list-style: none;
}

.single-product div.product .flex-control-thumbs img {
	border: 1px solid #ECECEC;
	border-radius: 12px;
	opacity: .65;
	cursor: pointer;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: opacity .25s cubic-bezier(.22, .61, .36, 1), border-color .25s cubic-bezier(.22, .61, .36, 1);
}

.single-product div.product .flex-control-thumbs img.flex-active,
.single-product div.product .flex-control-thumbs img:hover {
	opacity: 1;
	border-color: #C5A85C;
}

.single-product div.product .onsale,
.single-product .badge--sale {
	position: absolute;
	top: 16px;
	inset-inline-start: 16px;
	z-index: 3;
	margin: 0;
	background: #C5A85C;
	color: #fff;
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 12.5px;
	font-weight: 700;
	min-height: 0;
	line-height: 1.4;
}

/* ---------- Summary ---------- */
.single-product div.product .summary {
	float: none;
	width: 100%;
	margin: 0;
}

.sp-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	letter-spacing: 2px;
	color: #C5A85C;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.single-product div.product .product_title {
	font-size: 34px;
	line-height: 1.35;
	font-weight: 800;
	color: #1B3B2B;
	margin: 0 0 10px;
}

.sp-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	font-size: 12.5px;
	color: #6E6A63;
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid #ECECEC;
}

.sp-meta .stars {
	color: #C5A85C;
	font-size: 13px;
	letter-spacing: 2px;
}

.sp-stock {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #1B3B2B;
	font-weight: 600;
}

.sp-stock::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #2F7D4F;
}

.sp-stock.is-out::before {
	background: #B0413E;
}

.single-product div.product p.price,
.single-product div.product span.price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px;
	font-size: 30px;
	font-weight: 800;
	color: #1B3B2B;
	margin: 0 0 6px;
}

.single-product div.product p.price del {
	font-size: 17px;
	font-weight: 500;
	color: #a5a29b;
	opacity: 1;
}

.single-product div.product p.price ins {
	text-decoration: none;
	color: #1B3B2B;
}

.sp-saving {
	display: inline-flex;
	align-items: center;
	background: #EDF3EE;
	color: #2F7D4F;
	border-radius: 999px;
	padding: 4px 12px;
	font-size: 12.5px;
	font-weight: 700;
}

.sp-tax {
	font-size: 12px;
	color: #6E6A63;
	margin: 0 0 16px;
}

.single-product div.product .woocommerce-product-details__short-description {
	font-size: 15px;
	line-height: 1.9;
	color: #4a4741;
	margin-bottom: 18px;
}

/* ---------- Variations / quantity / cart ---------- */
.single-product div.product form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
}

.single-product div.product form.variations_form {
	display: block;
}

.single-product div.product table.variations {
	width: 100%;
	border: 0;
	margin-bottom: 12px;
}

.single-product div.product table.variations th,
.single-product div.product table.variations td {
	border: 0;
	padding: 6px 0;
	vertical-align: middle;
}

.single-product div.product table.variations label {
	font-weight: 700;
	color: #1B3B2B;
	font-size: 13.5px;
}

.single-product div.product select {
	width: 100%;
	min-height: 46px;
	border: 1px solid #ECECEC;
	border-radius: 12px;
	background: #fff;
	padding: 0 14px;
	font-family: inherit;
	font-size: 14px;
	color: #222;
}

.single-product div.product .quantity {
	display: inline-flex;
	align-items: center;
	border: 1px solid #ECECEC;
	border-radius: 12px;
	background: #fff;
	height: 52px;
	padding: 0 6px;
}

.single-product div.product .quantity input.qty {
	width: 58px;
	height: 50px;
	border: 0;
	text-align: center;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	color: #1B3B2B;
	background: transparent;
}

.single-product div.product .single_add_to_cart_button {
	flex: 1 1 220px;
	min-height: 52px;
	border: 0;
	border-radius: 12px;
	background: #1B3B2B;
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background .25s cubic-bezier(.22, .61, .36, 1), transform .25s cubic-bezier(.22, .61, .36, 1);
}

.single-product div.product .single_add_to_cart_button:hover {
	background: #142C20;
	transform: translateY(-2px);
}

/* ---------- Buy now + WhatsApp ---------- */
.sp-buy {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 12px;
}

.sp-buy__now,
.sp-buy__wa {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	border-radius: 12px;
	font-size: 14.5px;
	font-weight: 700;
	text-decoration: none;
	transition: transform .25s cubic-bezier(.22, .61, .36, 1), background .25s cubic-bezier(.22, .61, .36, 1);
}

.sp-buy__now {
	background: #C5A85C;
	color: #fff;
}

.sp-buy__now:hover {
	background: #b3974e;
	transform: translateY(-2px);
}

.sp-buy__wa {
	background: #EDF3EE;
	color: #1B6B3A;
	border: 1px solid #cfe3d6;
}

.sp-buy__wa svg {
	fill: currentColor;
	stroke: none;
}

.sp-buy__wa:hover {
	background: #e2eee6;
	transform: translateY(-2px);
}

.sp-help {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #6E6A63;
	margin-bottom: 18px;
}

.sp-help a {
	color: #1B3B2B;
	font-weight: 700;
	text-decoration: none;
}

/* ---------- Assurance list ---------- */
.sp-assure {
	list-style: none;
	margin: 18px 0 0;
	padding: 16px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 14px;
	background: #F7F5F0;
	border: 1px solid #EAE6DC;
	border-radius: 16px;
}

.sp-assure li {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 12.8px;
	color: #4a4741;
	line-height: 1.6;
}

.sp-assure svg {
	flex: 0 0 auto;
	fill: none;
	stroke: #C5A85C;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.single-product div.product .product_meta {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid #ECECEC;
	font-size: 12.5px;
	color: #6E6A63;
	display: grid;
	gap: 6px;
}

.single-product div.product .product_meta a {
	color: #1B3B2B;
	text-decoration: none;
}

/* ---------- Tabs ---------- */
.single-product div.product .woocommerce-tabs {
	margin-top: 54px;
}

.single-product div.product .woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	border-bottom: 1px solid #ECECEC;
	list-style: none;
}

.single-product div.product .woocommerce-tabs ul.tabs::before,
.single-product div.product .woocommerce-tabs ul.tabs li::before,
.single-product div.product .woocommerce-tabs ul.tabs li::after {
	display: none;
}

.single-product div.product .woocommerce-tabs ul.tabs li {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	border-radius: 0;
}

.single-product div.product .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 12px 18px;
	font-size: 14.5px;
	font-weight: 700;
	color: #6E6A63;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: color .25s cubic-bezier(.22, .61, .36, 1), border-color .25s cubic-bezier(.22, .61, .36, 1);
}

.single-product div.product .woocommerce-tabs ul.tabs li.active a,
.single-product div.product .woocommerce-tabs ul.tabs li a:hover {
	color: #1B3B2B;
	border-bottom-color: #C5A85C;
}

.single-product div.product .woocommerce-tabs .panel {
	font-size: 15px;
	line-height: 1.95;
	color: #4a4741;
	margin: 0;
	padding: 0;
}

.single-product div.product .woocommerce-tabs .panel h2,
.single-product div.product .woocommerce-tabs .panel h3 {
	font-size: 19px;
	color: #1B3B2B;
	margin: 0 0 12px;
}

.sp-list {
	margin: 0 0 14px;
	padding-inline-start: 18px;
}

.sp-list li {
	margin-bottom: 7px;
}

.sp-specs table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #ECECEC;
	border-radius: 14px;
	overflow: hidden;
	font-size: 14px;
}

.sp-specs th,
.sp-specs td {
	padding: 12px 16px;
	text-align: start;
	border-bottom: 1px solid #ECECEC;
}

.sp-specs th {
	width: 34%;
	background: #F7F5F0;
	color: #1B3B2B;
	font-weight: 700;
}

.sp-specs tr:last-child th,
.sp-specs tr:last-child td {
	border-bottom: 0;
}

/* ---------- Trust strip ---------- */
.sp-trust {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin-top: 46px;
}

.sp-trust__item {
	background: #fff;
	border: 1px solid #ECECEC;
	border-radius: 16px;
	padding: 18px 16px;
	text-align: center;
}

.sp-trust__item strong {
	display: block;
	font-size: 14.5px;
	color: #1B3B2B;
	margin-bottom: 4px;
}

.sp-trust__item span {
	font-size: 12.5px;
	color: #6E6A63;
}

/* ---------- Related / upsells ---------- */
.single-product .related > h2,
.single-product .upsells > h2 {
	font-size: 24px;
	color: #1B3B2B;
	margin: 54px 0 18px;
}

/* ---------- Sticky mobile bar ---------- */
.sp-sticky {
	display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.single-product div.product {
		gap: 32px;
	}

	.single-product div.product .product_title {
		font-size: 28px;
	}
}

@media (max-width: 920px) {
	.single-product .sp-wrap {
		padding: 14px 16px 40px;
	}

	.single-product div.product {
		grid-template-columns: 1fr;
		gap: 22px;
	}

	.sp-crumbs {
		font-size: 11.5px;
		margin-bottom: 12px;
	}

	.single-product div.product .product_title {
		font-size: 22px;
		line-height: 1.45;
	}

	.single-product div.product p.price,
	.single-product div.product span.price {
		font-size: 24px;
		gap: 8px;
	}

	.single-product div.product p.price del {
		font-size: 14px;
	}

	.single-product div.product .flex-control-thumbs {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 7px;
	}

	.single-product div.product .woocommerce-product-details__short-description {
		font-size: 13.5px;
		line-height: 1.85;
	}

	.single-product div.product form.cart {
		gap: 8px;
	}

	.single-product div.product .quantity {
		height: 48px;
	}

	.single-product div.product .quantity input.qty {
		height: 46px;
		width: 50px;
	}

	.single-product div.product .single_add_to_cart_button {
		flex: 1 1 160px;
		min-height: 48px;
		font-size: 14px;
	}

	.sp-buy__now,
	.sp-buy__wa {
		min-height: 46px;
		font-size: 13px;
	}

	.sp-assure {
		grid-template-columns: 1fr;
		gap: 10px;
		padding: 14px;
	}

	.sp-assure li {
		font-size: 12.2px;
	}

	.single-product div.product .woocommerce-tabs {
		margin-top: 30px;
	}

	.single-product div.product .woocommerce-tabs ul.tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		gap: 2px;
	}

	.single-product div.product .woocommerce-tabs ul.tabs::-webkit-scrollbar {
		display: none;
	}

	.single-product div.product .woocommerce-tabs ul.tabs li a {
		white-space: nowrap;
		padding: 10px 12px;
		font-size: 13px;
	}

	.single-product div.product .woocommerce-tabs .panel {
		font-size: 13.5px;
		line-height: 1.9;
	}

	.sp-specs table {
		font-size: 12.5px;
	}

	.sp-specs th,
	.sp-specs td {
		padding: 9px 11px;
	}

	.sp-trust {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
		margin-top: 28px;
	}

	.sp-trust__item {
		padding: 13px 10px;
		border-radius: 13px;
	}

	.sp-trust__item strong {
		font-size: 12.5px;
	}

	.sp-trust__item span {
		font-size: 11px;
	}

	.single-product .related > h2,
	.single-product .upsells > h2 {
		font-size: 18px;
		margin: 30px 0 12px;
	}

	/* Sticky purchase bar */
	.sp-sticky {
		position: fixed;
		inset-inline: 0;
		bottom: calc(54px + env(safe-area-inset-bottom, 0px));
		z-index: 70;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		padding: 8px 14px;
		background: #fff;
		border-top: 1px solid #ECECEC;
		box-shadow: 0 -6px 20px rgba(27, 59, 43, .07);
	}

	.sp-sticky__price {
		display: flex;
		flex-direction: column;
		line-height: 1.3;
		min-width: 0;
	}

	.sp-sticky__price span {
		font-size: 15px;
		font-weight: 800;
		color: #1B3B2B;
	}

	.sp-sticky__price span del {
		display: none;
	}

	.sp-sticky__price em {
		font-style: normal;
		font-size: 11px;
		color: #8b8880;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.sp-sticky__cart {
		flex: 0 0 auto;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 40px;
		padding: 0 20px;
		border-radius: 999px;
		background: #1B3B2B;
		color: #fff;
		font-size: 13.5px;
		font-weight: 700;
		text-decoration: none;
	}

	.single-product body,
	body.single-product {
		padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
	}
}

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

	.single-product div.product .flex-control-thumbs {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.single-product div.product .single_add_to_cart_button {
		flex: 1 1 100%;
	}
}

/* ---------- Customers also choose ---------- */
.sp-bundle {
	grid-column: 1 / -1;
	margin-top: 50px;
	padding: 24px;
	background: #F7F5F0;
	border: 1px solid #EAE6DC;
	border-radius: 20px;
}

.sp-bundle > h2 {
	font-size: 21px;
	color: #1B3B2B;
	margin: 0 0 18px;
}

.sp-bundle__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
}

.sp-bundle__item {
	background: #fff;
	border: 1px solid #ECECEC;
	border-radius: 14px;
	padding: 12px;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sp-bundle__media {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	background: #F4F1EA;
}

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

.sp-bundle__name {
	font-size: 13px;
	font-weight: 700;
	color: #1B3B2B;
	text-decoration: none;
	line-height: 1.5;
}

.sp-bundle__price {
	font-size: 13.5px;
	font-weight: 800;
	color: #1B3B2B;
}

.sp-bundle__price del {
	font-size: 11.5px;
	font-weight: 500;
	color: #a5a29b;
}

.sp-bundle__price ins {
	text-decoration: none;
}

.sp-bundle__add {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	border-radius: 10px;
	background: #1B3B2B;
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: none;
	transition: background .25s cubic-bezier(.22, .61, .36, 1);
}

.sp-bundle__add:hover {
	background: #142C20;
}

@media (max-width: 920px) {
	.sp-bundle {
		margin-top: 28px;
		padding: 14px;
		border-radius: 16px;
	}

	.sp-bundle > h2 {
		font-size: 16px;
		margin-bottom: 12px;
	}

	.sp-bundle__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.sp-bundle__item {
		padding: 9px;
		border-radius: 12px;
	}

	.sp-bundle__name {
		font-size: 11.5px;
	}

	.sp-bundle__price {
		font-size: 12.5px;
	}

	.sp-bundle__add {
		min-height: 34px;
		font-size: 11.5px;
	}
}

/* ==================================================================
   Layout hardening
   FIX: div.product is a 2-column grid. Only the gallery and the summary
   belong in those columns. Any other direct child (related products,
   up-sells, reviews, plugin sections) was auto-placed into a column and
   collapsed to a few pixels wide. The class list approach above could
   not cover markup the theme does not control, so this rule spans every
   remaining child instead. min-width:0 also stops grid blowout.
   ================================================================== */
.single-product div.product > *:not(.woocommerce-product-gallery):not(.summary) {
	grid-column: 1 / -1;
	min-width: 0;
}

.single-product div.product > .woocommerce-product-gallery,
.single-product div.product > .summary {
	min-width: 0;
}

/* Related / up-sells inside the product grid must fill the row. */
.single-product div.product .related,
.single-product div.product .upsells,
.single-product div.product .up-sells,
.single-product div.product .cross-sells {
	width: 100%;
	max-width: 100%;
	float: none;
}

/* FIX: WooCommerce prints the gallery with inline opacity:0 and only
   restores it from JS. If flexslider fails to boot the gallery stayed
   invisible, leaving a tall empty column. */
.single-product div.product .woocommerce-product-gallery {
	opacity: 1 !important;
	position: sticky;
	top: 104px;
}

/* FIX: flexslider writes inline float/width on the thumbnails, which
   pushed the last thumbs outside the gallery box. */
.single-product div.product .flex-control-thumbs li {
	float: none !important;
	width: 100% !important;
	margin: 0 !important;
}

.single-product div.product .woocommerce-product-gallery .flex-viewport,
.single-product div.product .woocommerce-product-gallery__wrapper {
	width: 100% !important;
	max-width: 100%;
}

.single-product div.product .woocommerce-product-gallery__image {
	width: 100% !important;
	float: none !important;
}

/* Keep the zoom trigger a real icon, never a stretched SVG. */
.single-product div.product .woocommerce-product-gallery__trigger {
	top: 16px;
	inset-inline-end: 16px;
	inset-inline-start: auto;
	right: auto;
	left: auto;
	width: 42px;
	height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, .94);
	font-size: 0;
	z-index: 4;
}

.single-product div.product .woocommerce-product-gallery__trigger img,
.single-product div.product .woocommerce-product-gallery__trigger svg {
	width: 18px !important;
	height: 18px !important;
	max-width: 18px;
	max-height: 18px;
}

/* The sticky gallery must release on narrow screens. */
@media (max-width: 920px) {
	.single-product div.product .woocommerce-product-gallery {
		position: static;
		top: auto;
	}
}
