/* =========================================================
   Variant Review Bar — floating top bar with theme picker
   Theme-agnostic dark glass panel. Mobile-friendly scroll lock.
   ========================================================= */

.vbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--vbar-h, 48px);
  z-index: 200;
  background: rgba(15,15,15,0.92);
  backdrop-filter: saturate(150%) blur(18px);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  color: #F5F2EB;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: 'Inter', system-ui, sans-serif;
  transition: transform 0.4s var(--ease-out);
}
body.vbar-hidden .vbar { transform: translateY(-100%); }

.vbar-inner {
  height: 100%; max-width: var(--max);
  margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  font-size: 0.82rem;
}
.vbar-brand {
  display: flex; align-items: center; gap: 0.75rem;
  letter-spacing: 0.01em;
}
.vbar-brand strong { font-weight: 600; }
.vbar-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #D7E3A4;
  box-shadow: 0 0 12px rgba(215,227,164,0.6);
}
.vbar-count {
  font-size: 0.72rem; opacity: 0.55;
  margin-left: 0.4rem; padding-left: 0.75rem;
  border-left: 1px solid rgba(255,255,255,0.15);
  letter-spacing: 0.05em; text-transform: uppercase;
}

.vbar-picker { display: flex; align-items: center; gap: 0.25rem; }
.vbar-arrow {
  width: 32px; height: 32px;
  min-width: 32px; min-height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 1.1rem;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}
.vbar-arrow:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.vbar-current {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  font-size: 0.85rem; font-weight: 500;
  transition: background 0.2s;
  min-width: 240px; min-height: 36px;
  justify-content: space-between;
}
.vbar-current:hover { background: rgba(255,255,255,0.14); }
.vbar-chev { font-size: 0.7rem; opacity: 0.65; }

.vbar-actions { display: flex; gap: 0.5rem; }
.vbar-link {
  font-size: 0.78rem; opacity: 0.7;
  padding: 0.4rem 0.75rem; min-height: 32px;
  border-radius: 6px;
  transition: opacity 0.2s, background 0.2s;
}
.vbar-link:hover { opacity: 1; background: rgba(255,255,255,0.08); }

/* Dropdown menu — its own scroll, fixed-positioned */
.vbar-menu {
  position: fixed;
  top: var(--vbar-h, 48px); left: 0; right: 0;
  max-height: calc(100dvh - var(--vbar-h, 48px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: rgba(15,15,15,0.96);
  backdrop-filter: saturate(150%) blur(18px);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  animation: vbarDrop 0.25s var(--ease-out);
}
@keyframes vbarDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.vbar-menu[hidden] { display: none; }

body.vbar-menu-open { overflow: hidden; touch-action: none; }
body.vbar-menu-open .vbar-menu { touch-action: pan-y; }

.vbar-menu-inner { max-width: var(--max); margin: 0 auto; padding: 1.5rem var(--gutter) 2rem; }
.vbar-menu-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.22em;
  font-weight: 500; color: rgba(245,242,235,0.55);
  margin: 0 0 1rem;
}
.vbar-menu ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.5rem;
}
.vbar-menu li button {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.9rem 1rem; min-height: 60px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.vbar-menu li button:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}
.vbar-menu li button.is-active {
  background: rgba(215,227,164,0.14);
  border-color: rgba(215,227,164,0.4);
}
.vbar-swatch {
  width: 44px; height: 44px;
  border-radius: 8px; position: relative;
  overflow: hidden; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.08);
}
.vbar-swatch span { position: absolute; display: block; }
.vbar-swatch .sw-bg { inset: 0; }
.vbar-swatch .sw-accent { inset: 60% 0 0 0; }
.vbar-swatch .sw-dark { inset: 0 0 0 60%; }
.vbar-name { font-weight: 500; font-size: 0.92rem; display: block; }
.vbar-desc { font-size: 0.78rem; opacity: 0.6; display: block; margin-top: 0.15rem; }
.vbar-menu-hint {
  margin: 1.5rem 0 0; font-size: 0.72rem; opacity: 0.45;
  letter-spacing: 0.04em;
}
.vbar-menu-hint kbd {
  background: rgba(255,255,255,0.08);
  padding: 0.15rem 0.45rem; border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.7rem; margin: 0 0.1rem;
}

.vbar-restore {
  position: fixed; top: 12px; right: 12px; z-index: 200;
  background: rgba(15,15,15,0.85); color: #F5F2EB;
  padding: 0.5rem 0.95rem; border-radius: 999px;
  font-size: 0.78rem; font-family: 'Inter', system-ui, sans-serif;
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.3s, transform 0.3s;
  min-height: 36px;
}
.vbar-restore[hidden] { display: none; }
.vbar-restore:hover { background: rgba(15,15,15,0.95); }

.vbar-toast {
  position: fixed;
  top: calc(var(--vbar-h) + 12px);
  left: 50%; transform: translateX(-50%);
  background: rgba(15,15,15,0.95); color: #F5F2EB;
  padding: 0.65rem 1.2rem; border-radius: 8px;
  font-size: 0.85rem; font-family: 'Inter', system-ui, sans-serif;
  z-index: 250; border: 1px solid rgba(255,255,255,0.12);
  animation: toastIn 0.3s var(--ease-out);
  pointer-events: none;
}
.vbar-toast[hidden] { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 720px) {
  .vbar-inner { font-size: 0.75rem; }
  .vbar-count { display: none; }
  .vbar-actions .vbar-link:not(:last-child) { display: none; }
  .vbar-current {
    min-width: 0; max-width: 58vw;
    padding: 0.45rem 0.7rem; font-size: 0.78rem;
  }
  .vbar-current span[data-vbar-name] {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: inline-block; max-width: 100%;
  }
  .vbar-brand strong {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 90px; display: inline-block; vertical-align: middle;
  }
}
