/* ============================================================
   BMW Exhibit Collection — styling
   Design language aligned to the BMW.de shop:
   rectangular geometry, 700/300 type contrast, single blue CTA,
   color-block depth (no drop shadows).
   ============================================================ */

/* ---------- Brand typeface: BMW Type Next Pro ----------
   Self-hosted .otf in /fonts. Missing files fall back to Inter / system.
   Full weight set provided; UI weight 600 maps to Bold automatically. */
@font-face {
  font-family: "BMW Type Next";
  src: url("fonts/BMWTypeNextPro-Thin.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "BMW Type Next";
  src: url("fonts/BMWTypeNextPro-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "BMW Type Next";
  src: url("fonts/BMWTypeNextPro-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "BMW Type Next";
  src: url("fonts/BMWTypeNextPro-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "BMW Type Next";
  src: url("fonts/BMWTypeNextPro-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* surfaces */
  --bg: #ffffff;
  --panel: #f7f7f7;        /* surface soft */
  --panel-2: #fafafa;      /* card photo plate */
  --divider: #ebebeb;
  --dark: #1a2129;         /* hero / dark band */
  /* text */
  --text: #262626;         /* ink */
  --body: #3c3c3c;
  --muted: #6b6b6b;
  --muted-2: #9a9a9a;
  /* lines */
  --line: #e6e6e6;         /* hairline */
  --line-2: #cccccc;       /* hairline strong */
  /* brand */
  --blue: #1c69d4;
  --blue-dark: #0653b6;
  --blue-soft: #e8f0fc;
  --success: #1f7a34;
  /* BMW geometry: rectangular everything */
  --radius: 0px;
  --radius-sm: 0px;
  --font: "BMW Type Next", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--divider);   /* depth from color-block contrast, not shadow */
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- App shell ---------- */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--bg);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--divider);
}
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
body:not(.editing) .brand { cursor: pointer; }
.brand svg { flex: none; }
.brand-logo { flex: none; display: block; width: auto; height: 40px; }
/* BMW Group co-branding lockup: wordmark │ page title */
.brand-divider { flex: none; width: 1px; height: 38px; background: var(--line-2); }
/* BMW Group signature headline: uppercase, bold, near-black.
   Caps are presentational so the editable text stays clean. */
.brand-title { font-size: 22px; font-weight: 700; letter-spacing: 0; line-height: 1.1; color: #111111; text-transform: uppercase; }
.brand-sub { color: #6f6f6f; font-size: 12.5px; font-weight: 300; margin-top: 4px; text-transform: none; }
.topbar-spacer { flex: 1; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* "Edit content" button is hidden until revealed with ⌘E / Ctrl+E */
#edit-btn { display: none; }
body.show-edit #edit-btn { display: inline-flex; }

/* BMW buttons: rectangular, uppercase 700, blue single CTA */
.btn {
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--text);
  border-radius: 0;
  padding: 11px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel); }
.btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn .dot { width: 7px; height: 7px; border-radius: 50%; background: #34c759; }

.basket-btn { position: relative; }
.basket-count {                 /* count badge stays circular */
  position: absolute;
  top: -7px; right: -7px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* edit-mode banner */
.edit-banner {
  display: none;
  background: #fff7e6;
  border-bottom: 1px solid #f0dcae;
  color: #7a5b13;
  font-size: 12.5px;
  padding: 10px 28px;
}
body.editing .edit-banner { display: block; }

/* ---------- Listing layout ---------- */
.listing { display: grid; grid-template-columns: 256px 1fr; }

/* Sidebar filters */
.sidebar {
  border-right: 1px solid var(--divider);
  padding: 22px 20px 48px;
  background: var(--bg);
}
.search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 11px 14px;
  margin-bottom: 20px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--text); }
.search input {
  border: 0; outline: 0; width: 100%;
  font-family: inherit; font-size: 13px; color: var(--text);
  background: transparent;
}
.filter-clear {
  font-size: 11px; color: var(--text); border: 0; background: none;
  text-transform: uppercase; font-weight: 700; letter-spacing: 1px;
  padding: 0; margin: 2px 0 16px; display: none;
}
body.has-filters .filter-clear { display: inline; }

/* sidebar section labels: "Find by need" / "Production details" */
.filter-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--blue); margin: 2px 0 8px;
}
.filter-section-label.divider {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--divider); color: var(--muted);
}
.fgroup-hint { font-size: 11px; color: var(--muted-2); font-weight: 300; margin-bottom: 8px; width: 100%; }

