/* app.css — storefront + portal styling (dark-first). Handwritten, no build step.
   Fonts are declared in the self-hosted fonts.css (loaded before this file). */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}
body :lang(ml), .ml { font-family: var(--font-ml); }

/* Ambient lamp-glow background (from the theme reference). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 20%, rgba(201, 162, 75, 0.08), transparent 60%),
    radial-gradient(ellipse 120% 90% at 50% 120%, rgba(124, 51, 39, 0.14), transparent 65%),
    linear-gradient(180deg, var(--void-deep) 0%, var(--void) 45%, var(--void-deep) 100%);
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.03em;
  line-height: 1.2;
}
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); margin: 0 0 .35em; }
h2 { font-size: 1.4rem; margin: 0 0 .5em; }
h3 { margin: 0 0 .4em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 8, 0.6);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 50;
}
.site-header .bar {
  display: flex; align-items: center; gap: 20px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; }
/* Matches the <img> logomark (previously only `svg` was targeted, so this never applied). */
.brand img, .brand svg { width: 56px; height: 56px; display: block; }
.brand .wordmark {
  font-family: var(--font-display);
  font-size: 1.15rem; letter-spacing: 0.06em; color: var(--parchment);
}
.brand .wordmark b { color: var(--gold-bright); font-weight: 600; }
.brand .wordmark .dot { color: var(--copper-red); }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--parchment-dim); font-size: 0.95rem; letter-spacing: 0.02em; }
.nav a:hover { color: var(--gold-bright); text-decoration: none; }
/* The REGISTER link is a gold button — keep its dark label (beats .nav a). */
.nav a.btn, .nav a.btn:hover { color: var(--void-deep); }

/* ---- Mobile app shell: top bar icons, slide-in drawer, bottom tab bar ---- */
.announce { background: linear-gradient(90deg, var(--rust), var(--copper-red)); color: var(--parchment);
  text-align: center; padding: 7px 12px; font-size: 0.85rem; letter-spacing: 0.02em; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; position: relative;
  color: var(--parchment); background: none; border: none; cursor: pointer; padding: 6px; }
.icon-btn svg { width: 24px; height: 24px; display: block; }
.hamburger, .topbar-cart, .bottom-nav { display: none; }   /* desktop: hidden */
.cart-badge { position: absolute; top: -1px; right: -2px; background: var(--copper-red); color: var(--parchment);
  font-size: 0.6rem; min-width: 16px; height: 16px; border-radius: 999px; display: flex; align-items: center;
  justify-content: center; padding: 0 4px; }

/* Drawer */
.drawer { position: fixed; top: 0; left: 0; height: 100%; width: 82%; max-width: 320px; z-index: 200;
  background: var(--void-deep); border-right: 1px solid var(--line-strong); overflow-y: auto;
  transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1); display: none;
  box-shadow: 0 0 40px rgba(0,0,0,0.5); }
.drawer-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease; display: none; }
/* Drawer nav items ease in slightly after the panel slides. */
.drawer-nav > * { opacity: 0; transform: translateX(-8px); transition: opacity 0.25s ease, transform 0.25s ease; }
.nav-toggle:checked ~ .drawer .drawer-nav > * { opacity: 1; transform: none; transition-delay: 0.12s; }
.nav-toggle:checked ~ .drawer { transform: translateX(0); }
.nav-toggle:checked ~ .drawer-overlay { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head .wordmark { font-family: var(--font-display); letter-spacing: 0.06em; color: var(--parchment); }
.drawer-head .wordmark b { color: var(--gold-bright); }
.drawer-nav { display: flex; flex-direction: column; padding-bottom: 24px; }
.drawer-nav > a { padding: 13px 20px; color: var(--parchment); font-size: 1rem; border-bottom: 1px solid rgba(201,162,75,0.06); }
.drawer-nav > a:hover { background: rgba(201,162,75,0.06); color: var(--gold-bright); text-decoration: none; }
.drawer-user { padding: 16px 20px 12px; display: flex; flex-direction: column; font-family: var(--font-display); color: var(--gold-bright); }
.drawer-user .muted { font-family: var(--font-body); font-size: 0.8rem; }
.drawer-sep { height: 1px; background: var(--line); margin: 6px 0; }
.drawer-lang { padding: 14px 20px; color: var(--parchment-dim); font-size: 0.92rem; }
.pill { background: var(--copper-red); color: var(--parchment); border-radius: 999px; font-size: 0.7rem; padding: 1px 7px; }

/* Bottom tab bar */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; grid-template-columns: repeat(5, 1fr);
  background: rgba(7,10,8,0.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.bn-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 9px; position: relative;
  color: var(--parchment-dim); font-size: 0.6rem; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer;
  transition: color 0.15s ease; }
.bn-item svg { width: 22px; height: 22px; transition: transform 0.15s ease; }
.bn-item.active, .bn-item:hover { color: var(--gold-bright); text-decoration: none; }
.bn-item.active svg { transform: translateY(-1px); }
.bn-item.active::after { content: ''; position: absolute; top: 0; left: 26%; right: 26%; height: 2px;
  background: var(--gold); border-radius: 0 0 2px 2px; }

/* Account bottom sheet (slides up from the Account tab) */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 210; display: none;
  background: var(--void-deep); border-top: 1px solid var(--line-strong); border-radius: 16px 16px 0 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5); }
