/* =========================================================================
   3D Cabin Customizer — page-specific styles (loaded only on this page)
   ========================================================================= */
.cc-hero {
  background: linear-gradient(120deg, var(--maroon-900) 0%, var(--maroon-800) 100%);
  color: var(--white); padding-block: var(--space-5) var(--space-4);
}
.cc-hero h1 { color: var(--white); max-width: 26ch; }
.cc-hero p { color: var(--gray-100); max-width: 62ch; }
.cc-hero .badge-row { margin-block-start: var(--space-2); }

.cc-layout {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--space-4);
  align-items: start; padding-block: var(--space-5);
}
@media (max-width: 960px) { .cc-layout { grid-template-columns: 1fr; } }

.cc-stage {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--color-border);
  background: #e9e6e3;
}
.cc-canvas-host { width: 100%; aspect-ratio: 4/3; touch-action: none; }
.cc-canvas-host canvas {
  display: block; width: 100% !important; height: 100% !important; outline: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
/* Outline, not an inset box-shadow: inset shadows paint underneath a canvas's pixels and are invisible */
.cc-canvas-host canvas:focus-visible { outline: 3px solid var(--color-focus); outline-offset: -3px; }

/* ---- Fullscreen: fill the screen instead of keeping the 4:3 box ---------
   (kept as separate rules — an unsupported pseudo-class would invalidate a
   combined selector list) */
.cc-stage:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.cc-stage:fullscreen .cc-canvas-host { aspect-ratio: auto; height: 100%; }
.cc-stage:-webkit-full-screen { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.cc-stage:-webkit-full-screen .cc-canvas-host { aspect-ratio: auto; height: 100%; }

.cc-stage__toolbar {
  position: absolute; top: 0.8rem; inset-inline-end: 0.8rem; display: flex; gap: 0.5rem; z-index: 5;
}
.cc-stage__toolbar button {
  background: rgba(255,255,255,0.92); border: 1px solid var(--color-border); border-radius: 999px;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--gray-800);
  position: relative; transition: background var(--transition), transform var(--transition);
}
/* The display:flex above would otherwise override the [hidden] attribute (set by JS when fullscreen is unsupported) */
.cc-stage__toolbar button[hidden] { display: none; }
.cc-stage__toolbar button:hover { background: var(--white); transform: translateY(-1px); }
.cc-stage__toolbar button[aria-pressed="true"] { background: var(--color-brand); color: var(--white); border-color: var(--color-brand); }
.cc-stage__toolbar svg { width: 18px; height: 18px; }

.cc-hint {
  position: absolute; bottom: 0.8rem; inset-inline-start: 0.8rem; z-index: 5;
  background: rgba(20,8,6,0.55); color: var(--white); font-size: 0.78rem; font-weight: 600;
  padding: 0.4rem 0.8rem; border-radius: 999px; backdrop-filter: blur(2px);
  transition: opacity var(--transition);
}

/* ---- Loading overlay ------------------------------------------------- */
.cc-loading {
  position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0.9rem; background: #e9e6e3; color: var(--gray-700);
  font-weight: 700; font-size: 0.9rem; transition: opacity 400ms ease, visibility 400ms ease;
}
.cc-loading.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.cc-spinner {
  width: 40px; height: 40px; border-radius: 50%; border: 3.5px solid var(--maroon-100);
  border-top-color: var(--color-brand); animation: cc-spin 850ms linear infinite;
}
@keyframes cc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cc-spinner { animation-duration: 1900ms; } }

/* ---- Toast (share-link confirmation) ---------------------------------- */
.cc-toast {
  position: absolute; top: 0.8rem; inset-inline-start: 0.8rem; z-index: 6;
  background: var(--maroon-900); color: var(--white); font-size: 0.8rem; font-weight: 700;
  padding: 0.5rem 0.9rem; border-radius: 999px; opacity: 0; transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition); pointer-events: none;
  /* Leave room for the toolbar (up to 4 × 40px buttons) at the inline-end side */
  max-inline-size: calc(100% - 15rem); inline-size: max-content; overflow-wrap: anywhere;
}
.cc-toast.is-visible { opacity: 1; transform: translateY(0); }
/* Narrow stages: there's no room beside the toolbar, so drop the toast below it */
@media (max-width: 640px) {
  .cc-toast { top: calc(0.8rem + 40px + 0.5rem); max-inline-size: calc(100% - 1.6rem); border-radius: var(--radius-sm); }
}

/* ---- "Your Configuration" summary card -------------------------------- */
.cc-summary-card {
  margin-block-start: 0.9rem; background: var(--gray-050); border-radius: var(--radius-sm);
  padding: 0.9rem 1rem; border: 1px solid var(--color-border);
}
.cc-summary-card__title { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-500); margin-block-end: 0.5rem; }
.cc-summary-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.cc-summary-list li { display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; color: var(--gray-800); }
.cc-summary-list .chip { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,0.1); }
.cc-summary-list .label { color: var(--gray-500); font-weight: 600; min-width: 5.2em; }