.fgroup { border-top: 1px solid var(--line); padding: 14px 0; }
.fgroup:first-of-type { border-top: 0; }
.fgroup-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: .8px;
  cursor: pointer; user-select: none;
}
.fgroup-head .chev { color: var(--muted-2); transition: transform .15s; }
.fgroup.collapsed .chev { transform: rotate(-90deg); }
.fgroup-body { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fgroup.collapsed .fgroup-body { display: none; }

/* tags: rectangular, corporate dialect */
.tag {
  font-size: 11.5px;
  font-weight: 400;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--body);
  border-radius: 0;
  padding: 5px 10px;
  line-height: 1.3;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.tag.clickable { cursor: pointer; }
.tag.clickable:hover { border-color: var(--blue); color: var(--blue); }
.tag.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.tag.readonly { cursor: default; }

/* Content area */
.content { padding: 24px 28px 48px; background: var(--bg); min-height: 60vh; }

.section { margin-bottom: 36px; }
.section-head {
  font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: 0;
  padding-bottom: 14px; margin-bottom: 4px;
}
.section-head .count { color: var(--muted-2); font-weight: 400; }
.section-empty {
  color: var(--muted-2); font-size: 13px; font-weight: 300; padding: 8px 2px 4px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* cards: flat, rectangular, depth via plate color on hover */
.card {
  border: 1px solid transparent;
  border-radius: 0;
  padding: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.card:hover { border-color: var(--line); background: var(--panel-2); }
.card.selected { border-color: var(--line-2); }

.card-media { display: flex; gap: 8px; }
.card-hero { position: relative; }
/* Scale card height to the viewport so a row always overflows a little and the
   next section peeks in — signalling the page continues. Clamped for sanity. */
.card-hero .tile { aspect-ratio: auto; height: clamp(240px, 38vh, 480px); }
.tile {
  position: relative;
  flex: 1;
  aspect-ratio: 3 / 4.1;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 12px;
  color: #fff;
}
.tile.light { color: #1a1a1a; }
.tile .kicker { position: relative; z-index: 2; font-size: 8.5px; letter-spacing: .14em; font-weight: 700; opacity: .9; text-transform: uppercase; }
.tile .ttl { position: relative; z-index: 2; font-size: 15px; font-weight: 700; line-height: 1.1; margin-top: 3px; letter-spacing: 0; }
.tile .car-silhouette { position: absolute; z-index: 2; left: 0; right: 0; bottom: 8px; opacity: .9; }

/* real image dropped into /images — covers the gradient fallback */
.tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.tile.has-img .car-silhouette { display: none; }
.tile.has-img { color: #fff; }
.tile.has-img .kicker, .tile.has-img .ttl { text-shadow: 0 1px 10px rgba(0,0,0,.55); }
.tile.has-img::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 38%, rgba(0,0,0,0) 60%, rgba(0,0,0,.45) 100%);
}

.card-title { font-size: 16px; font-weight: 700; margin-top: 14px; letter-spacing: 0; }
.card-desc { color: var(--muted); font-size: 13px; font-weight: 300; margin-top: 5px; line-height: 1.5; }

/* play button on video tiles */
.play-badge {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
}
.play-badge .circle {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.22);
  border: 1.5px solid rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.video-label {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  font-size: 11px; color: #fff; font-weight: 400;
  display: flex; align-items: center; gap: 6px;
}

/* ============================================================
   Detail page
   ============================================================ */
.detail { padding: 22px 28px 52px; }
.detail-top {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.icon-btn {                      /* icon buttons stay circular */
  border: 1px solid var(--line-2); background: #fff; border-radius: 50%;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.icon-btn:hover { background: var(--panel); }
.detail-top .crumb { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }

.detail-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; }

/* gallery */
.gallery-main { display: flex; align-items: center; gap: 12px; }
.gallery-stage { flex: 1; display: flex; gap: 12px; }
.gallery-stage .tile { aspect-ratio: 3 / 4.2; }
.gallery-nav {
  border: 1px solid var(--line-2); background: #fff; border-radius: 50%;
  width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.gallery-nav:hover { background: var(--panel); }
.gallery-nav:disabled { opacity: .35; cursor: default; }
.gallery-dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 16px; }
.gallery-dots .d { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.gallery-dots .d.on { background: var(--muted); }

.gallery-video {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  color: #fff;
  cursor: pointer;
  background-color: #000;
  display: block;
}
.gallery-video.has-img::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,0) 45%, rgba(0,0,0,.45) 100%);
}
video.gallery-video { cursor: default; object-fit: cover; }

/* photo gallery: large hero + thumbnail strip */
.gallery-hero {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  overflow: hidden; background-color: #000; border-radius: 0;
}
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb {
  position: relative; width: 88px; height: 62px; flex: none;
  border: 1px solid var(--line); padding: 0; overflow: hidden; cursor: pointer;
  background-size: cover; background-position: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { border-color: var(--blue); }
.thumb.on { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }

/* detail right column */
.detail-title { font-size: 32px; font-weight: 700; letter-spacing: 0; line-height: 1.05; color: #111111; text-transform: uppercase; }
.detail-desc { color: var(--body); margin-top: 10px; font-size: 15px; font-weight: 300; line-height: 1.55; max-width: 46ch; }

/* ---- detail page (redesigned: photo hero + full-width info + booking) ---- */
.detail-hero { margin-bottom: 4px; }
.detail-hero-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.detail-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--blue); margin-bottom: 8px; }
.detail-cta-top { flex: none; margin-top: 6px; }
.detail-lead { color: var(--body); font-weight: 300; font-size: 16px; line-height: 1.6; max-width: 72ch; margin: 16px 0 22px; }

.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-top: 40px; align-items: start; }
.dcol { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.dcol .detail-block { margin-top: 0; }

.booking { margin-top: 44px; background: var(--panel); padding: 28px 32px 30px; }
.booking > .block-head { margin-bottom: 16px; }
.booking-langs { margin-bottom: 20px; }
.booking-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; }
.booking-cta { display: flex; justify-content: flex-end; margin-top: 26px; }
.booking-cta .btn.primary { padding: 15px 44px; font-size: 13px; }

/* fictive cost estimator */
.cost-calc { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.cost-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 12px; }
.cost-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 7px 0; font-size: 13.5px; color: var(--body); }
.cost-label { font-weight: 400; }
.cost-detail { color: var(--muted-2); font-size: 12px; }
.cost-muted { color: var(--muted-2); font-weight: 400; }
.cost-val { font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text); }
.cost-total > span:first-child { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.cost-total .cost-val { font-weight: 700; font-size: 20px; }
.cost-note { margin-top: 12px; font-size: 11px; color: var(--muted-2); font-weight: 300; }

/* video thumbnail (play overlay) */
.thumb.video-thumb .thumb-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.thumb.video-thumb .thumb-play svg { filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }

.detail-block { margin-top: 26px; }
.block-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--muted); margin-bottom: 12px;
}
/* Tags: full-width, always-visible attribute grid (no collapse / layout shift) */
.detail-tags { margin-top: 40px; }
.detail-tags > .block-head { margin-bottom: 16px; }
.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px 28px; align-items: start; }
.tag-grid .tag-row { margin-bottom: 0; }
.tag-row { margin-bottom: 12px; }
.tag-row .tag-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; font-weight: 300; }
.tag-row .tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* specs table */
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.spec-item { background: #fff; padding: 11px 14px; }
/* odd item count: last cell spans full width so there's no empty grey cell */
.spec-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
.spec-item .k { font-size: 10px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.spec-item .v { font-size: 13px; font-weight: 400; margin-top: 3px; color: var(--text); }

.info-text { font-size: 13px; font-weight: 300; line-height: 1.6; color: var(--body); background: var(--panel); border-radius: 0; padding: 14px 16px; }

.lang-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.avail-note { font-size: 11.5px; color: var(--muted); font-weight: 300; margin-top: 8px; }
.avail-note b { color: var(--success); font-weight: 700; }

/* technical drawing */
.drawing-wrap {
  border: 1px solid var(--line);
  border-radius: 0;
  background:
    linear-gradient(transparent 95%, rgba(28,105,212,.06) 95%) 0 0 / 22px 22px,
    linear-gradient(90deg, transparent 95%, rgba(28,105,212,.06) 95%) 0 0 / 22px 22px,
    #f7faff;
  padding: 10px;
}
.drawing-wrap svg { display: block; width: 100%; height: auto; }

/* deployment form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; color: var(--muted); font-weight: 400; }
.field input, .field select {
  font-family: inherit; font-size: 13px; color: var(--text);
  border: 1px solid var(--line); border-radius: 0;
  padding: 11px 14px; background: #fff; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.date-pair { display: flex; align-items: center; gap: 8px; }
.date-pair span { font-size: 11px; color: var(--muted); }
.date-pair input { flex: 1; }

.add-row { margin-top: 26px; }
.add-row .btn.primary { width: 100%; justify-content: center; padding: 15px; font-size: 13px; }

/* ============================================================
   Basket drawer
   ============================================================ */
.scrim {
  position: fixed; inset: 0; background: rgba(26,33,41,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40;
}
body.basket-open .scrim { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 430px; max-width: 92vw;
  background: #fff; z-index: 50; border-left: 1px solid var(--line-2);
  transform: translateX(100%); transition: transform .24s ease;
  display: flex; flex-direction: column;
}
body.basket-open .drawer { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px; border-bottom: 1px solid var(--divider);
}
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-foot { border-top: 1px solid var(--divider); padding: 18px 20px; }
.drawer-foot .btn.primary { width: 100%; justify-content: center; padding: 14px; }

.basket-item {
  border: 1px solid var(--line); border-radius: 0;
  padding: 14px; margin-bottom: 12px;
}
.basket-item .bi-top { display: flex; justify-content: space-between; gap: 10px; }
.basket-item .bi-title { font-weight: 700; font-size: 14px; }
.basket-item .bi-meta { font-size: 12px; color: var(--muted); font-weight: 300; margin-top: 7px; line-height: 1.7; }
.basket-item .bi-meta b { color: var(--text); font-weight: 700; }
.basket-item .bi-langs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.bi-remove { border: 0; background: none; color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; padding: 2px; }
.bi-remove:hover { color: #dc2626; }

.empty-basket { color: var(--muted-2); text-align: center; padding: 48px 10px; font-size: 13px; font-weight: 300; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--dark); color: #fff; padding: 13px 20px; border-radius: 0;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* editable affordance */
body.editing [data-bind] {
  outline: 1px dashed rgba(28,105,212,.45);
  outline-offset: 2px;
  border-radius: 0;
  cursor: text;
}
body.editing [data-bind]:hover { background: rgba(28,105,212,.06); }
body.editing [data-bind]:focus { outline: 2px solid var(--blue); background: #fff; }

/* responsive */
@media (max-width: 900px) {
  .listing { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--divider); }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-cols { grid-template-columns: 1fr; gap: 28px; }
  .booking-grid { grid-template-columns: 1fr 1fr; }
  .booking { padding: 22px 18px 24px; }
  .detail-hero-bar { flex-direction: column; }
  .detail-cta-top { width: 100%; justify-content: center; }
  .detail-title { font-size: 26px; }
  .booking-cta .btn.primary { width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
}
