/* ============================================================
   E.K Elite Motors — Showroom detail view (prototype)
   Cinematic hero + control-panel layout + film-strip lightbox
   ============================================================ */

/* ---------- Cinematic hero ---------- */
.show-hero {
  position: relative;
  background: #000;
  height: min(78vh, 820px);
  min-height: 420px;
  overflow: hidden;
}
@media (max-width: 700px) { .show-hero { height: 62vh; min-height: 360px; } }
.show-hero .media { position: absolute; inset: 0; }
.show-hero .media video,
.show-hero .media img.poster {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Ken Burns drift on the poster while no sweep video exists */
.show-hero .media img.poster.kb {
  animation: kburns 22s var(--ease) infinite alternate;
  transform-origin: 55% 60%;
}
@keyframes kburns {
  from { transform: scale(1.02) translateX(0); }
  to   { transform: scale(1.14) translateX(-2.5%); }
}
/* Overlay grade: solid #000 at top and bottom edges dissolving to
   transparent over the video, so the hero melts into the page black
   above and the panel section below. Also keeps titling legible. */
.show-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom,
      #000 0%, transparent 24%,
      transparent 56%,
      rgba(0,0,0,0.82) 86%, #000 100%);
}
.show-hero .titling {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 0 24px calc(30px + env(safe-area-inset-bottom, 0px));
  max-width: 1040px; margin: 0 auto;
  color: #fff;
}
.show-hero .titling .kicker {
  font-size: 0.72rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--gold-brand); font-weight: 650; margin-bottom: 10px;
  opacity: 0; transform: translateY(14px);
}
.show-hero .titling h1 {
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.06;
  font-size: clamp(1.8rem, 4.6vw, 3.4rem);
  opacity: 0; transform: translateY(16px);
  text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.show-hero .titling .sub {
  margin-top: 14px; font-size: 1rem;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  opacity: 0; transform: translateY(16px);
}
.show-hero .titling .plate {
  display: inline-block; background: rgba(0,0,0,0.6);
  border: 1.5px solid rgba(255,255,255,0.9); border-radius: 6px;
  padding: 3px 12px; color: #fff; font-weight: 700;
  font-size: 0.92rem; letter-spacing: 0.12em; white-space: nowrap;
  font-family: "Arial Narrow", Inter, sans-serif; text-transform: uppercase;
}
.show-hero .titling .stats {
  color: var(--gold-brand); font-weight: 500; letter-spacing: 0.02em;
}
.show-hero.loaded .kicker { animation: rise 0.9s var(--ease-out) 0.35s forwards; }
.show-hero.loaded h1     { animation: rise 0.9s var(--ease-out) 0.55s forwards; }
.show-hero.loaded .sub   { animation: rise 0.9s var(--ease-out) 0.75s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

.show-hero .render-tag {
  /* bottom-right: the top edge belongs to the floating nav */
  position: absolute; bottom: 18px; right: 20px; z-index: 2;
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.35); backdrop-filter: blur(8px);
  padding: 4px 10px; border-radius: 980px;
}

/* ---------- Control panel ---------- */
.panel { background: var(--bg); }
.panel .container { max-width: 1040px; }
.panel-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 44px 0 8px;
}
.panel-head .price-block .label {
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--dim); font-weight: 600;
}
.panel-head .price-block .price {
  font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em;
}
.panel-head .cta-row { display: flex; gap: 10px; flex-wrap: wrap; }

.keyfacts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin: 26px 0 8px;
}
.keyfact {
  background: var(--card); border-radius: 14px; padding: 14px 16px;
}
.keyfact .k { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); font-weight: 600; }
.keyfact .v { font-size: 1rem; font-weight: 600; margin-top: 2px; }

/* spec columns */
.spec-panel { columns: 2; column-gap: 40px; padding: 26px 0 10px; }
@media (max-width: 760px) { .spec-panel { columns: 1; } }
.spec-panel .spec-group { break-inside: avoid; margin-bottom: 26px; }
.spec-panel h4 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--dim); font-weight: 650; margin-bottom: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--hairline);
}
.spec-panel ul { list-style: none; }
.spec-panel li { font-size: 0.93rem; color: var(--ink-soft); padding: 3px 0; }