.sheet-overlay { position: fixed; inset: 0; z-index: 205; display: none; background: rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.sheet-toggle:checked ~ .sheet { transform: translateY(0); }
.sheet-toggle:checked ~ .sheet-overlay { opacity: 1; pointer-events: auto; }
.sheet-grip { display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 9px auto 10px; cursor: pointer; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 4px 20px 14px; border-bottom: 1px solid var(--line); }
.sheet-avatar { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; color: var(--gold); flex-shrink: 0; }
.sheet-avatar svg { width: 24px; height: 24px; }
.sheet-name { font-family: var(--font-display); color: var(--gold-bright); font-size: 1.05rem; }
.sheet-nav { display: flex; flex-direction: column; padding: 6px 0; }
.sheet-nav a { padding: 13px 20px; color: var(--parchment); border-bottom: 1px solid rgba(201,162,75,0.06); }
.sheet-nav a:hover { background: rgba(201,162,75,0.06); color: var(--gold-bright); text-decoration: none; }
.sheet-signout { padding: 12px 20px 4px; }
.bn-ic { position: relative; display: inline-flex; }
.bn-badge { position: absolute; top: -5px; right: -9px; background: var(--copper-red); color: var(--parchment);
  font-size: 0.55rem; min-width: 15px; height: 15px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

/* Eyebrow / labels */
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.66rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--void-deep);
  border: none; border-radius: var(--radius);
  padding: 12px 22px; cursor: pointer;
  transition: filter .2s ease, transform .15s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent; color: var(--gold-bright);
  border: 1px solid var(--line-strong);
}
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold-bright); outline-offset: 2px;
}

/* Forms */
.form-card {
  max-width: 440px; margin: 24px auto; padding: 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; color: var(--parchment-dim); margin-bottom: 6px; }
.input {
  width: 100%; padding: 12px 14px;
  background: rgba(232, 220, 192, 0.04); color: var(--parchment);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 1rem;
}
.input:focus { border-color: var(--gold); background: rgba(201, 162, 75, 0.06); outline: none; }
.field-error { color: var(--copper-red); font-size: 0.82rem; margin-top: 5px; }

/* Selects: solid dark control + readable option list (native popups otherwise
   render light option text on a white/system background = invisible on dark). */
select.input { background-color: var(--surface-2); color: var(--parchment); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select.input option { background-color: var(--surface-2); color: var(--parchment); }
/* Autofilled inputs shouldn't flip to white-on-dark. */
.input:-webkit-autofill { -webkit-text-fill-color: var(--parchment); transition: background-color 9999s; }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; border: 1px solid var(--line); }
.flash.error { border-color: var(--copper-red); color: #e7a892; background: rgba(124, 51, 39, 0.12); }
.flash.success { border-color: var(--gold); color: var(--gold-bright); background: rgba(201, 162, 75, 0.08); }

/* Cards / grid */
.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px;
}
.card h3 { color: var(--parchment); font-size: 1.05rem; margin: 0 0 6px; }
.muted { color: var(--parchment-dim); }
.price { color: var(--gold-bright); font-family: var(--font-display); }

