:root,
html[data-theme="light"] {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e5e7eb;
  --chip: #f3f4f6;
  --accent: #2563eb;
  --radius: 14px;
  --input: #ffffff;
  --hover: #f3f4f6;
  --thumb-bg: rgba(255, 255, 255, 0.9);
}
html[data-theme="dark"] {
  --bg: #0f1115;
  --panel: #171a21;
  --ink: #f3f4f6;
  --muted: #9ca3af;
  --line: #2a2f3a;
  --chip: #232833;
  --accent: #60a5fa;
  --input: #12151c;
  --hover: #222733;
  --thumb-bg: rgba(23, 26, 33, 0.92);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.app-body {
  font-family: Inter, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
html[dir="rtl"] body.app-body {
  font-family: Cairo, Inter, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.pref-switches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.seg {
  display: flex;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.seg button.on {
  background: var(--ink);
  color: var(--bg);
}
.side-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
}
.side-tabs button {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.side-tabs button.on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.sku-list[hidden] { display: none !important; }
.thumbs,
.viz-bottom,
.viz-toolbar {
  pointer-events: auto;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  cursor: pointer;
  z-index: 6;
}
html[data-theme="dark"] .gallery-nav {
  background: rgba(23, 26, 33, 0.92);
  color: #f3f4f6;
}
.gallery-nav.prev { left: 16px; }
.gallery-nav.next { right: 16px; }
html[dir="rtl"] .gallery-nav.prev { left: auto; right: 16px; }
html[dir="rtl"] .gallery-nav.next { right: auto; left: 16px; }
.viz-toolbar { z-index: 4; }
.viz-bottom { z-index: 5; }

.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 8px;
  background: var(--bg);
  flex-wrap: wrap;
}
.mode-tabs { display: flex; gap: 18px; align-items: center; }
.mode-tab {
  border: 0;
  background: none;
  color: #9ca3af;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
}
.mode-tab.active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.search-wrap {
  position: relative;
  width: min(420px, 46vw);
}
.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 12px 9px 34px;
  outline: none;
}
.search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 13px;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 18px 14px;
  scrollbar-width: none;
}
html[dir="rtl"] .search-wrap input,
html[dir="rtl"] .side-search input { padding-left: 12px; padding-right: 34px; }
html[dir="rtl"] .search-wrap i,
html[dir="rtl"] .side-search i { left: auto; right: 12px; }
html[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid var(--line); }
html[dir="rtl"] .sku { text-align: right; }
html[dir="rtl"] th, html[dir="rtl"] td { text-align: right; }
html[dir="rtl"] .viz-toolbar .fa-arrow-left { transform: scaleX(-1); }
.filter-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.filter-btn.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.app-main { padding: 0 16px 32px; }
.mosaic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.scene {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
  aspect-ratio: 1 / 1;
}
.scene img,
.scene .scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #e5e7eb center/cover no-repeat;
}
.scene-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent, rgba(17, 24, 39, 0.78));
  color: #fff;
  border-radius: 0;
  padding: 28px 12px 12px;
  font-size: 14px;
  font-weight: 600;
  opacity: 1;
}

.coming-soon {
  min-height: 48vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}
.coming-soon strong {
  color: var(--ink);
  font-size: 32px;
  font-weight: 700;
}

.viz-root {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: 100vh;
  background: var(--bg);
  isolation: isolate;
}
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100vh;
  position: relative;
  z-index: 20;
  pointer-events: auto;
}
.brand-block {
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.brand-block strong { display: block; font-size: 15px; }
.brand-block span { color: var(--muted); font-size: 12px; }
.surface-toggle {
  display: flex;
  gap: 8px;
  padding: 12px 16px 8px;
}
.surface-toggle button {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.surface-toggle button.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.side-search {
  margin: 0 16px 10px;
  position: relative;
}
.side-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px 8px 32px;
}
.side-search i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 12px;
}
.sku-list {
  overflow: auto;
  padding: 0 10px 16px;
  flex: 1;
}
.sku {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
  background: none;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.sku img,
.sku span {
  pointer-events: none;
}
.sku.active, .sku:hover { background: var(--hover); }
.sku.active { border-color: var(--line); }
.sku img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #e5e7eb;
}
.sku b { display: block; font-size: 12px; }
.sku small { color: var(--muted); font-size: 11px; line-height: 1.35; }

.stage {
  min-width: 0;
  height: 100vh;
  overflow: auto;
}
.viz-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
}
.hero-screen {
  position: relative;
  height: 100vh;
  min-height: 100vh;
}
.hero-wrap {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: #e5e7eb;
  transform: translateZ(0);
}
.hero-layer,
.hero-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0) scale(1.03);
  will-change: opacity, transform;
  animation: heroKen 40s linear infinite alternate;
  transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.hero-layer.is-front,
