/* ═══════════════════════════════════════════════════════════
   Studio 6 V1 — Global Design System
   Shared by all designer and customer screens.
   ═══════════════════════════════════════════════════════════ */

/* ── FONTS ─────────────────────────────────────────────────── */
@font-face { font-display: swap; font-family: Graphik; font-style: normal; font-weight: 400; src: url("https://static.havenly.com/fonts/graphik/Graphik-Regular-Web.woff2") format("woff2"); }
@font-face { font-display: swap; font-family: Graphik; font-style: normal; font-weight: 500; src: url("https://static.havenly.com/fonts/graphik/Graphik-Medium-Web.woff2") format("woff2"); }
@font-face { font-display: swap; font-family: Graphik; font-style: normal; font-weight: 600; src: url("https://static.havenly.com/fonts/graphik/Graphik-Semibold-Web.woff2") format("woff2"); }
@font-face { font-display: swap; font-family: Simula; font-style: normal; font-weight: 400; src: url("https://static.havenly.com/fonts/simula/Simula-Book.woff2") format("woff2"); }

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Surfaces */
  --base-100: #FFFFFF;
  --base-200: #F3F0EB;
  --base-300: #DDDDDD;
  --canvas-bg: #EDE8E0;
  --sidebar-bg: #FAF9F7;

  /* Text */
  --base-content: #362B24;
  --text-secondary: #8E8268;
  --text-muted: #999999;
  --text-dark: #5C5C5C;

  /* Brand / interactive */
  --primary: #CD8F52;
  --primary-hover: #906136;
  --sage: #6B8F5E;
  --live: #49C944;
  --alert: #C25944;
  --coral: #ED6B4D;

  /* Aliases kept for backward compat */
  --secondary-text: #8E8268;
  --muted: #999999;
  --online: #49C944;
  --terra: #B8734A;

  /* Spec-referenced tokens (S6 V1 Updated specs) */
  --gold: #C99A2E;
  --primary-10: oklch(95% 0.03 45);
  --surface: #F3F0EB;
  --border: #DDDDDD;
  --annotation-shadow: 0 8px 40px rgba(54, 43, 36, 0.12);
  --modal-backdrop: rgba(0, 0, 0, 0.4);
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: Graphik, system-ui, sans-serif;
  color: var(--base-content);
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBARS ────────────────────────────────────────────── */
.scrollable::-webkit-scrollbar { width: 3px; }
.scrollable::-webkit-scrollbar-thumb { background: var(--base-300); border-radius: 2px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  height: 36px;
  border-radius: 9999px;
  font-family: Graphik, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 16px;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.82; }
.btn-solid { background: var(--primary); color: var(--base-content); }
.btn-outlined { background: transparent; border: 1.5px solid var(--base-content); color: var(--base-content); }
.btn-reject { background: transparent; border: 1.5px solid var(--base-300); color: var(--text-secondary); }
.btn-destructive { background: var(--alert); color: white; border-radius: 8px; font-size: 12px; font-weight: 400; height: 34px; }
.btn-cta {
  height: 40px;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--base-content);
  font-family: Graphik, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.btn-cta:hover { background: var(--primary-hover); }

/* ── BADGES ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  line-height: 16px;
  white-space: nowrap;
}
.badge-coral { background: var(--coral); color: white; }
.badge-muted { background: var(--text-secondary); color: white; }
.badge-sale {
  background: #FAF3F2;
  color: var(--alert);
  font-size: 10px;
  font-weight: 400;
  border-radius: 2px;
  padding: 2px 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--base-100);
  border: 1px solid var(--base-300);
  border-radius: 4px;
  padding: 16px;
  transition: border-color 0.15s;
}
.card.is-selected { border-color: var(--primary); }

/* ── ROWS ──────────────────────────────────────────────────── */
.row {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 6px 8px;
  gap: 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.row:hover { background: var(--base-200); }
.row.is-selected { background: var(--base-200); }

/* ── NAV ITEM (side nav) ───────────────────────────────────── */
.nav-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 0 6px;
  cursor: pointer;
  position: relative;
  color: var(--text-muted);
  transition: background 0.12s;
}
.nav-item:hover,
.nav-item.active { background: var(--base-200); color: var(--base-content); }
.nav-item svg { width: 22px; height: 22px; }
.nav-label { font-size: 9px; color: var(--text-dark); }
.nav-badge {
  position: absolute;
  top: 6px; right: 8px;
  min-width: 16px; height: 16px;
  background: var(--coral);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ── HAVENLY LOGO MARK ─────────────────────────────────────── */
.h-logo {
  width: 38px;
  height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.h-logo svg { width: 38px; height: 43px; }

/* ── TAB PILL SWITCHER (Studio6 top nav) ───────────────────── */
.tab-switcher {
  display: flex;
  align-items: center;
  background: #EEE;
  border-radius: 42px;
  padding: 5px 6px;
  gap: 0;
}
.tab-switcher-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  width: 92px;
  border-radius: 34px;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  transition: background 0.12s;
  font-family: Graphik, sans-serif;
  font-weight: 400;
  white-space: nowrap;
}
.tab-switcher-item.active {
  background: white;
  color: var(--base-content);
  font-weight: 500;
}
.tab-switcher-item:hover:not(.active) { color: var(--base-content); }

/* ── USER AVATAR ───────────────────────────────────────────── */
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--base-content);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* ── CANVAS SIDEBAR ROW ────────────────────────────────────── */
.canvas-sidebar-card {
  background: white;
  border-radius: 8px;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.canvas-sidebar-card:hover { background: var(--base-200); }

.canvas-thumb-rect {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: var(--canvas-bg);
  flex-shrink: 0;
}

.canvas-sidebar-info { flex: 1; min-width: 0; }
.canvas-sidebar-name { font-size: 13px; font-weight: 600; color: var(--base-content); }
.canvas-sidebar-sub { font-size: 11px; color: var(--text-muted); }

/* ── RECOMMENDED ROW ───────────────────────────────────────── */
.rec-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}
.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rec-info { flex: 1; min-width: 0; }
.rec-name { font-size: 13px; font-weight: 600; color: var(--base-content); }
.rec-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── PRODUCT CARD (2-col grid, Figma style) ────────────────── */
.product-card-grid {
  position: relative;
  background: var(--base-200);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.product-card-grid:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }

.product-card-img {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  position: relative;
  background: var(--base-200);
}

.product-card-like {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.product-card-add-circle {
  position: absolute;
  bottom: 6px; left: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--base-100);
  border: 1px solid var(--base-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  font-weight: 400;
  line-height: 1;
}
.product-card-add-circle:hover { background: var(--primary); color: white; border-color: var(--primary); }
.product-card-add-circle.added { background: var(--base-content); color: white; border-color: var(--base-content); font-size: 11px; }

.product-card-sale {
  position: absolute;
  bottom: 6px; left: 6px;
  background: #FAF3F2;
  color: var(--alert);
  font-size: 9px;
  font-weight: 400;
  border-radius: 2px;
  padding: 2px 5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  pointer-events: none;
}

.product-card-body { padding: 6px 6px 8px; }
.product-card-brand { font-size: 12px; font-weight: 500; color: var(--base-content); text-transform: capitalize; }
.product-card-name { font-size: 12px; color: var(--base-content); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card-price { font-size: 13px; font-weight: 500; color: var(--base-content); margin-top: 4px; }
.product-card-price-strike { font-size: 12px; color: var(--text-muted); text-decoration: line-through; }

/* ── TAB TOGGLE (Products / Clips / Search) ────────────────── */
.panel-tab-toggle {
  display: flex;
  border: 1px solid var(--base-300);
  border-radius: 6px;
  overflow: hidden;
}
.panel-tab {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: #998E84;
  background: #EEE;
  cursor: pointer;
  border: none;
  font-family: Graphik, sans-serif;
  transition: background 0.12s, color 0.12s;
}
.panel-tab.active { background: white; color: var(--base-content); font-weight: 600; }
.panel-tab:hover:not(.active) { background: rgba(0,0,0,0.04); color: var(--base-content); }

/* ── MEETING BAR (bottom of canvas) ───────────────────────── */
.meeting-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-radius: 5px;
  padding: 4px 16px;
  gap: 8px;
}
.meeting-bar-left { display: flex; align-items: center; gap: 8px; }
.meeting-bar-divider { width: 1px; height: 14px; background: var(--base-300); flex-shrink: 0; }
.meeting-bar-comments {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 7px;
  border-radius: 3px;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  transition: color 0.12s;
}
.meeting-bar-comments:hover { color: var(--base-content); }

/* ── STACKED AVATARS ────────────────────────────────────────── */
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .av {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: Graphik, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: white;
  border: 2px solid white;
  flex-shrink: 0;
}
.avatar-stack .av + .av { margin-left: -8px; }

/* ── LIVE SESSION BANNER ────────────────────────────────────── */
.live-session-banner {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 25px;
  min-width: 268px;
  background: var(--live);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  z-index: 20;
  pointer-events: none;
}
.live-session-banner span {
  font-family: Graphik, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: white;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── ZOOM WIDGET ────────────────────────────────────────────── */
.zoom-widget {
  position: absolute;
  top: 9px; right: 18px;
  background: white;
  border-radius: 8px;
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: Inter, Graphik, sans-serif;
  font-size: 12px;
  color: #998E84;
  z-index: 20;
  height: 37px;
  width: 87px;
  justify-content: center;
}
.zoom-widget button {
  background: none;
  border: none;
  cursor: pointer;
  color: #998E84;
  font-size: 14px;
  font-family: inherit;
  line-height: 1;
  padding: 0;
}
.zoom-widget button:hover { color: var(--base-content); }

/* ── UNDO/REDO TOOLBAR ──────────────────────────────────────── */
.canvas-toolbar {
  position: absolute;
  top: 10px; left: 18px;
  background: white;
  border-radius: 5px;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 20;
}
.toolbar-btn {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  border-radius: 3px;
  transition: background 0.1s;
}
.toolbar-btn:hover { background: var(--base-200); }

/* ── SECTION LABEL (sidebar) ────────────────────────────────── */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 10px 16px 6px;
}

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes liveBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.fade-in { animation: fadeIn 0.3s ease; }
.slide-in { animation: slideIn 0.25s ease; }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}