/* Hero */
.hero { text-align: center; padding: 30px 0 18px; }
.hero .tagline { font-style: italic; color: var(--parchment-dim); font-size: 1.15rem; }
.divider { width: 56px; height: 1px; margin: 16px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

/* Tables (admin/seller) */
.table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th { color: var(--gold); font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* Catalogue filter bar — responsive auto-fit grid (row on desktop, 2-up on phones) */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-grid .field { margin: 0; }
.filter-grid .field label { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.filter-grid .input { width: 100%; padding: 9px 12px; }
.filter-grid .filter-check { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--parchment-dim); white-space: nowrap; }
.filter-grid .filter-apply { align-self: end; padding: 9px 18px; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 28px 0 6px; }
.pg { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--parchment); font-size: 0.9rem; }
.pg:hover { border-color: var(--gold); color: var(--gold-bright); text-decoration: none; }
.pg.current { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--void-deep); border-color: var(--gold); font-family: var(--font-display); }
.pg.disabled { opacity: 0.35; pointer-events: none; }
.pg-gap { color: var(--parchment-dim); padding: 0 2px; }

/* Stat tiles */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 20px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.stat .n { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold-bright); }
.stat .l { color: var(--parchment-dim); font-size: 0.85rem; letter-spacing: 0.04em; }

/* Footer */
.site-footer {
  margin-top: auto; border-top: 1px solid var(--line);
  padding: 28px 0; text-align: center;
  color: var(--parchment-dim); font-family: var(--font-display);
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
}

/* Layout helpers */
.section { padding: 20px 0; }
/* The page shell is <main class="container section">. Both classes set padding
   at equal specificity, so state all four here (side padding must survive). */
main.section { padding: 14px 20px 28px; }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.badge {
  display: inline-block; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--gold);
}

/* ---- Responsive / mobile ------------------------------------------------ */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }

  /* App shell: hamburger + centered brand + cart; full nav lives in the drawer. */
  .nav { display: none; }
  .hamburger, .topbar-cart { display: inline-flex; }
  .drawer, .drawer-overlay { display: block; }
  .sheet, .sheet-overlay { display: block; }
  .bottom-nav { display: grid; }
  .site-header .bar { height: 56px; gap: 12px; justify-content: space-between; flex-wrap: nowrap; }
  .brand img, .brand svg { width: 42px; height: 42px; }
  .brand .wordmark { font-size: 1.02rem; }
  body { padding-bottom: 64px; }   /* clear the fixed bottom tab bar */

  /* Tighter vertical rhythm on small screens (keep 16px side padding). */
  main.section { padding: 8px 16px 18px; }
  .section { padding: 14px 0; }
  .hero { padding: 18px 0 10px; }

  .form-card { margin: 16px auto; padding: 22px; }
  .card { padding: 16px; }
  .grid { gap: 14px; }

  /* Wide tables scroll horizontally instead of breaking the layout. */
  .table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* Stack any two-column rows (product page, checkout summary, etc.). */
  .row.between { gap: 10px; }
}

@media (max-width: 420px) {
  .nav .btn { padding: 6px 12px; }
  h1 { font-size: 1.55rem; }
}

/* --- image picker / gallery manager (seller) --- */
.image-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.image-cell {
  position: relative; width: 104px; height: 104px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--line); background: var(--surface-2);
  cursor: grab; user-select: none;
}
.image-cell img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.image-cell.dragging { opacity: .45; }
.image-main {
  position: absolute; left: 4px; bottom: 4px; font-size: .66rem; letter-spacing: .04em;
  background: var(--gold); color: var(--void-deep); padding: 1px 6px; border-radius: 4px;
}
.image-del {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; line-height: 20px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.62); color: #fff;
  font-size: 15px; cursor: pointer; padding: 0;
}
.image-del:hover { background: var(--danger, #c0392b); }
.image-pos {
  position: absolute; top: 3px; left: 3px; font-size: .66rem;
  background: rgba(0,0,0,.62); color: #fff; padding: 1px 6px; border-radius: 4px;
}

/* --- product gallery (buyer) --- */
.gallery-main { width: 100%; max-width: 420px; border: 1px solid var(--line); border-radius: 8px; object-fit: cover; margin-bottom: 10px; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 66px; height: 66px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); cursor: pointer; opacity: .7; transition: opacity .15s;
}
.gallery-thumbs img:hover, .gallery-thumbs img.active { opacity: 1; border-color: var(--gold); }

/* app.css — storefront + portal styling (dark-first). Handwritten, no build step.
   Fonts are declared in the self-hosted fonts.css (loaded before this file). */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}
body :lang(ml), .ml { font-family: var(--font-ml); }

