/* ============================================
   STYLEJEWELRYS — Layout & Responsive
   ============================================ */
.app {
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--navbar-h);
  height: 100vh;
  height: 100dvh;
  width: 100%;
}
/* ---------- Top Bar / Brand Signboard ---------- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: linear-gradient(180deg, #000 0%, #0D0B07 100%);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}
[data-theme="light"] .topbar {
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F3E9 100%);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--gold-sheen);
  background-size: 200% 100%;
  animation: sheen 8s linear infinite;
  opacity: .8;
}
/* Brand lockup */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-mark {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #0A0A0A;
  font-weight: 800;
  font-size: 15px;
  box-shadow: var(--glow-gold);
}
.brand-name {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-size: 9px;
  letter-spacing: .34em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 2px;
}
/* Top actions */
.top-actions { display: flex; align-items: center; gap: 8px; }
/* ---------- Main Stage ---------- */
.stage {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.viewport {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(201,162,39,.10) 0%, transparent 55%),
    var(--surface);
  display: grid;
  place-items: center;
}
/* ---------- Product Rail ---------- */
.rail {
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rail-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.rail-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-content: start;
}
/* ---------- Bottom Nav ---------- */
.navbar {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: linear-gradient(0deg, #000 0%, #0D0B07 100%);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 40;
}
[data-theme="light"] .navbar {
  background: linear-gradient(0deg, #FFFFFF 0%, #F7F3E9 100%);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--text-mute);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
  position: relative;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item[aria-selected="true"] { color: var(--gold); }
.nav-item[aria-selected="true"]::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 2px;
  background: var(--gold-gradient);
  border-radius: 0 0 3px 3px;
}
/* ---------- Views ---------- */
/* Each view is an absolutely-positioned layer inside .stage so that
   inactive views never affect grid sizing. */
.view {
  position: absolute;
  inset: 0;
  display: none;
  visibility: hidden;
  min-height: 0;
  overflow: hidden;
}
.view.is-active {
  display: grid;
  visibility: visible;
  height: 100%;
}
/* Fitting view uses the two-column stage grid */
.view[data-view="fitting"].is-active {
  grid-template-columns: 1fr var(--rail-w);
}
/* Other views are single-column full-bleed panels */
.view[data-view="ar"].is-active,
.view[data-view="style"].is-active,
.view[data-view="profile"].is-active {
  grid-template-columns: 1fr;
}
/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --rail-w: 250px; }
  .brand-name { font-size: 16px; }
}
@media (max-width: 768px) {
  .app { grid-template-rows: var(--topbar-h) 1fr var(--navbar-h); }
  .view[data-view="fitting"].is-active {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .rail {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 34vh;
  }
  .rail-body {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 118px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }
  .rail-body > * { scroll-snap-align: start; }
  .brand-name { font-size: 15px; letter-spacing: .12em; }
  .brand-sub { letter-spacing: .26em; }
}
@media (max-width: 380px) {
  .brand-name { font-size: 13px; }
  .brand-mark { width: 28px; height: 28px; flex-basis: 28px; font-size: 13px; }
}