/* ---------- Film strip (sits between keyfacts and specs) ---------- */
.filmstrip-wrap { padding: 26px 0 18px; }
.filmstrip-wrap h3 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--dim); font-weight: 650; margin-bottom: 14px;
}
.filmstrip {
  display: flex; gap: 10px; overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.filmstrip img {
  height: 118px; width: auto; border-radius: 10px;
  scroll-snap-align: start; cursor: pointer; flex: 0 0 auto;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.filmstrip img:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
@media (max-width: 700px) { .filmstrip img { height: 92px; } }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: #000;
  display: none; flex-direction: column;
  touch-action: none;
}
.lightbox.open { display: flex; animation: lbfade 0.3s var(--ease); }
.lightbox.closing { animation: lbfadeout 0.3s var(--ease) forwards; }
@keyframes lbfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbfadeout { from { opacity: 1; } to { opacity: 0; } }
.lb-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 10px;
  color: rgba(255,255,255,0.8); font-size: 0.85rem; z-index: 3;
}
.lb-close {
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  width: 38px; height: 38px; border-radius: 50%; font-size: 1.05rem;
  cursor: pointer; transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.lb-close:hover { background: rgba(255,255,255,0.24); }
.lb-close:active { transform: scale(0.92); }
.lb-track {
  flex: 1; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide {
  flex: 0 0 100%; scroll-snap-align: center;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
}
.lb-slide img {
  max-width: 100%; max-height: calc(100vh - 210px);
  border-radius: 6px; user-select: none; -webkit-user-drag: none;
  transition: transform 0.25s var(--ease-out);
}
.lb-slide img.zoomed { cursor: grab; }
.lb-thumbs {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
}
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumbs img {
  height: 54px; border-radius: 6px; flex: 0 0 auto; cursor: pointer;
  opacity: 0.45; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease-out);
}
.lb-thumbs img.sel { opacity: 1; outline: 2px solid var(--gold-brand); outline-offset: 1px; }
.lb-thumbs img:hover { opacity: 0.85; }

/* arrows (desktop) */
.lb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  background: rgba(255,255,255,0.10); border: none; color: #fff;
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.2rem; cursor: pointer;
  transition: background 0.25s var(--ease);
}
.lb-arrow:hover { background: rgba(255,255,255,0.24); }
.lb-arrow.prev { left: 18px; }
.lb-arrow.next { right: 18px; }
@media (max-width: 700px) { .lb-arrow { display: none; } }

body.lb-lock { overflow: hidden; }

/* ============================================================
   Dark-mode showroom + CSS environment for alpha cut-out video
   ============================================================ */