/* Ambient lamp-glow background (from the theme reference). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 20%, rgba(201, 162, 75, 0.08), transparent 60%),
    radial-gradient(ellipse 120% 90% at 50% 120%, rgba(124, 51, 39, 0.14), transparent 65%),
    linear-gradient(180deg, var(--void-deep) 0%, var(--void) 45%, var(--void-deep) 100%);
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.03em;
  line-height: 1.2;
}
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); margin: 0 0 .35em; }
h2 { font-size: 1.4rem; margin: 0 0 .5em; }
h3 { margin: 0 0 .4em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 8, 0.6);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 50;
}
.site-header .bar {
  display: flex; align-items: center; gap: 20px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; }
/* Matches the <img> logomark (previously only `svg` was targeted, so this never applied). */
.brand img, .brand svg { width: 56px; height: 56px; display: block; }
.brand .wordmark {
  font-family: var(--font-display);
  font-size: 1.15rem; letter-spacing: 0.06em; color: var(--parchment);
}
.brand .wordmark b { color: var(--gold-bright); font-weight: 600; }
.brand .wordmark .dot { color: var(--copper-red); }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--parchment-dim); font-size: 0.95rem; letter-spacing: 0.02em; }
.nav a:hover { color: var(--gold-bright); text-decoration: none; }
/* The REGISTER link is a gold button — keep its dark label (beats .nav a). */
.nav a.btn, .nav a.btn:hover { color: var(--void-deep); }

/* ---- Mobile app shell: top bar icons, slide-in drawer, bottom tab bar ---- */
.announce { background: linear-gradient(90deg, var(--rust), var(--copper-red)); color: var(--parchment);
  text-align: center; padding: 7px 12px; font-size: 0.85rem; letter-spacing: 0.02em; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; position: relative;
  color: var(--parchment); background: none; border: none; cursor: pointer; padding: 6px; }
.icon-btn svg { width: 24px; height: 24px; display: block; }
.hamburger, .topbar-cart, .bottom-nav { display: none; }   /* desktop: hidden */
.cart-badge { position: absolute; top: -1px; right: -2px; background: var(--copper-red); color: var(--parchment);
  font-size: 0.6rem; min-width: 16px; height: 16px; border-radius: 999px; display: flex; align-items: center;
  justify-content: center; padding: 0 4px; }

/* Drawer */
.drawer { position: fixed; top: 0; left: 0; height: 100%; width: 82%; max-width: 320px; z-index: 200;
  background: var(--void-deep); border-right: 1px solid var(--line-strong); overflow-y: auto;
  transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1); display: none;
  box-shadow: 0 0 40px rgba(0,0,0,0.5); }
.drawer-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease; display: none; }
/* Drawer nav items ease in slightly after the panel slides. */
.drawer-nav > * { opacity: 0; transform: translateX(-8px); transition: opacity 0.25s ease, transform 0.25s ease; }
.nav-toggle:checked ~ .drawer .drawer-nav > * { opacity: 1; transform: none; transition-delay: 0.12s; }
.nav-toggle:checked ~ .drawer { transform: translateX(0); }
.nav-toggle:checked ~ .drawer-overlay { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head .wordmark { font-family: var(--font-display); letter-spacing: 0.06em; color: var(--parchment); }
.drawer-head .wordmark b { color: var(--gold-bright); }
.drawer-nav { display: flex; flex-direction: column; padding-bottom: 24px; }
.drawer-nav > a { padding: 13px 20px; color: var(--parchment); font-size: 1rem; border-bottom: 1px solid rgba(201,162,75,0.06); }
.drawer-nav > a:hover { background: rgba(201,162,75,0.06); color: var(--gold-bright); text-decoration: none; }
.drawer-user { padding: 16px 20px 12px; display: flex; flex-direction: column; font-family: var(--font-display); color: var(--gold-bright); }
.drawer-user .muted { font-family: var(--font-body); font-size: 0.8rem; }
.drawer-sep { height: 1px; background: var(--line); margin: 6px 0; }
.drawer-lang { padding: 14px 20px; color: var(--parchment-dim); font-size: 0.92rem; }
.pill { background: var(--copper-red); color: var(--parchment); border-radius: 999px; font-size: 0.7rem; padding: 1px 7px; }

/* Bottom tab bar */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; grid-template-columns: repeat(5, 1fr);
  background: rgba(7,10,8,0.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.bn-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 9px; position: relative;
  color: var(--parchment-dim); font-size: 0.6rem; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer;
  transition: color 0.15s ease; }
.bn-item svg { width: 22px; height: 22px; transition: transform 0.15s ease; }
.bn-item.active, .bn-item:hover { color: var(--gold-bright); text-decoration: none; }
.bn-item.active svg { transform: translateY(-1px); }
.bn-item.active::after { content: ''; position: absolute; top: 0; left: 26%; right: 26%; height: 2px;
  background: var(--gold); border-radius: 0 0 2px 2px; }

/* Account bottom sheet (slides up from the Account tab) */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 210; display: none;
  background: var(--void-deep); border-top: 1px solid var(--line-strong); border-radius: 16px 16px 0 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5); }
