/* All attribute-driven values arrive as CSS custom properties on the block
   wrapper's style="" attribute (see render.php) — no raw <style> tag, per
   DEV-NOTES.md "Lessons learned". Selectors target the static
   .elata-product-main class.

   Geometry and typography below are measured off the live section
   (.product-main-container / .product-layout / .product-title / ... on
   https://enablelifecare.com.au/products/elata-e100-home-care-mattress) at
   1440px and 390px, not guessed. Notable live values that look like mistakes
   but are not: the container is max-width 1000px INCLUDING its own 40px side
   padding (so the grid is 920px wide), and the description paragraphs are
   15px/21px grey (#a6a7aa) while the wrapper around them computes 16px —
   the paragraph rule wins, so 15px is what actually renders. */
.elata-product-main {
	padding: var( --pm-padding-top, 60px ) 0 var( --pm-padding-bottom, 60px ) 0;
	font-family: var( --elata-font, 'Poppins', sans-serif );
}
.elata-product-main--light { background-color: #ffffff; color: #1a1a1a; }
.elata-product-main--dark { background-color: var( --elata-bg-dark, #2b2b2b ); color: #ffffff; }

.elata-product-main__container {
	max-width: var( --pm-max-width, 1000px );
	margin: 0 auto;
	padding: 0 40px;
}

.elata-product-main__layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 60px;
	align-items: start;
}

/* The live image is not cropped to a fixed box — it keeps its natural
   aspect ratio and simply fills the column width. */
.elata-product-main__main-image-wrap {
	position: relative;
	width: 100%;
}
.elata-product-main__main-image {
	width: 100%;
	height: auto;
	display: none;
	border-radius: 8px;
	margin-bottom: 15px;
	cursor: zoom-in;
}
.elata-product-main__main-image.is-active { display: block; }

/* Click-to-zoom overlay — geometry taken from the live .image-zoom-overlay /
   .zoomed-image / .zoom-close trio. */
.elata-product-main__zoom {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 0, 0, 0, 0.95 );
	cursor: zoom-out;
}
/* [hidden] needs help beating the display:flex above. */
.elata-product-main__zoom[hidden] { display: none; }

.elata-product-main__zoom-image {
	max-width: 90%;
	max-height: 90%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
}

.elata-product-main__zoom-close {
	position: absolute;
	top: 20px;
	right: 30px;
	padding: 0;
	line-height: 1;
	font-family: inherit;
	font-size: 40px;
	color: #ffffff;
	background: none;
	border: none;
	cursor: pointer;
}
.elata-product-main__zoom-close:hover { opacity: 0.7; }

.elata-product-main__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 240px;
	border-radius: 8px;
	background: rgba( 0, 0, 0, 0.03 );
	color: #888;
	font-size: 13px;
	text-align: center;
	padding: 20px;
}