body.showroom-dark { background: #000; color: #f2efe9; }
body.showroom-dark .panel { background: #000; }
body.showroom-dark .panel-head .price-block .label { color: #8e8e93; }
body.showroom-dark .panel-head .price-block .price { color: #fff; }
body.showroom-dark .keyfact { background: #0f0f11; }
body.showroom-dark .keyfact .k { color: #8e8e93; }
body.showroom-dark .keyfact .v { color: #f2efe9; }
body.showroom-dark .spec-panel h4 { color: #8e8e93; border-bottom-color: rgba(255,255,255,0.10); }
body.showroom-dark .spec-panel li { color: #c9c6bf; }
body.showroom-dark .filmstrip-wrap h3 { color: #8e8e93; }
body.showroom-dark .btn-ghost { background: #17171a; color: #f2efe9; }
body.showroom-dark .btn-ghost:hover { background: #202024; }
body.showroom-dark .btn-wa { background: #17171a; color: #f2efe9 !important; }
body.showroom-dark .btn-gold { background: var(--gold-brand); color: #141414 !important; }
body.showroom-dark footer.site { background: #000; border-top-color: rgba(255,255,255,0.10); }
body.showroom-dark .legal, body.showroom-dark .legal a { color: #6e6e73; }

/* CSS showroom environment — brand-owned, identical for every car.
   Full-bleed through the hero, dissolving to page black at the bottom. */
.show-hero .env {
  position: absolute; inset: 0;
  background:
    /* overhead spotlight cone */
    radial-gradient(ellipse 34% 60% at 50% 0%, rgba(255,244,214,0.13), transparent 68%),
    radial-gradient(ellipse 56% 40% at 50% 14%, rgba(201,162,75,0.14), transparent 64%),
    /* light pool on the floor where the car stops */
    radial-gradient(ellipse 46% 16% at 50% 76%, rgba(201,162,75,0.14), transparent 72%),
    radial-gradient(ellipse 120% 80% at 50% 40%, #121215 0%, #000 82%);
}
/* floor line + reflection glow under the car */
.show-hero .env::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: 14%;
  height: 1px; background: linear-gradient(90deg, transparent, rgba(201,162,75,0.25), transparent);
}
.show-hero .media video.cutout {
  position: relative; z-index: 1;
  object-fit: contain; object-position: center 62%;
  transform: scale(0.86);
  transform-origin: 50% 62%;
  filter: drop-shadow(0 22px 34px rgba(0,0,0,0.55));
}

/* ---------- Filmstrip arrows (scrollbar hidden) ---------- */
.filmstrip { scrollbar-width: none; }
.filmstrip::-webkit-scrollbar { display: none; }
.filmstrip-wrap { position: relative; }
.fs-arrow {
  position: absolute; top: 50%; transform: translateY(-8%);
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.08); color: #fff; font-size: 1.1rem;
  transition: background 0.25s var(--ease), opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 2;
}
.fs-arrow:hover { background: rgba(255,255,255,0.18); }
.fs-arrow:active { transform: translateY(-8%) scale(0.92); }
.fs-arrow.prev { left: -56px; }
.fs-arrow.next { right: -56px; }
.fs-arrow[disabled] { opacity: 0.25; cursor: default; }
@media (max-width: 1180px) { .fs-arrow.prev { left: -8px; } .fs-arrow.next { right: -8px; } }
@media (max-width: 700px) { .fs-arrow { display: none; } } /* touch scroll on mobile */

/* ---------- Hero extends to viewport top; nav floats over it ---------- */
body.showroom-dark .floatbar {
  position: fixed; top: 10px; left: 0; right: 0; margin: 0 auto;
}
body.showroom-dark .show-hero {
  height: min(92vh, 960px);
}
@media (max-width: 700px) {
  body.showroom-dark .show-hero { height: 74vh; min-height: 420px; }
}

/* dark-mode full footer */
body.showroom-dark footer.site { color: #8e8e93; }
body.showroom-dark footer.site h4 { color: #f2efe9; }
body.showroom-dark footer.site a { color: #8e8e93; }
body.showroom-dark footer.site a:hover { color: #f2efe9; }

/* Floating mobile call bar: nav-bar dark, gold primary */
body.showroom-dark .callbar {
  background: rgba(0,0,0,0.78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}
body.showroom-dark .callbar .c { background: var(--gold-brand); color: #141414; }
body.showroom-dark .callbar .w { background: #17171a; color: #f2efe9; }

/* ---------- Mobile: full-viewport hero, titling just below halfway ---------- */
@media (max-width: 700px) {
  body.showroom-dark .show-hero {
    height: 100vh;   /* fallback */
    height: 100dvh;
    min-height: 560px;
  }
  body.showroom-dark .show-hero .titling {
    bottom: auto;
    top: 74%; /* sits under the car in the portrait cut */
  }
  body.showroom-dark .show-hero::after {
    background: linear-gradient(to bottom,
      #000 0%, transparent 20%,
      transparent 46%,
      rgba(0,0,0,0.72) 72%, #000 100%);
  }
}

/* entrance veil — fade in from black on arrival */
.page-veil {
  position: fixed; inset: 0; background: #000; z-index: 998;
  opacity: 1; transition: opacity 0.65s ease; pointer-events: none;
}
.page-veil.off { opacity: 0; }

/* ---------- Mobile enquire bar ---------- */
.enquirebar { display: none; }
@media (max-width: 700px) {
  body.showroom-dark .callbar { display: none; } /* replaced by enquire bar */
  .enquirebar {
    position: fixed; left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 60;
    display: grid;
    background: rgba(0,0,0,0.78);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border-radius: 22px;               /* matches the floating nav bar */
    padding: 10px 10px 10px 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    transform: translateY(130%); opacity: 0;
    transition: transform 0.45s var(--ease-out), opacity 0.45s var(--ease);
    pointer-events: none;
  }
  .enquirebar.on { transform: none; opacity: 1; pointer-events: auto; }
  .eb-main, .eb-actions {
    grid-area: 1 / 1;
    display: flex; align-items: center; gap: 12px;
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease-out);
  }
  .eb-actions { opacity: 0; transform: translateX(26px); pointer-events: none; }
  .enquirebar.expanded .eb-main { opacity: 0; transform: translateX(-26px); pointer-events: none; }
  .enquirebar.expanded .eb-actions { opacity: 1; transform: none; pointer-events: auto; }
  .enquirebar .td { width: 84px; height: 44px; object-fit: contain; flex: 0 0 auto; }
  .enquirebar .meta { flex: 1; min-width: 0; }
  .enquirebar .meta .t {
    color: #f2efe9; font-weight: 650; font-size: 0.85rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .enquirebar .meta .p { color: var(--gold-brand); font-weight: 700; font-size: 0.98rem; }
  .enquirebar .enq {
    background: var(--gold-brand); color: #141414;
    font-weight: 650; font-size: 0.92rem; font-family: inherit;
    padding: 12px 18px; border-radius: 980px; white-space: nowrap;
    flex: 0 0 auto; border: none; cursor: pointer;
  }
  .enquirebar .enq:active { transform: scale(0.96); }
  .eb-actions .ec, .eb-actions .ew {
    flex: 1; text-align: center; padding: 13px 0;
    border-radius: 980px; font-weight: 650; font-size: 0.95rem;
  }
  .eb-actions .ec { background: var(--gold-brand); color: #141414 !important; }
  .eb-actions .ew { background: #1da851; color: #fff !important; }
  .eb-actions .ec:active, .eb-actions .ew:active { transform: scale(0.96); }
  .eb-actions .eb-back {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
    background: #17171a; color: #f2efe9; border: none; cursor: pointer;
    font-size: 0.9rem;
  }
}

/* keyfacts: outlined transparent cards, stat icon bottom-right */
body.showroom-dark .keyfact {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  position: relative;
}
.keyfact .kicon {
  position: absolute; right: 13px; bottom: 12px;
  width: 18px; height: 18px; display: block;
  color: #fff;
}
.keyfact .kicon svg {
  width: 18px; height: 18px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.keyfact .kicon .sw {
  display: block; width: 16px; height: 16px; margin: 1px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.4);
}

/* ---------- studio-render hero (no video for this car) ----------
   A composed render should sit still — a very slow push keeps it alive
   without the travel of the Ken Burns pan used on raw photography. */
.show-hero .media img.poster.studio {
  animation: studiopush 26s var(--ease) infinite alternate;
  transform-origin: 50% 55%;
}
@keyframes studiopush {
  from { transform: scale(1.01); }
  to   { transform: scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .show-hero .media img.poster.studio,
  .show-hero .media img.poster.kb { animation: none; }
}

/* ---------- sold treatment ---------- */
.show-hero .sold-flag {
  display: inline-block; margin-bottom: 12px;
  background: #fff; color: #111213;
  padding: 5px 15px; border-radius: 980px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em;
}
.sold-note {
  margin: -8px 0 30px; color: #8e8e93; font-size: 0.95rem; max-width: 52ch;
}
.enquirebar .sold-chip {
  display: inline-block; margin-right: 8px; vertical-align: 2px;
  background: rgba(255,255,255,0.14); color: #fff;
  padding: 2px 8px; border-radius: 980px;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em;
}

/* ---------- render labelling ----------
   A rendered frame must never pass as photography. The chip sits on the
   thumbnail and repeats full-size in the lightbox. */
.filmstrip .fs-item { position: relative; flex: 0 0 auto; display: block; }
.filmstrip .fs-item img { flex: none; }
.fs-tag {
  position: absolute; left: 7px; bottom: 7px; pointer-events: none;
  font-size: 0.55rem; letter-spacing: 0.13em; text-transform: uppercase;
  font-weight: 650; color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  padding: 3px 7px; border-radius: 980px;
}
.lb-slide { position: relative; }
.lb-tag {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 18px;
  font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.62);
  background: rgba(0,0,0,0.45); backdrop-filter: blur(8px);
  padding: 4px 12px; border-radius: 980px; pointer-events: none;
}

/* Cars with a showroom video get a purpose-shot 9:16 portrait cut, which is
   why their heroes fill a phone properly. studio-m.jpg gives the still cars the
   same composition (see scripts/make_mobile_hero_crops.py), so a still hero now
   behaves exactly like a video one - full-viewport, titling overlaid - and needs
   no height, stacking or titling overrides. Only the Ken Burns animation goes,
   because the crop is already composed. */
@media (max-width: 700px) {
  .show-hero.still .media img.poster.studio { animation: none; }
}

/* ---------- Three-up feature rows ----------
   Sits between the film strip and the spec list: the persuasive middle of the
   page, where the spec list is only the evidence. Rows alternate so the eye
   zig-zags down instead of scanning a column, and collapse to a single stack
   below 760px - the image always leads on mobile, because a header floating
   above a missing picture reads as a broken page. */
.feat-rows { padding: 34px 0 8px; }
/* This is a headline addressed to the buyer, not a section label, so it is
   sized like one. */
.feat-head {
  font-size: 1.7rem; font-weight: 700; letter-spacing: -0.022em;
  line-height: 1.18; margin-bottom: 28px; max-width: 30ch;
}
@media (max-width: 760px) { .feat-head { font-size: 1.35rem; margin-bottom: 22px; } }
.feat {
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: 34px; align-items: center; margin-bottom: 34px;
}
/* the zig-zag: even rows put the picture on the right. nth-of-TYPE, not
   nth-child - the heading is a sibling, and counting it flips every row the
   moment anything above the articles changes. */
.feat:nth-of-type(even) .feat-img { order: 2; }
.feat-img {
  border-radius: 14px; overflow: hidden; background: #0f0f11;
  aspect-ratio: 16 / 9;
}
.feat-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s var(--ease-out);
}
.feat:hover .feat-img img { transform: scale(1.03); }
.feat-n {
  display: block; font-family: "Barlow Condensed", sans-serif;
  font-size: 0.8rem; letter-spacing: 0.18em; font-weight: 600;
  color: var(--gold-brand); margin-bottom: 8px;
}
.feat-copy h3 {
  font-size: 1.16rem; font-weight: 700; letter-spacing: -0.015em;
  line-height: 1.28; margin-bottom: 9px;
}
.feat-copy p { font-size: 0.94rem; line-height: 1.62; color: var(--ink-soft); }

@media (max-width: 760px) {
  .feat { grid-template-columns: 1fr; gap: 16px; margin-bottom: 38px; }
  .feat:nth-of-type(even) .feat-img { order: 0; }   /* picture first, always */
  .feat-copy h3 { font-size: 1.08rem; }
}

body.showroom-dark .feat-head { color: #f2efe9; }
body.showroom-dark .feat-copy h3 { color: #f2efe9; }
body.showroom-dark .feat-copy p { color: #c9c6bf; }