.sheet-overlay { position: fixed; inset: 0; z-index: 205; display: none; background: rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.sheet-toggle:checked ~ .sheet { transform: translateY(0); }
.sheet-toggle:checked ~ .sheet-overlay { opacity: 1; pointer-events: auto; }
.sheet-grip { display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 9px auto 10px; cursor: pointer; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 4px 20px 14px; border-bottom: 1px solid var(--line); }
.sheet-avatar { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; color: var(--gold); flex-shrink: 0; }
.sheet-avatar svg { width: 24px; height: 24px; }
.sheet-name { font-family: var(--font-display); color: var(--gold-bright); font-size: 1.05rem; }
.sheet-nav { display: flex; flex-direction: column; padding: 6px 0; }
.sheet-nav a { padding: 13px 20px; color: var(--parchment); border-bottom: 1px solid rgba(201,162,75,0.06); }
.sheet-nav a:hover { background: rgba(201,162,75,0.06); color: var(--gold-bright); text-decoration: none; }
.sheet-signout { padding: 12px 20px 4px; }
.bn-ic { position: relative; display: inline-flex; }
.bn-badge { position: absolute; top: -5px; right: -9px; background: var(--copper-red); color: var(--parchment);
  font-size: 0.55rem; min-width: 15px; height: 15px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

/* Eyebrow / labels */
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.66rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--void-deep);
  border: none; border-radius: var(--radius);
  padding: 12px 22px; cursor: pointer;
  transition: filter .2s ease, transform .15s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent; color: var(--gold-bright);
  border: 1px solid var(--line-strong);
}
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold-bright); outline-offset: 2px;
}

/* Forms */
.form-card {
  max-width: 440px; margin: 24px auto; padding: 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; color: var(--parchment-dim); margin-bottom: 6px; }
.input {
  width: 100%; padding: 12px 14px;
  background: rgba(232, 220, 192, 0.04); color: var(--parchment);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 1rem;
}
.input:focus { border-color: var(--gold); background: rgba(201, 162, 75, 0.06); outline: none; }
.field-error { color: var(--copper-red); font-size: 0.82rem; margin-top: 5px; }

/* Selects: solid dark control + readable option list (native popups otherwise
   render light option text on a white/system background = invisible on dark). */
select.input { background-color: var(--surface-2); color: var(--parchment); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select.input option { background-color: var(--surface-2); color: var(--parchment); }
/* Autofilled inputs shouldn't flip to white-on-dark. */
.input:-webkit-autofill { -webkit-text-fill-color: var(--parchment); transition: background-color 9999s; }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; border: 1px solid var(--line); }
.flash.error { border-color: var(--copper-red); color: #e7a892; background: rgba(124, 51, 39, 0.12); }
.flash.success { border-color: var(--gold); color: var(--gold-bright); background: rgba(201, 162, 75, 0.08); }

/* Cards / grid */
.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px;
}
.card h3 { color: var(--parchment); font-size: 1.05rem; margin: 0 0 6px; }
.muted { color: var(--parchment-dim); }
.price { color: var(--gold-bright); font-family: var(--font-display); }

/* Hero */
.hero { text-align: center; padding: 30px 0 18px; }
.hero .tagline { font-style: italic; color: var(--parchment-dim); font-size: 1.15rem; }
.divider { width: 56px; height: 1px; margin: 16px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

/* Tables (admin/seller) */
.table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th { color: var(--gold); font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* Catalogue filter bar — responsive auto-fit grid (row on desktop, 2-up on phones) */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-grid .field { margin: 0; }
.filter-grid .field label { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.filter-grid .input { width: 100%; padding: 9px 12px; }
.filter-grid .filter-check { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--parchment-dim); white-space: nowrap; }
.filter-grid .filter-apply { align-self: end; padding: 9px 18px; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 28px 0 6px; }
.pg { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--parchment); font-size: 0.9rem; }
.pg:hover { border-color: var(--gold); color: var(--gold-bright); text-decoration: none; }
.pg.current { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--void-deep); border-color: var(--gold); font-family: var(--font-display); }
.pg.disabled { opacity: 0.35; pointer-events: none; }
.pg-gap { color: var(--parchment-dim); padding: 0 2px; }

