/* ============================================================
   QSR Foods Platform — Premium B2B Horeca UI
   Shared design system
   ============================================================ */

:root {
  /* Brand greens */
  --green-900: #062E22;
  --green-800: #0B3D2E;
  --green-700: #124D3A;
  --green-600: #1A6349;

  /* Gold */
  --gold: #CFA85A;
  --gold-light: #E6C978;

  /* Neutrals */
  --cream: #F7F1E3;
  --white: #FFFFFF;
  --ink: #17231D;
  --muted: #6B7280;
  --border: #E5E0D2;

  /* States */
  --success: #16A34A;
  --warning: #D97706;
  --error: #DC2626;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(6, 46, 34, .06);
  --shadow: 0 6px 20px rgba(6, 46, 34, .08);
  --shadow-lg: 0 18px 50px rgba(6, 46, 34, .16);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 264px;
  --topbar-h: 76px;

  --font: 'Manrope', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--green-900) 0%, var(--green-800) 100%);
  color: #D8E5DE;
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid rgba(207,168,90,.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 22px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(207,168,90,.16);
}
.brand-mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  display: grid; place-items: center;
  color: var(--green-900);
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(207,168,90,.35);
  flex-shrink: 0;
}
.brand-text b { display: block; font-size: 17px; font-weight: 800; color: #fff; letter-spacing: .3px; }
.brand-text span { font-size: 10px; letter-spacing: 2px; color: var(--gold); text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.nav-label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #6E8479; padding: 14px 12px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  color: #BFD2C9;
  font-weight: 600; font-size: 14px;
  transition: all .18s ease;
  position: relative;
}
.nav a i { width: 20px; text-align: center; font-size: 15px; color: #8AA499; transition: color .18s; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a:hover i { color: var(--gold); }
.nav a.active {
  background: linear-gradient(90deg, rgba(207,168,90,.18), rgba(207,168,90,.04));
  color: #fff;
}
.nav a.active i { color: var(--gold); }
.nav a.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px; background: var(--gold);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px 4px;
  border-top: 1px solid rgba(207,168,90,.16);
  font-size: 12px; color: #6E8479;
}
.sidebar-footer b { color: var(--gold-light); font-weight: 700; }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  min-height: var(--topbar-h);
  background: rgba(247,241,227,.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top) 34px 0;   /* clear the iOS status bar / notch */
  position: sticky; top: 0; z-index: 30;
}
.topbar-title h1 { font-size: 21px; font-weight: 800; letter-spacing: -.2px; }
.topbar-title p { font-size: 13px; color: var(--muted); margin-top: 1px; }

.topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-actions { display: flex; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--white); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--green-700);
  position: relative; transition: all .15s;
}
.icon-btn:hover { border-color: var(--gold); color: var(--green-900); }
.icon-btn .dot {
  position: absolute; top: 9px; right: 10px; width: 8px; height: 8px;
  background: var(--error); border-radius: 50%; border: 2px solid var(--white);
}
.user-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--border);
  padding: 7px 14px 7px 9px; border-radius: 40px;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: var(--gold-light); display: grid; place-items: center;
  font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.user-meta b { display: block; font-size: 14px; font-weight: 700; line-height: 1.2; }
.user-meta span {
  font-size: 11px; color: var(--green-700); font-weight: 700;
  background: rgba(18,77,58,.08); padding: 1px 8px; border-radius: 20px;
}

.content { padding: 30px 34px 48px; max-width: 1480px; width: 100%; }

/* mobile menu */
.menu-toggle { display: none; }

/* ============================================================
   COMPONENTS
   ============================================================ */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 16px; flex-wrap: wrap;
}
.section-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.section-head .link { color: var(--green-700); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.section-head .link:hover { color: var(--gold); }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px 24px; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border-radius: 12px; font-weight: 700; font-size: 14px;
  transition: all .16s ease; white-space: nowrap;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--green-900); box-shadow: 0 8px 20px rgba(207,168,90,.3);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(207,168,90,.42); }
