/* ================= ShopGe Storefront ================= */
:root {
  --primary: #ffc107;       /* yellow brand (customer app) */
  --primary-dark: #ffab00;
  --on-primary: #1a1a1a;    /* dark text on yellow */
  --accent: #ef6c00;        /* orange — readable links/accents on white */
  --gold: #ff8a3d;
  --ink: #232326;
  --muted: #7a7f93;
  --bg: #f7f7fb;
  --surface: #ffffff;
  --border: #e8e9f1;
  --line: #e8e9f1;
  --success: #1c8a4e;
  --danger: #e0445e;
  --star: #f5a623;
  --rating: #2e9e5b;        /* green rating pill (Meesho style) */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
}
a { text-decoration: none; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.loading, .empty {
  text-align: center; color: var(--muted); padding: 70px 20px; font-size: 15px;
}

/* ---------- buttons ---------- */
.btn {
  border: none; border-radius: 9px; padding: 11px 20px;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: .15s; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
}
.btn-primary { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-gold { background: linear-gradient(135deg, #ff9d2e, #ef6c00); color: #fff; }
.btn-gold:hover { filter: brightness(1.05); }
.btn-outline { background: #fff; color: var(--accent); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: #fff6da; }
.btn-light { background: #eef0f8; color: var(--ink); }
.btn-light:hover { background: #e4e6f3; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 50; background: var(--surface); box-shadow: 0 1px 0 var(--border); }
.hdr-main {
  display: flex; align-items: center; gap: 20px;
  max-width: 1240px; margin: 0 auto; padding: 13px 22px;
}
.hdr-burger {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--ink); padding: 4px;
}
.hdr-burger svg { width: 24px; height: 24px; }
.logo { font-size: 25px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); }
.logo span { color: var(--gold); }
.search { flex: 1; display: flex; max-width: 560px; }
.search input {
  flex: 1; border: 1.5px solid var(--border); border-right: none;
  border-radius: 9px 0 0 9px; padding: 11px 15px; font: inherit; font-size: 14px;
  background: var(--bg);
}
.search input:focus { outline: none; border-color: var(--accent); }
.search button {
  background: var(--primary); border: none; color: var(--on-primary); cursor: pointer;
  padding: 0 16px; border-radius: 0 9px 9px 0;
}
.search button svg { width: 19px; height: 19px; }
.hdr-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.hdr-act {
  display: flex; align-items: center; gap: 7px; padding: 9px 12px;
  border-radius: 9px; font-weight: 600; color: var(--ink); position: relative;
}
.hdr-act:hover { background: var(--bg); }
.hdr-act svg { width: 21px; height: 21px; }
.cart-badge {
  background: var(--gold); color: #2a2110; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.cat-bar {
  display: flex; gap: 4px; max-width: 1240px; margin: 0 auto;
  padding: 0 22px 10px; overflow-x: auto; justify-content: center; flex-wrap: wrap;
}
.cat-bar a {
  white-space: nowrap; padding: 7px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--bg); border: 1px solid var(--border);
}
.cat-bar a:hover { background: #fff6da; color: var(--accent); border-color: var(--primary); }
.cat-bar a.chip-all {
  background: var(--primary); color: var(--on-primary); border-color: var(--primary);
}
.cat-bar a.chip-all:hover { background: var(--primary-dark); }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 22px 60px; }
.section-title {
  font-size: 20px; font-weight: 800; margin: 28px 0 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-title a { font-size: 13px; font-weight: 600; color: var(--accent); }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumb a:hover { color: var(--accent); }

/* ---------- home hero ---------- */
.hero {
  border-radius: 16px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #ffd54a, #ff8a3d);
  min-height: 260px; display: flex; align-items: center;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.hero-txt { position: relative; padding: 40px 44px; color: #2a1c00; max-width: 560px; }
.hero-txt h1 { font-size: 34px; font-weight: 800; line-height: 1.1; }
.hero-txt p { margin: 12px 0 20px; opacity: .85; font-size: 15px; }

/* ---------- category tiles ---------- */
.cat-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 14px;
  grid-auto-rows: 1fr; /* equal-height tiles */
}
.cat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; text-align: center; transition: .15s;
  height: 100%; display: flex; flex-direction: column;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.cat-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; margin-bottom: 9px; }
.cat-tile span {
  font-weight: 600; font-size: 13px; margin-top: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- product grid + card ---------- */
.prod-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(192px, 1fr)); gap: 16px;
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  overflow: hidden; transition: .15s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.1); }
.card-img { position: relative; aspect-ratio: 1; background: #f0f0f5; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-fav {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.92); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.card-fav svg { width: 16px; height: 16px; }
.card-fav.on { background: #fde6ea; }
.card-fav.on svg { fill: var(--danger); stroke: var(--danger); }
.card-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-brand { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.card-name {
  font-size: 13px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-rating { font-size: 12px; color: var(--star); font-weight: 600; }
.card-price { margin-top: auto; padding-top: 5px; display: flex; align-items: baseline; gap: 7px; }
.card-price b { font-size: 16px; font-weight: 800; }
.card-price s { font-size: 12px; color: var(--muted); }
.card-price .off { font-size: 11px; color: var(--success); font-weight: 700; }

/* ---------- shop layout ---------- */
.shop { display: grid; grid-template-columns: 240px 1fr; gap: 22px; }
.filters {
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  padding: 16px; align-self: start; position: sticky; top: 150px;
}
.filters h4 { font-size: 13px; margin: 14px 0 8px; }
.filters h4:first-child { margin-top: 0; }
.filter-link {
  display: block; padding: 6px 8px; border-radius: 6px;
  font-size: 13px; color: var(--muted); cursor: pointer;
}
.filter-link:hover { background: var(--bg); color: var(--accent); }
.filter-link.active { background: #fff6da; color: var(--accent); font-weight: 700; }
.shop-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.shop-head select {
  border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit;
}
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.pager button {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; font: inherit; font-weight: 600;
}
.pager button.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- product detail ---------- */
.pd { display: grid; grid-template-columns: 420px 1fr; gap: 34px; }
.pd-gallery .pd-main {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  aspect-ratio: 1; overflow: hidden;
}
.pd-main img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pd-thumbs img {
  width: 62px; height: 62px; object-fit: cover; border-radius: 8px;
  border: 2px solid var(--border); cursor: pointer;
}
.pd-thumbs img.active { border-color: var(--accent); }
.pd-info h1 { font-size: 23px; font-weight: 800; line-height: 1.25; }
.pd-seller { color: var(--muted); margin: 6px 0; font-size: 13px; }
.pd-price { display: flex; align-items: baseline; gap: 10px; margin: 14px 0; }
.pd-price b { font-size: 28px; font-weight: 800; }
.pd-price s { color: var(--muted); }
.pd-price .off { color: var(--success); font-weight: 700; }
.pd-variants { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.variant-chip {
  border: 1.5px solid var(--border); background: var(--surface); border-radius: 9px;
  padding: 8px 13px; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px;
}
.variant-chip.active { border-color: var(--accent); background: #fff6da; color: var(--accent); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 9px; overflow: hidden; }
.qty button { background: var(--bg); border: none; width: 34px; height: 38px; font-size: 17px; cursor: pointer; }
.qty span { width: 44px; text-align: center; font-weight: 700; }
.pd-actions { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.pd-desc { margin-top: 24px; }
.pd-desc h3 { font-size: 15px; margin-bottom: 8px; }
.pd-desc p { color: #4a4f63; line-height: 1.7; }

/* ---------- cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.cart-item {
  display: flex; gap: 14px; padding: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px;
}
.cart-item img { width: 86px; height: 86px; object-fit: cover; border-radius: 9px; }
.cart-item-main { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; }
.cart-item-meta { color: var(--muted); font-size: 12px; margin: 3px 0 8px; }
.summary {
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  padding: 18px; position: sticky; top: 150px;
}
.summary h3 { font-size: 15px; margin-bottom: 14px; }
.sum-row { display: flex; justify-content: space-between; margin: 8px 0; font-size: 13px; color: var(--muted); }
.sum-row.total {
  border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px;
  font-size: 17px; font-weight: 800; color: var(--ink);
}

/* ---------- account ---------- */
.acct { display: grid; grid-template-columns: 210px 1fr; gap: 22px; }
.acct-nav {
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  padding: 10px; align-self: start;
}
.acct-nav button {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 11px 13px; border-radius: 8px; cursor: pointer; font: inherit;
  font-weight: 600; color: var(--muted);
}
.acct-nav button.active { background: #fff6da; color: var(--accent); }
.acct-nav button.logout { color: var(--danger); }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; padding: 20px;
}
.order-row {
  border: 1px solid var(--border); border-radius: 11px; padding: 14px;
  margin-bottom: 12px;
}
.order-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.addr-card {
  border: 1px solid var(--border); border-radius: 11px; padding: 14px; margin-bottom: 12px;
}

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 9px;
  padding: 10px 12px; font: inherit; font-size: 14px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- badges ---------- */
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.tag-green { background: #e2f6ee; color: var(--success); }
.tag-amber { background: #fcf2da; color: #b9810a; }
.tag-gray  { background: #edeef3; color: var(--muted); }
.tag-red   { background: #fce4e8; color: var(--danger); }

/* ---------- footer ---------- */
.ftr { background: #1f1d2e; color: #c9c8da; margin-top: 40px; }
.ftr-grid {
  max-width: 1240px; margin: 0 auto; padding: 40px 22px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px;
}
.ftr-logo { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.ftr-logo span { color: var(--gold); }
.ftr-grid p { font-size: 13px; line-height: 1.6; max-width: 280px; }
.ftr-grid h4 { color: #fff; font-size: 14px; margin-bottom: 10px; }
.ftr-grid a { display: block; font-size: 13px; padding: 4px 0; color: #9b9ab0; }
.ftr-grid a:hover { color: #fff; }
.ftr-base { border-top: 1px solid #34324a; text-align: center; padding: 16px; font-size: 13px; }
.heart { color: var(--danger); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,18,40,.55);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  opacity: 0; visibility: hidden; transition: .2s; padding: 20px;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface); border-radius: 16px; padding: 28px;
  width: 380px; max-width: 100%; position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 16px; background: none; border: none;
  font-size: 26px; cursor: pointer; color: var(--muted);
}
.modal-logo { font-size: 24px; font-weight: 800; text-align: center; }
.modal-logo span { color: var(--gold); }
.auth-tabs { display: flex; gap: 6px; margin: 18px 0; background: var(--bg); padding: 4px; border-radius: 10px; }
.auth-tab {
  flex: 1; border: none; background: none; padding: 9px; border-radius: 7px;
  cursor: pointer; font: inherit; font-weight: 600; color: var(--muted);
}
.auth-tab.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1f1d2e; color: #fff; padding: 12px 22px; border-radius: 10px;
  font-size: 13px; font-weight: 500; z-index: 200; opacity: 0; transition: .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }

/* ---------- mobile nav drawer ---------- */
.cat-bar.open { display: flex; }

@media (max-width: 900px) {
  .shop, .pd, .cart-layout, .acct { grid-template-columns: 1fr; }
  .filters, .summary { position: static; }
  .ftr-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hdr-burger { display: block; }
  .hdr-act span { display: none; }
  .logo { font-size: 21px; }
  .cat-bar {
    display: none; flex-direction: column; align-items: center; padding: 8px 22px 14px;
  }
  .hero-txt h1 { font-size: 24px; }
  .hero-txt { padding: 28px 24px; }
  .ftr-grid { grid-template-columns: 1fr 1fr; }
  .row2 { grid-template-columns: 1fr; }
}

/* ---- auth (phone OTP) ---- */
.auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.auth-testotp { background: #eef4ff; color: #2b50b0; border-radius: 8px; padding: 8px 12px;
  font-size: 13px; text-align: center; margin-bottom: 12px; }

/* ---- checkout: payment + couriers ---- */
.pay-opt { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; cursor: pointer; }
.muted-sm { color: var(--muted); font-size: 12.5px; }
.courier-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.courier-opt.sel { border-color: var(--accent); background: #f4f1fe; }
.courier-opt .courier-main { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prov-tag { font-size: 10px; font-weight: 700; color: var(--muted); background: #eceef5;
  border-radius: 6px; padding: 1px 6px; }
.prov-tag.cheap { color: #1c7d4d; background: #e3f6ec; }

/* ---- legal pages ---- */
.legal { background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 30px; max-width: 860px; margin: 0 auto; line-height: 1.7; }
.legal h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.legal h2 { font-size: 16px; font-weight: 700; margin: 22px 0 6px; }
.legal p, .legal li { color: #3a3f55; font-size: 14px; }
.legal ul { margin: 6px 0 6px 18px; }
.legal li { margin-bottom: 4px; }
.legal a { color: var(--accent); }
.legal-upd { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
@media (max-width: 640px) { .legal { padding: 20px 18px; } }

/* ---- under-trial banner ---- */
.trial-bar {
  background: repeating-linear-gradient(45deg, #111 0 18px, #e0a93a 18px 36px);
  color: #fff; text-align: center; font-weight: 800; letter-spacing: 3px;
  font-size: 18px; padding: 9px 10px; text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
@media (max-width: 640px) { .trial-bar { font-size: 14px; letter-spacing: 2px; padding: 7px 8px; } }

/* ---- category landing: L3 grouped sections ---- */
.l3-section { margin-bottom: 30px; }
.l3-section:last-child { margin-bottom: 0; }
.l3-section .section-title { font-size: 17px; }
.l3-section .section-title a { white-space: nowrap; }

/* L1 group headers inside the "All" sidebar */
.filter-link.cat-l1 { font-weight: 700; color: var(--ink); margin-top: 8px; }
.filter-link.cat-l1:hover { background: #fff6da; }