/* Stat tiles */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 20px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.stat .n { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold-bright); }
.stat .l { color: var(--parchment-dim); font-size: 0.85rem; letter-spacing: 0.04em; }

/* Footer */
.site-footer {
  margin-top: auto; border-top: 1px solid var(--line);
  padding: 28px 0; text-align: center;
  color: var(--parchment-dim); font-family: var(--font-display);
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
}

/* Layout helpers */
.section { padding: 20px 0; }
/* The page shell is <main class="container section">. Both classes set padding
   at equal specificity, so state all four here (side padding must survive). */
main.section { padding: 14px 20px 28px; }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.badge {
  display: inline-block; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--gold);
}

/* ---- Responsive / mobile ------------------------------------------------ */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }

  /* App shell: hamburger + centered brand + cart; full nav lives in the drawer. */
  .nav { display: none; }
  .hamburger, .topbar-cart { display: inline-flex; }
  .drawer, .drawer-overlay { display: block; }
  .sheet, .sheet-overlay { display: block; }
  .bottom-nav { display: grid; }
  .site-header .bar { height: 56px; gap: 12px; justify-content: space-between; flex-wrap: nowrap; }
  .brand img, .brand svg { width: 42px; height: 42px; }
  .brand .wordmark { font-size: 1.02rem; }
  body { padding-bottom: 64px; }   /* clear the fixed bottom tab bar */

  /* Tighter vertical rhythm on small screens (keep 16px side padding). */
  main.section { padding: 8px 16px 18px; }
  .section { padding: 14px 0; }
  .hero { padding: 18px 0 10px; }

  .form-card { margin: 16px auto; padding: 22px; }
  .card { padding: 16px; }
  .grid { gap: 14px; }

  /* Wide tables scroll horizontally instead of breaking the layout. */
  .table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* Stack any two-column rows (product page, checkout summary, etc.). */
  .row.between { gap: 10px; }
}

@media (max-width: 420px) {
  .nav .btn { padding: 6px 12px; }
  h1 { font-size: 1.55rem; }
}

/* --- image picker / gallery manager (seller) --- */
.image-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.image-cell {
  position: relative; width: 104px; height: 104px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--line); background: var(--surface-2);
  cursor: grab; user-select: none;
}
.image-cell img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.image-cell.dragging { opacity: .45; }
.image-main {
  position: absolute; left: 4px; bottom: 4px; font-size: .66rem; letter-spacing: .04em;
  background: var(--gold); color: var(--void-deep); padding: 1px 6px; border-radius: 4px;
}
.image-del {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; line-height: 20px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.62); color: #fff;
  font-size: 15px; cursor: pointer; padding: 0;
}
.image-del:hover { background: var(--danger, #c0392b); }
.image-pos {
  position: absolute; top: 3px; left: 3px; font-size: .66rem;
  background: rgba(0,0,0,.62); color: #fff; padding: 1px 6px; border-radius: 4px;
}

/* --- product gallery (buyer) --- */
.gallery-main { width: 100%; max-width: 420px; border: 1px solid var(--line); border-radius: 8px; object-fit: cover; margin-bottom: 10px; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 66px; height: 66px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); cursor: pointer; opacity: .7; transition: opacity .15s;
}
.gallery-thumbs img:hover, .gallery-thumbs img.active { opacity: 1; border-color: var(--gold); }

/* --- sankalpam inline fields (checkout / booking) --- */
.pooja-fields { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 8px 0 16px; background: var(--surface-2); }
.pooja-fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 12px; }
.pooja-fieldset:last-child { margin-bottom: 0; }
.pooja-fieldset legend { padding: 0 6px; font-weight: 600; }

/* --- product cards (catalogue / home grids) --- */
.grid.cols-3 > * { min-width: 0; }               /* let grid items shrink; stops title overflow */
.product-card {
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.product-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.product-card__media {
  position: relative; width: 100%; height: 150px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.product-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card__media.is-empty::after,
.product-card__ph {
  font-family: var(--font-display); font-size: 2rem; color: var(--parchment-dim); opacity: .35;
}
.product-card__media.is-empty::after { content: '॥'; }
.product-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.product-card__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.product-card__title {
  color: var(--parchment); font-size: 1rem; margin: 0; line-height: 1.3;
  overflow-wrap: anywhere; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__meta { font-size: .82rem; margin: 0; }
.product-card__price { margin: 2px 0 0; }
@media (max-width: 720px) {
  .product-card__media { height: 128px; }
}