.cc-panel { background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-3); }
.cc-panel h2 { font-size: 1.2rem; margin-block-end: 0.25rem; }
.cc-panel > p { color: var(--color-text-muted); font-size: 0.9rem; }

.cc-group { margin-block: var(--space-3); }
.cc-group h3 { font-size: 0.95rem; display: flex; align-items: center; justify-content: space-between; margin-block-end: 0.6rem; }
.cc-group .tag { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-500); background: var(--gray-100); padding: 0.2rem 0.55rem; border-radius: 999px; }
.cc-group .tag.tag--verified { color: var(--maroon-800); background: var(--maroon-050); }

.cc-swatches { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.cc-swatch {
  width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--white);
  box-shadow: 0 0 0 1.5px var(--color-border); position: relative; flex-shrink: 0;
  background-size: cover; transition: transform var(--transition), box-shadow var(--transition);
}
.cc-swatch:hover { transform: translateY(-1px); }
.cc-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--color-brand); }
.cc-swatch[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 10px; height: 10px; border-radius: 50%;
  background: var(--white); box-shadow: 0 0 0 1.5px var(--color-brand), 0 1px 3px rgba(0,0,0,0.3);
}

/* ---- Material-look swatches --------------------------------------------
   Stylised CSS approximations of each documented finish — not photographs
   (none were supplied) but closer to a "material" than a flat color dot:
   brushed = fine directional lines, mirror = glossy diagonal sheen,
   powder-coated = flat matte, illustrative floor samples get a light
   texture cue (speckle / veining / grain / stipple). */
.cc-swatch[data-swatch="black-hairline"] {
  background-color: #2b2b2c;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.14) 0px, rgba(255,255,255,0.14) 1px, transparent 1px, transparent 3px);
}
.cc-swatch[data-swatch="grey-mirror"] {
  background-color: #c9cdd1;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.1) 30%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.55) 68%, rgba(255,255,255,0.05) 100%);
}
.cc-swatch[data-swatch="champagne-brushed"] {
  background-color: #c9a97a;
  background-image: repeating-linear-gradient(100deg, rgba(255,255,255,0.22) 0px, rgba(255,255,255,0.22) 1px, transparent 1px, transparent 3px);
}
.cc-swatch[data-swatch="gold-mirror"] {
  background-color: #e8cf82;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.15) 30%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.6) 68%, rgba(255,255,255,0.05) 100%);
}
.cc-swatch[data-swatch="mirror-polished"] {
  background-color: #eef0f2;
  background-image: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.1) 28%, rgba(255,255,255,0.05) 48%, rgba(255,255,255,0.75) 66%, rgba(255,255,255,0.1) 100%);
}
.cc-swatch[data-swatch="white-powder"] {
  background-color: #f5f2ee;
  box-shadow: 0 0 0 1.5px var(--color-border), inset 0 -4px 7px rgba(0,0,0,0.07), inset 0 2px 3px rgba(255,255,255,0.8);
}
.cc-swatch[data-swatch="dark-granite"] {
  background-color: #2a2a2c;
  background-image: radial-gradient(circle at 30% 35%, rgba(255,255,255,0.35) 0 1px, transparent 1.5px),
    radial-gradient(circle at 62% 60%, rgba(255,255,255,0.25) 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 25%, rgba(255,255,255,0.3) 0 1px, transparent 1.5px),
    radial-gradient(circle at 45% 80%, rgba(255,255,255,0.2) 0 1px, transparent 1.5px);
  background-size: 9px 9px;
}
.cc-swatch[data-swatch="light-marble"] {
  background-color: #dcd7cf;
  background-image: linear-gradient(35deg, transparent 46%, rgba(160,150,135,0.5) 48%, transparent 51%),
    linear-gradient(48deg, transparent 62%, rgba(160,150,135,0.35) 64%, transparent 67%);
}
.cc-swatch[data-swatch="warm-wood"] {
  background-color: #8a5a34;
  background-image: repeating-linear-gradient(92deg, rgba(0,0,0,0.12) 0px, rgba(0,0,0,0.12) 1px, transparent 1px, transparent 4px);
}
.cc-swatch[data-swatch="charcoal-nonslip"] {
  background-color: #3d3d3f;
  background-image: radial-gradient(rgba(255,255,255,0.16) 1px, transparent 1.5px);
  background-size: 6px 6px;
}

.cc-actions { display: flex; flex-direction: column; gap: 0.7rem; margin-block-start: var(--space-3); }
.cc-note { font-size: 0.78rem; color: var(--gray-500); margin-block-start: var(--space-2); }

.cc-fallback {
  padding: var(--space-4); text-align: center; background: var(--gray-050); border-radius: var(--radius-lg);
  border: 1px dashed var(--color-border);
}
