/* Curtain Roll storefront */
:root {
	--cr-ink: #14181d;
	--cr-muted: #6d767d;
	--cr-line: #e6e8eb;
	--cr-accent: #f5c400;
	--cr-ok: #0a8a3c;
	--cr-err: #c0392b;
	--cr-bg: #ffffff;
}

.cr-page { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }

.cr-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 900px) { .cr-grid { grid-template-columns: 1fr; gap: 28px; } }

/* --- configurator mount ------------------------------------------------ */
/* #c and .model-loader are required by the bundle; do not rename. */
/* The bundle reads this container's box when it builds its canvas, so #c needs a
   DEFINITE height before the (deferred) bundle runs — with only a min-height it
   sized itself to the document and produced a 1172x1800 canvas. */
#c {
	position: relative; height: 560px; background: #f4f5f6;
	border: 1px solid var(--cr-line); border-radius: 10px; overflow: hidden;
	display: flex; align-items: center; justify-content: center;
}
/* keep whatever aspect ratio it renders at, just fit it inside the box */
#c canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
@media (max-width: 900px) { #c { height: 380px; } }

.model-loader {
	position: absolute; inset: 0; margin: auto; width: 34px; height: 34px;
	border: 3px solid var(--cr-line); border-top-color: var(--cr-accent);
	border-radius: 50%; animation: cr-spin 0.9s linear infinite;
}
.model-loader.is-failed { animation: none; border-top-color: var(--cr-err); }
@keyframes cr-spin { to { transform: rotate(360deg); } }

/* --- details ------------------------------------------------------------ */
.cr-title { font-size: 30px; font-weight: 700; margin: 0 0 10px; color: var(--cr-ink); }
.cr-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.cr-price-label { font-size: 13px; color: var(--cr-muted); text-transform: uppercase; letter-spacing: .04em; }
.cr-price-value { font-size: 24px; font-weight: 700; color: var(--cr-ok); }
.cr-desc { color: var(--cr-muted); line-height: 1.65; margin-bottom: 24px; }

/* collapsible option groups (accordion), as on the original */
.cr-accordion { border-top: 1px solid var(--cr-line); margin: 20px 0 4px; }
.cr-group { border-bottom: 1px solid var(--cr-line); margin: 0; }
.cr-group-head {
	width: 100%; display: flex; align-items: center; justify-content: space-between;
	gap: 12px; background: none; border: 0; cursor: pointer; text-align: left;
	padding: 14px 2px; font: inherit; color: var(--cr-ink);
}
.cr-group-head:hover { color: #000; }
.cr-group-head:focus-visible { outline: 2px solid var(--cr-accent); outline-offset: -2px; }
.cr-group-label { font-size: 13px; font-weight: 700; text-transform: uppercase;
	letter-spacing: .05em; color: inherit; margin: 0; }
.cr-caret { width: 9px; height: 9px; flex: none; border-right: 2px solid var(--cr-muted);
	border-bottom: 2px solid var(--cr-muted); transform: rotate(45deg) translate(-2px, -2px);
	transition: transform .18s ease; }
.cr-group.is-open .cr-caret { transform: rotate(-135deg) translate(-2px, -2px); }
.cr-group-body { padding: 2px 2px 18px; }

.cr-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
/* the original nests each input in <div class="radio"><label>; keep that
   structure (the bundle relies on the wrapper chain) but make it a flex item */
.cr-swatches > .radio, .cr-choices > .radio { margin: 0; padding: 0; }
.cr-swatch { position: relative; cursor: pointer; width: 62px; text-align: center; margin: 0; }
.cr-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.cr-swatch img {
	width: 62px; height: 62px; object-fit: cover; border-radius: 8px;
	border: 2px solid var(--cr-line); transition: border-color .15s, transform .15s;
}
.cr-swatch:hover img { transform: translateY(-2px); }
.cr-swatch input:checked + img { border-color: var(--cr-accent); }
.cr-swatch input:focus-visible + img { outline: 2px solid var(--cr-ink); outline-offset: 2px; }
.cr-swatch-code { display: block; font-size: 10px; color: var(--cr-muted); margin-top: 4px;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* made-to-measure size inputs */
.cr-size { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.cr-size .cr-field { margin-bottom: 0; }
.cr-area { grid-column: 1 / -1; font-size: 13px; color: var(--cr-muted); min-height: 1.2em; }
.cr-area.is-set { color: var(--cr-ink); font-weight: 600; }
@media (max-width: 520px) { .cr-size { grid-template-columns: 1fr; } }

/* plain (non-swatch) choices */
.cr-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.cr-choice { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
	border: 1px solid var(--cr-line); border-radius: 8px; padding: 7px 12px;
	font-size: 14px; margin: 0; transition: border-color .15s, background .15s; }
.cr-choice:hover { background: #fafbfc; }
.cr-choice input { margin: 0; }
.cr-choice:has(input:checked) { border-color: var(--cr-accent); background: #fffdf2; }

.cr-qty { width: 110px; border: 1px solid var(--cr-line); border-radius: 8px;
	padding: 9px 11px; font: inherit; }

/* the bundle writes its render here; keep it in the DOM but out of sight */
.cr-capture { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --- quote form --------------------------------------------------------- */
.cr-quote { margin-top: 28px; padding: 22px; border: 1px solid var(--cr-line);
	border-radius: 12px; background: var(--cr-bg); }
.cr-quote h4 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.cr-quote-hint { margin: 0 0 16px; font-size: 13px; color: var(--cr-muted); }
.cr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .cr-row { grid-template-columns: 1fr; } }
.cr-field { margin-bottom: 12px; display: flex; flex-direction: column; }
.cr-field label { font-size: 12px; font-weight: 600; color: var(--cr-muted); margin-bottom: 5px; }
.cr-field input, .cr-field textarea {
	border: 1px solid var(--cr-line); border-radius: 8px; padding: 9px 11px;
	font: inherit; color: var(--cr-ink); background: #fff; width: 100%;
}
.cr-field input:focus, .cr-field textarea:focus {
	outline: none; border-color: var(--cr-accent); box-shadow: 0 0 0 3px rgba(245,196,0,.18);
}
.cr-submit {
	width: 100%; padding: 12px 18px; border: 0; border-radius: 8px; cursor: pointer;
	background: var(--cr-accent); color: #14181d; font-weight: 700; font-size: 15px;
}
.cr-submit:hover { filter: brightness(.95); }
.cr-submit:disabled { opacity: .6; cursor: default; }
.cr-quote-result { margin-top: 12px; font-size: 14px; min-height: 1em; }
.cr-quote-result.is-ok { color: var(--cr-ok); }
.cr-quote-result.is-error { color: var(--cr-err); }

/* --- home --------------------------------------------------------------- */
.cr-home { padding-bottom: 64px; }

/* hero: full-bleed, matching the original's edge-to-edge slider */
.cr-hero {
	position: relative; margin: 0 0 48px; overflow: hidden; background: #eceef0;
	width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
}
.cr-hero-track { position: relative; }
.cr-slide { opacity: 0; transition: opacity .6s ease; }
.cr-slide:not(:first-child) { position: absolute; inset: 0; }
.cr-slide.is-active { opacity: 1; }
.cr-slide img { width: 100%; height: auto; display: block; object-fit: cover; }

.cr-hero-nav {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer;
	background: rgba(255,255,255,.82); color: var(--cr-ink);
	font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.cr-hero-nav:hover { background: #fff; }
.cr-prev { left: 16px; } .cr-next { right: 16px; }
@media (max-width: 640px) { .cr-hero-nav { display: none; } }

.cr-dots { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 2;
	display: flex; justify-content: center; gap: 8px; }
.cr-dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
	background: rgba(255,255,255,.55); }
.cr-dot.is-active { background: #fff; width: 22px; border-radius: 5px; }

/* section heading, centred with the accent rule the original uses */
.cr-section { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.cr-section-head { text-align: center; margin-bottom: 34px; }
.cr-section-title { font-size: 28px; font-weight: 700; margin: 0 0 10px; color: var(--cr-ink); }
.cr-rule { display: block; width: 62px; height: 3px; margin: 0 auto 14px;
	background: var(--cr-accent); border-radius: 2px; }
.cr-section-sub { color: var(--cr-muted); margin: 0 auto; max-width: 620px; line-height: 1.6; }

.cr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 26px; }
.cr-card {
	border: 1px solid var(--cr-line); border-radius: 12px; overflow: hidden;
	background: #fff; text-decoration: none; color: inherit; display: flex; flex-direction: column;
	transition: transform .18s ease, box-shadow .18s ease;
}
.cr-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.10); text-decoration: none; }
.cr-card-media { position: relative; background: #f4f5f6; }
/* every banner is 940x550, so pin the ratio and the grid stays aligned */
.cr-card-media img { width: 100%; aspect-ratio: 940 / 550; object-fit: cover; display: block; }
.cr-badge { position: absolute; top: 10px; left: 10px; background: var(--cr-accent);
	color: #14181d; font-size: 11px; font-weight: 700; letter-spacing: .04em;
	padding: 3px 8px; border-radius: 4px; }
.cr-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cr-card-title { font-weight: 700; font-size: 17px; color: var(--cr-ink); }
.cr-card-tag { font-size: 13px; color: var(--cr-muted); line-height: 1.5; flex: 1; }
.cr-card-price { font-size: 13px; color: var(--cr-ok); font-weight: 700; margin-top: 6px; }