.hero-wrap img.is-front {
  opacity: 1;
  z-index: 1;
}
@keyframes heroKen {
  0% { transform: translate3d(0, 0, 0) scale(1.02); }
  100% { transform: translate3d(-1.1%, -0.7%, 0) scale(1.08); }
}
.viz-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.viz-bottom .meta {
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}
.viz-bottom .meta span { color: #d1d5db; }
.thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 60%;
  padding: 8px;
  background: var(--thumb-bg);
  border-radius: 12px;
}
.detail-drawer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 28px 24px 48px;
  max-height: none;
  overflow: visible;
}
.detail-drawer .desc {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}
.viz-toolbar a, .viz-toolbar button, .viz-actions a, .viz-actions button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.viz-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.viz-bottom .meta b { display: block; font-size: 13px; }
.thumbs img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: .7;
  flex: 0 0 auto;
}
.thumbs img.active { opacity: 1; border-color: #111827; }
.detail-drawer h3 { margin: 0 0 8px; font-size: 18px; }
.specs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.specs span {
  background: var(--chip);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }

body.coming-body {
  height: auto;
  overflow: auto;
  background: #111;
}
html[data-theme="dark"] .coming-detail .stage,
html[data-theme="dark"] .coming-acc,
html[data-theme="dark"] .coming-acc summary,
html[data-theme="dark"] .view-tile-name,
html[data-theme="dark"] .view-tile-link,
html[data-theme="dark"] .sku,
html[data-theme="dark"] .sku b {
  color: #f8fafc;
}
html[data-theme="dark"] .coming-desc,
html[data-theme="dark"] .coming-acc ul,
html[data-theme="dark"] .range-swatch,
html[data-theme="dark"] .sku small,
html[data-theme="dark"] .coming-entry-title a,
html[data-theme="dark"] .entry-title span {
  color: #d1d5db;
}
.entry-title span {
  font-weight: 400;
  font-size: 0.72em;
  color: var(--muted);
  margin-inline-start: 8px;
}
.tile-stat-row {
  display: flex;
  gap: 16px;
  margin-bottom: 22px;
}
.tile-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px 18px;
  min-width: 110px;
}
.tile-stat strong { display: block; font-size: 22px; color: var(--ink); }
.tile-stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
a.view-tile { color: inherit; }
a.view-tile-swatch,
a.view-tile-link { text-decoration: none; color: inherit; }
.coming-detail .hero-screen,
.coming-detail .hero-wrap {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
}
.coming-page {
  min-height: 100vh;
  background: #111;
  color: #cfcfcf;
}
.coming-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: #0d0d0d;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 8;
}
.coming-back,
.coming-top-brand {
  color: #eee;
  text-decoration: none;
  font-size: 13px;
}
.coming-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 7px 12px;
}
.coming-top-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.coming-top-brand span { color: #888; font-size: 12px; }
.coming-hero {
  height: min(62vh, 640px);
  background: #000;
}
.coming-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.coming-entry-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 4;
}
.coming-entry-title h1.entry-title {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}
.coming-entry-title a {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.coming-body { padding: 28px 32px 64px; }
.range-colours {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  justify-content: flex-end;
}
.range-swatch {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  width: 64px;
  padding: 0;
  text-align: center;
  font: inherit;
}
.range-swatch img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
  background: var(--chip);
}
.range-swatch em {
  display: block;
  font-style: normal;
  font-size: 11px;
  margin-top: 6px;
}
.coming-desc {
  column-count: 2;
  column-gap: 40px;
  text-align: justify;
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 28px;
  color: var(--muted);
  unicode-bidi: isolate;
}
html[data-lang="ar"] .coming-desc,
html[data-lang="ar"] .detail-drawer .desc {
  direction: rtl;
}
.coming-split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 280px;
  gap: 20px;
  align-items: start;
}
.view-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.view-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 6px 6px 8px;
}
.view-tile-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: stretch;
  direction: ltr;
}
.view-tile-swatch {
  display: block;
  width: 120px;
  height: 120px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--chip);
}
.view-tile-swatch img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  display: block;
}
.view-tile-actions {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-inline-start: 1px solid var(--line);
}
.view-tile-link {
  flex: 1;
  width: 100%;
  background: var(--chip);
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: start;
}
.view-tile-link:last-child { border-bottom: 0; }
.view-tile-link:hover { background: var(--hover); }
.view-tile-name {
  display: block;
  margin-top: 8px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
}
.coming-spec-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 120px;
}
.coming-acc {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
}
.coming-acc summary {
  cursor: pointer;
  padding: 14px 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.coming-acc summary::-webkit-details-marker { display: none; }
.coming-acc summary::after {
  content: "▾";
  color: var(--muted);
}
.coming-acc[open] summary::after { content: "▴"; }
.coming-acc ul {
  margin: 0;
  padding: 0 16px 14px 32px;
  padding-inline: 32px 16px;
  padding-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.coming-gallery,
.coming-related { margin-top: 48px; }
.coming-gallery h2,
.coming-related h2 {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 16px;
}
.coming-g-grid {
  columns: 2;
  column-gap: 12px;
}
.coming-g-item {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0 0 12px;
  background: var(--panel);
  cursor: pointer;
  break-inside: avoid;
}
.coming-g-item img {
  width: 100%;
  display: block;
  object-fit: cover;
}
.coming-related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.coming-related-card {
  display: block;
  background: var(--panel);
  color: inherit;
  border: 1px solid var(--line);
}
.coming-related-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}
.coming-related-card span {
  display: block;
  padding: 8px 10px 12px;
  font-size: 13px;
}
.tile-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile-lightbox[hidden] { display: none !important; }
.tile-lightbox img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
}
.tile-lightbox-close {
  position: absolute;
  top: 16px;
  right: 22px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}
html[dir="rtl"] .tile-lightbox-close { right: auto; left: 22px; }
html[dir="rtl"] .coming-entry-title h1.entry-title,
html[dir="rtl"] .coming-page { font-family: Cairo, Inter, sans-serif; }
html[dir="rtl"] .coming-top .pref-switches { margin-right: auto; margin-left: 0; }

@media (max-width: 980px) {
  .mosaic { grid-template-columns: repeat(2, 1fr); }
  .viz-root { grid-template-columns: 1fr; height: auto; }
  .sidebar { height: auto; max-height: 40vh; position: static; }
  .stage { height: auto; }
  .hero-screen, .hero-wrap { height: 100vh; }
  .coming-desc { column-count: 1; }
  .coming-split { grid-template-columns: 1fr; }
  .view-tiles { grid-template-columns: 1fr; }
  .coming-g-grid { columns: 1; }
  .coming-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coming-spec-col { position: static; }
}