.elata-product-main__thumbnails {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 10px 0 0;
	-webkit-overflow-scrolling: touch;
}
.elata-product-main__thumb {
	flex-shrink: 0;
	width: 70px;
	height: 70px;
	padding: 0;
	border-radius: 6px;
	border: 2px solid transparent;
	cursor: pointer;
	background: none;
	opacity: 0.6;
	transition: all 0.3s ease;
	overflow: hidden;
}
.elata-product-main__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.elata-product-main__thumb:hover { opacity: 0.85; }
.elata-product-main__thumb.is-active {
	opacity: 1;
	border-color: var( --pm-accent, #c76328 );
}

/* Opt-in extras (off by default — the live page shows none of them). */
.elata-product-main__model {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var( --pm-accent, #c76328 );
	margin-bottom: 10px;
}

.elata-product-main__title {
	font-size: var( --pm-title-size, 32px );
	font-weight: 700;
	line-height: var( --pm-line-height, 1.7 );
	color: #1a1a1a;
	margin: 0 0 20px;
}
.elata-product-main--dark .elata-product-main__title { color: #ffffff; }

.elata-product-main__headline {
	font-size: var( --pm-body-size, 16px );
	font-weight: 600;
	line-height: var( --pm-line-height, 1.7 );
	opacity: 0.8;
	margin: 0 0 15px;
}

.elata-product-main__description {
	font-size: var( --pm-body-size, 16px );
	line-height: var( --pm-line-height, 1.7 );
	margin: 0 0 30px;
}
/* base.css's heading/paragraph margin reset is wrapped in :where() so it sits
   at zero specificity — these margins therefore apply as written. */
.elata-product-main__description p {
	font-size: 15px;
	line-height: 1.4;
	color: #a6a7aa;
	margin: 0 0 15px;
}
.elata-product-main__description p:last-child { margin-bottom: 0; }

.elata-product-main__options { margin: 0 0 25px; }

.elata-product-main__option-label {
	display: block;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.43;
	color: #1a1a1a;
	margin: 0 0 12px;
}

.elata-product-main__option-select {
	display: block;
	width: 100%;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.43;
	color: #1a1a1a;
	padding: 14px 18px;
	background-color: #ffffff;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 8px;
	cursor: pointer;
	/* Native arrow replaced with the live section's inline SVG chevron so the
	   control looks identical across browsers. */
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%231a1a1a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E" );
	background-repeat: no-repeat;
	background-position: calc( 100% - 16px ) 50%;
}

.elata-product-main__sku {
	font-size: 14px;
	line-height: 1.43;
	color: #666666;
	margin: 0 0 20px;
}
.elata-product-main__sku-label {
	/* Unclassed-equivalent span on the live page — base font (Hind). */
	font-family: var( --elata-font-body, inherit );
	font-weight: 600;
	color: #1a1a1a;
	margin-right: 8px;
}
.elata-product-main__sku-value {
	/* Live renders the SKU itself in a monospace face — it is a code to read
	   off and type into an order, so the fixed advance width is doing real
	   work (E100KS vs E1OOKS). */
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	padding: 3px 8px;
	background-color: rgba( 0, 0, 0, 0.03 );
	border-radius: 4px;
}

.elata-product-main__price-note {
	font-size: 13px;
	opacity: 0.65;
	margin-bottom: 25px;
}

.elata-product-main__ctas {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 30px;
}

.elata-product-main__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	padding: 14px 28px;
	border-radius: 6px;
	transition: all 0.2s ease;
}
.elata-product-main__cta--solid {
	background: var( --pm-accent, #c76328 );
	color: #ffffff;
}
.elata-product-main__cta--solid:hover { opacity: 0.9; }
.elata-product-main__cta--outline {
	background: transparent;
	color: var( --pm-accent, #c76328 );
	border: 2px solid var( --pm-accent, #c76328 );
}
.elata-product-main__cta--outline:hover {
	background: var( --pm-accent, #c76328 );
	color: #ffffff;
}

.elata-product-main__share {
	padding-top: 25px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
}
.elata-product-main__share-label {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.43;
	color: #1a1a1a;
	margin: 0 0 12px;
}
.elata-product-main__share-buttons {
	display: flex;
	gap: 10px;
}
.elata-product-main__share-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	color: #1a1a1a;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 6px;
	transition: all 0.2s ease;
}
.elata-product-main__share-btn:hover {
	color: var( --pm-accent, #c76328 );
	border-color: var( --pm-accent, #c76328 );
}

.elata-product-main--empty {
	padding: 30px 20px;
	text-align: center;
	background: #f5f5f5;
	color: #666;
	font-size: 14px;
}

@media ( max-width: 768px ) {
	.elata-product-main {
		padding: var( --pm-padding-top-mobile, 30px ) 0 var( --pm-padding-bottom-mobile, 30px ) 0;
	}
	.elata-product-main__container { padding: 0 20px; }
	.elata-product-main__layout { display: block; }
	.elata-product-main__gallery { margin-bottom: 30px; }
	.elata-product-main__title { font-size: var( --pm-title-size-mobile, 24px ); }
	.elata-product-main__headline,
	.elata-product-main__description { font-size: var( --pm-body-size-mobile, 14px ); }
	.elata-product-main__option-label,
	.elata-product-main__option-select,
	.elata-product-main__share-label { font-size: 14px; }
	.elata-product-main__sku { font-size: 12px; }
	.elata-product-main__cta { flex: 1 1 auto; text-align: center; }
}