.btn-green { background: var(--green-800); color: #fff; }
.btn-green:hover { background: var(--green-700); }
.btn-ghost { background: var(--white); border: 1px solid var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green-700); color: var(--green-900); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- Stat cards ---------- */
.stat {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(207,168,90,.10), transparent 70%);
}
.stat .stat-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(18,77,58,.08); color: var(--green-700); font-size: 16px; margin-bottom: 14px;
}
.stat.gold .stat-icon { background: rgba(207,168,90,.16); color: #A9802F; }
.stat.warn .stat-icon { background: rgba(217,119,6,.12); color: var(--warning); }
.stat .stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .stat-value { font-size: 25px; font-weight: 800; margin-top: 4px; letter-spacing: -.5px; }
.stat .stat-sub { font-size: 12px; margin-top: 6px; font-weight: 600; }
.stat .up { color: var(--success); }
.stat .down { color: var(--error); }

/* ---------- Welcome hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 90% -20%, rgba(207,168,90,.22), transparent 60%),
    linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 60%, var(--green-700) 100%);
  border-radius: 22px;
  padding: 38px 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::before {
  content: ''; position: absolute; right: -60px; bottom: -90px;
  width: 320px; height: 320px; opacity: .07;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23fff' d='M50 5L90 27v46L50 95 10 73V27z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.hero .tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(207,168,90,.16); color: var(--gold-light);
  padding: 6px 14px; border-radius: 30px; font-size: 12px; font-weight: 700;
  letter-spacing: .5px; margin-bottom: 16px;
}
.hero h2 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.hero h2 span { color: var(--gold-light); }
.hero p { color: #BFD2C9; font-size: 15px; margin-top: 8px; max-width: 540px; }
.hero .hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
  text-align: left; font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 13px 16px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tbl td { padding: 15px 16px; border-bottom: 1px solid #F0EBDD; vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #FBF8F0; }
table.tbl td b { font-weight: 700; }
.cell-strong { font-weight: 700; color: var(--ink); }
.cell-mono { font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 30px; font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: rgba(22,163,74,.10); color: var(--success); }
.badge.gold { background: rgba(207,168,90,.16); color: #A9802F; }
.badge.amber { background: rgba(217,119,6,.12); color: var(--warning); }
.badge.red { background: rgba(220,38,38,.10); color: var(--error); }
.badge.gray { background: #EEF0EE; color: var(--muted); }
.badge.blue { background: rgba(18,77,58,.10); color: var(--green-700); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; background: #EFEADC; padding: 5px; border-radius: 12px; width: fit-content; flex-wrap: wrap; }
.tab {
  padding: 9px 18px; border-radius: 9px; font-weight: 700; font-size: 13.5px;
  color: var(--muted); transition: all .15s;
}
.tab.active { background: var(--white); color: var(--green-900); box-shadow: var(--shadow-sm); }
.tab:hover:not(.active) { color: var(--ink); }

/* ---------- Filter chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 15px; border-radius: 30px; font-size: 13px; font-weight: 600;
  background: var(--white); border: 1px solid var(--border); color: var(--ink);
  transition: all .15s;
}
.chip:hover { border-color: var(--green-600); }
.chip.active { background: var(--green-800); color: #fff; border-color: var(--green-800); }

/* ---------- Search & inputs ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 0 14px; height: 46px; flex: 1; min-width: 200px;
}
.search i { color: var(--muted); }
.search input { border: none; outline: none; flex: 1; font-size: 14px; font-family: inherit; background: transparent; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink); }
.input, select.input, textarea.input {
  border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px;
  font-size: 14px; font-family: inherit; background: var(--white); color: var(--ink);
  outline: none; transition: border .15s;
}
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(207,168,90,.15); }
textarea.input { resize: vertical; min-height: 90px; }

/* ============================================================
   PRODUCT CARDS
   ============================================================ */
.product-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: all .2s ease; display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: rgba(207,168,90,.5); }
.product-photo {
  height: 158px; position: relative; display: grid; place-items: center;
  font-size: 46px; color: rgba(255,255,255,.92);
}
.product-photo .stock-tag {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,.92); color: var(--green-800); font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; backdrop-filter: blur(4px);
}
.product-photo .fav {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 9px;
  background: rgba(255,255,255,.9); display: grid; place-items: center; color: var(--muted);
}
.product-photo .fav:hover { color: var(--gold); }
.product-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.product-brand { font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--gold); font-weight: 800; }
.product-name { font-size: 15.5px; font-weight: 800; margin: 4px 0 10px; letter-spacing: -.2px; line-height: 1.3; }
.product-specs { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.product-specs span { display: inline-flex; align-items: center; gap: 5px; }
.product-specs i { color: var(--green-600); font-size: 11px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 10px; }
.product-price { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.product-price small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* food gradient backgrounds (photo placeholders) */
.bg-dairy   { background: linear-gradient(135deg,#F6D365,#FDA085); }
.bg-cream   { background: linear-gradient(135deg,#FFEFBA,#FFCB8E); }
.bg-meat    { background: linear-gradient(135deg,#C94B4B,#8E2D2D); }
.bg-chicken { background: linear-gradient(135deg,#F5AF19,#F12711); }
.bg-sauce   { background: linear-gradient(135deg,#7B4397,#DC2430); }
.bg-oil     { background: linear-gradient(135deg,#F7971E,#FFD200); }
.bg-pack    { background: linear-gradient(135deg,#A18249,#D9C39B); }
.bg-water   { background: linear-gradient(135deg,#2193b0,#6dd5ed); }
.bg-frozen  { background: linear-gradient(135deg,#43cea2,#185a9d); }
.bg-rice    { background: linear-gradient(135deg,#E6DADA,#bdc3a6); color: var(--green-800)!important; }
.bg-green   { background: linear-gradient(135deg, var(--green-700), var(--green-600)); }

/* ============================================================
   PRODUCT DETAIL
   ============================================================ */
.pd-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; }
.pd-gallery { display: flex; flex-direction: column; gap: 14px; }
.pd-main-photo { height: 380px; border-radius: 18px; display: grid; place-items: center; font-size: 120px; color: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.pd-thumbs { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.pd-thumb { height: 78px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; color: rgba(255,255,255,.85); cursor: pointer; border: 2px solid transparent; }
.pd-thumb.active { border-color: var(--gold); }
.pd-info h1 { font-size: 27px; font-weight: 800; letter-spacing: -.4px; margin: 6px 0 8px; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 18px 0; }
.spec-grid div { background: var(--white); padding: 14px 16px; }
.spec-grid .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.spec-grid .v { font-size: 15px; font-weight: 700; margin-top: 2px; }
.qty {
  display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.qty button { width: 44px; height: 48px; font-size: 18px; color: var(--green-700); background: var(--white); }
.qty button:hover { background: var(--cream); }
.qty input { width: 56px; height: 48px; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 16px; font-weight: 700; outline: none; font-family: inherit; }

.info-box { background: var(--cream); border: 1px dashed var(--gold); border-radius: 14px; padding: 18px 20px; }
.info-box h4 { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.info-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; font-size: 13.5px; }
.info-row + .info-row { border-top: 1px solid var(--border); }

/* ============================================================
   CART
   ============================================================ */
.cart-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px solid #F0EBDD; }
.cart-item:last-child { border-bottom: none; }
.cart-thumb { width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; color: #fff; }
.cart-item-name b { font-size: 15px; font-weight: 700; }
.cart-item-name span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cart-remove { color: var(--muted); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.cart-remove:hover { color: var(--error); background: rgba(220,38,38,.07); }
.summary-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14px; }
.summary-row.total { border-top: 2px solid var(--border); margin-top: 8px; padding-top: 16px; font-size: 19px; font-weight: 800; }
.pay-opt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: all .15s; }
.pay-opt:hover { border-color: var(--green-600); }
.pay-opt.active { border-color: var(--gold); background: rgba(207,168,90,.07); }
.pay-opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; flex-shrink: 0; }
.pay-opt.active .radio { border-color: var(--gold); }
.pay-opt.active .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.pay-opt b { font-size: 14px; }
.pay-opt span { font-size: 12px; color: var(--muted); }

.note {
  background: rgba(18,77,58,.05); border-left: 3px solid var(--green-600);
  padding: 12px 14px; border-radius: 8px; font-size: 13px; color: var(--green-800);
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 8px; }
.tl-item { display: flex; gap: 16px; position: relative; padding-bottom: 26px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: 13px; top: 30px; bottom: -4px; width: 2px; background: var(--border);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 12px; z-index: 1; border: 2px solid var(--white);
}
.tl-item.done .tl-dot { background: var(--success); color: #fff; }
.tl-item.current .tl-dot { background: var(--gold); color: var(--green-900); box-shadow: 0 0 0 5px rgba(207,168,90,.2); }
.tl-item.pending .tl-dot { background: #EEF0EE; color: var(--muted); }
.tl-content b { font-size: 14.5px; font-weight: 700; }
.tl-content span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.tl-item.pending .tl-content b { color: var(--muted); }

/* ============================================================
   PROGRESS / LIMIT
   ============================================================ */
.progress { height: 14px; background: #EFEADC; border-radius: 30px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 30px; background: linear-gradient(90deg, var(--green-700), var(--gold)); }
.progress.warn > span { background: linear-gradient(90deg, var(--warning), #F59E0B); }

.alert {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 16px 18px; border-radius: 14px; font-size: 14px;
}
.alert i { font-size: 18px; margin-top: 1px; }
.alert.warn { background: rgba(217,119,6,.09); color: #92500B; border: 1px solid rgba(217,119,6,.25); }
.alert.warn i { color: var(--warning); }
.alert b { display: block; font-weight: 800; margin-bottom: 2px; }

/* ============================================================
   SUPPORT
   ============================================================ */
.manager-card { display: flex; align-items: center; gap: 18px; }
.manager-avatar {
  width: 68px; height: 68px; border-radius: 18px;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: var(--gold-light); display: grid; place-items: center; font-size: 26px; font-weight: 800; flex-shrink: 0;
}
.faq-item { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.faq-q { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.faq-q i { color: var(--gold); transition: transform .2s; }
.faq-item.open .faq-q i { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease, padding .25s ease; padding: 0 18px; color: var(--muted); font-size: 13.5px; }
.faq-item.open .faq-a { max-height: 160px; padding: 0 18px 16px; }

/* ============================================================
   MODAL & TOAST
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6,46,34,.55); backdrop-filter: blur(4px);
  display: none; place-items: center; z-index: 100; padding: 20px;
}
.modal-overlay.show { display: grid; animation: fade .2s ease; }
.modal {
  background: var(--white); border-radius: 22px; max-width: 440px; width: 100%;
  padding: 34px 32px; text-align: center; box-shadow: var(--shadow-lg);
  animation: pop .25s cubic-bezier(.18,.89,.32,1.28);
}
.modal .modal-icon {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px;
  background: rgba(22,163,74,.12); color: var(--success); display: grid; place-items: center; font-size: 32px;
}
.modal h3 { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.modal .modal-actions { display: flex; gap: 12px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: scale(1); } }

.toast-wrap { position: fixed; bottom: 26px; right: 26px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 12px; background: var(--green-900); color: #fff;
  padding: 14px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600;
  animation: slideIn .3s ease; min-width: 260px;
}
.toast i { color: var(--gold-light); font-size: 16px; }
.toast.success i { color: #4ADE80; }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================================
   PWA SPLASH / LAUNCH SCREEN (2s, crisp)
   ============================================================ */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background:
    radial-gradient(900px 640px at 50% 40%, var(--gold-light) 0%, var(--gold) 56%, #BE9748 100%);
  display: grid; place-items: center;
  padding: env(safe-area-inset-bottom) 24px 0;
}
.splash-done .splash { display: none !important; }
.splash.hide-splash { opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s ease; }
.splash-logo {
  width: min(46vw, 210px); height: auto; display: block; box-sizing: border-box;
  padding: 18px;                         /* breathing room — logo is edge-to-edge */
  filter: drop-shadow(0 14px 32px rgba(6,46,34,.22));
  animation: splashPop .6s cubic-bezier(.18,.89,.32,1.28);
}
.splash-bar {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(46px + env(safe-area-inset-bottom));
  width: 140px; height: 4px; border-radius: 4px;
  background: rgba(6,46,34,.16); overflow: hidden;
}
.splash-bar > span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--green-800); animation: splashLoad 2s cubic-bezier(.4,.1,.2,1) forwards; }
@keyframes splashLoad { from { width: 0; } to { width: 100%; } }
@keyframes splashPop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }

/* ============================================================
   CATALOG FILTER BAR (cleaner) + UTILITIES
   ============================================================ */
.catalog-filters { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.filter-controls { display: flex; gap: 12px; align-items: center; }
.product-card { cursor: pointer; }
.product-foot .btn { flex-shrink: 0; }
.product-price { white-space: nowrap; }

/* ============================================================
   INSTALL / ADD-TO-HOME-SCREEN BANNER (injected by JS)
   ============================================================ */
.install-banner {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  width: min(460px, calc(100% - 28px));
  background: var(--white); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 13px 13px 13px 15px;
  display: none; align-items: center; gap: 13px; z-index: 95;
  opacity: 0; transition: opacity .3s ease, transform .3s ease;
}
.install-banner.show { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }
.install-banner .ib-icon { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; overflow: hidden; box-shadow: var(--shadow-sm); }
.install-banner .ib-icon img { width: 100%; height: 100%; object-fit: cover; }
.install-banner .ib-text { flex: 1; min-width: 0; }
.install-banner .ib-text b { font-size: 14px; font-weight: 800; display: block; }
.install-banner .ib-text span { font-size: 12px; color: var(--muted); line-height: 1.4; display: block; margin-top: 2px; }
.install-banner .ib-close { width: 30px; height: 30px; border-radius: 8px; color: var(--muted); flex-shrink: 0; display: grid; place-items: center; font-size: 20px; line-height: 1; }
.install-banner .ib-close:hover { background: var(--cream); color: var(--ink); }
.ios-share { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 5px; background: var(--green-800); color: #fff; font-size: 10px; vertical-align: -4px; }
@media (max-width: 820px) {
  .install-banner { bottom: calc(86px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION (iOS / Android style) — injected by JS
   ============================================================ */
.bottom-nav { display: none; }
.mobile-brand { display: none; }
.scrim { display: none; }

@media (max-width: 820px) {
  .bottom-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: stretch;
    box-shadow: 0 -8px 24px rgba(6,46,34,.07);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: none; color: var(--muted); font-size: 10.5px; font-weight: 700;
    padding: 5px 2px; border-radius: 14px; transition: color .15s; letter-spacing: -.1px;
  }
  .bottom-nav i { font-size: 19px; line-height: 1; }
  .bottom-nav .active { color: var(--green-900); }
  .bottom-nav .active i { color: var(--gold); }
  .bottom-nav .bn-ico { position: relative; display: grid; place-items: center; height: 22px; }
  .bottom-nav .bn-ico b {
    position: absolute; top: -7px; right: -11px;
    background: var(--error); color: #fff; font-size: 9.5px; font-weight: 800;
    min-width: 17px; height: 17px; border-radius: 10px; display: grid; place-items: center;
    padding: 0 4px; border: 2px solid #fff;
  }
}

/* ---------- Bottom sheet (More) ---------- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 130;
  background: rgba(6,46,34,.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: none; align-items: flex-end;
}
.sheet-overlay.show { display: flex; animation: fade .2s ease; }
.sheet {
  background: var(--white); width: 100%;
  border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px rgba(6,46,34,.3);
  animation: sheetUp .3s cubic-bezier(.18,.89,.32,1.1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 44px; height: 5px; border-radius: 5px; background: var(--border); margin: 6px auto 16px; }
.sheet-user { display: flex; align-items: center; gap: 13px; padding: 4px 4px 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sheet-user b { display: block; font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.sheet-link { display: flex; align-items: center; gap: 15px; padding: 15px 6px; font-size: 15px; font-weight: 700; border-bottom: 1px solid #F0EBDD; }
.sheet-link > i:first-child { width: 22px; text-align: center; color: var(--green-700); font-size: 16px; }
.sheet-link.active { color: var(--green-900); }
.sheet-link.active > i:first-child { color: var(--gold); }
.sheet-link .chev { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ============================================================
   RESPONSIVE — tablet (icon sidebar)
   ============================================================ */
@media (max-width: 1100px) and (min-width: 821px) {
  :root { --sidebar-w: 82px; }
  .brand-text, .nav a span, .nav-label, .sidebar-footer { display: none; }
  .brand { justify-content: center; padding: 6px 0 18px; }
  .nav a { justify-content: center; padding: 13px; }
  .nav a.active::before { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .pd-grid { grid-template-columns: 1fr; }
  .cart-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE — phone (<= 820px): hide sidebar, use bottom nav
   ============================================================ */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .menu-toggle { display: none !important; }

  /* --- cleaner mobile header --- */
  .topbar {
    min-height: 60px;
    padding: env(safe-area-inset-top) 16px 0;   /* clear the iOS status bar / notch */
    background: rgba(247,241,227,.92);
  }
  .topbar-title h1 { font-size: 18px; letter-spacing: -.3px; }
  .topbar-title p { display: none; }
  .topbar-right { gap: 8px; }
  .topbar-actions { gap: 8px; }
  .icon-btn { width: 40px; height: 40px; border-radius: 11px; }
  .user-chip { display: none; }

  /* room for bottom nav */
  .content { padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }

  /* --- grids: override even inline templates --- */
  .grid { gap: 14px; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-2 { grid-template-columns: 1fr !important; }
  .grid[style*="grid-template"] { grid-template-columns: 1fr !important; }
  .cart-grid { grid-template-columns: 1fr !important; }
  .pd-grid { grid-template-columns: 1fr !important; }

  /* --- hero --- */
  .hero { padding: 26px 22px; border-radius: 20px; }
  .hero h2 { font-size: 22px; }
  .hero p { font-size: 14px; }
  .hero .hero-actions { gap: 10px; }
  .hero .hero-actions .btn { flex: 1; justify-content: center; }

  /* --- stat cards --- */
  .stat { padding: 16px 16px; }
  .stat .stat-value { font-size: 21px; }
  .stat .stat-value small { font-size: 12px !important; }

  /* --- section heads / tabs / chips scroll --- */
  .section-head h2 { font-size: 16.5px; }
  .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; }
  .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; margin: 0 -2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; flex-shrink: 0; }
  .search { min-width: 0; width: 100%; }

  /* --- catalog filters: simplified & stacked --- */
  .hide-mobile { display: none !important; }
  .catalog-filters { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 14px; }
  .filter-controls { gap: 10px; }
  .filter-controls select.input { flex: 1; min-width: 0; }

  /* --- product cards: price on its own line, full-width button --- */
  .product-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .product-foot .btn { width: 100%; justify-content: center; }
  .product-price { font-size: 18px; }

  /* --- card padding --- */
  .card-pad { padding: 18px 16px; }

  /* --- tables: smooth horizontal scroll --- */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
  table.tbl th, table.tbl td { padding: 12px 12px; }

  /* --- cart items: stack qty/total below --- */
  .cart-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
  .cart-item .cart-thumb { width: 50px; height: 50px; font-size: 21px; }
  .cart-item .cart-item-name { flex: 1 1 60%; min-width: 0; }
  .cart-item .qty { order: 5; }
  .cart-item > div:last-child { order: 6; margin-left: auto; }
  .cart-item [data-line] { min-width: 0 !important; }
  /* summary should not stick on mobile */
  .cart-grid > div:last-child { position: static !important; top: auto !important; }

  /* --- product detail --- */
  .pd-main-photo { height: 260px; font-size: 84px; }
  .pd-thumb { height: 64px; font-size: 22px; }
  .pd-info h1 { font-size: 22px; }
  .spec-grid { grid-template-columns: 1fr 1fr; }

  /* --- payment options / manager --- */
  .manager-card { gap: 14px; }
  .manager-avatar { width: 58px; height: 58px; font-size: 22px; }

  /* --- modal --- */
  .modal { padding: 28px 22px; border-radius: 20px; }
  .modal .modal-actions { flex-direction: column; }

  /* --- toast above bottom nav --- */
  .toast-wrap { left: 14px; right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; width: 100%; }
}

/* very small phones */
@media (max-width: 380px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr 1fr !important; }
  .hero h2 { font-size: 20px; }
  .bottom-nav a span, .bottom-nav button span { font-size: 9.5px; }
}

.hide { display: none !important; }
.fade-in { animation: fade .3s ease; }
