:root {
  --green: #25D366; --green-dark: #128C7E;
  --gold: #C8912A; --gold-light: #F0C040;
  --ink: #1A1A1A; --paper: #FDF8F0; --muted: #7A7060;
  --border: #E8DFC8; --card: #FFFFFF; --accent: #D94F2B; --danger: #C0392B;
}
* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--paper); color: var(--ink); min-height: 100vh; padding-bottom: 90px; }
button { font-family: inherit; cursor: pointer; }
h1,h2,h3,.serif { font-family: 'Fraunces', serif; }

header { background: var(--ink); padding: 22px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 20px rgba(0,0,0,0.3); flex-wrap: wrap; }
.logo-area { display: flex; align-items: center; gap: 14px; }
.logo-area img { height: 52px; object-fit: contain; }
.brand-name { font-family: 'Fraunces', serif; font-weight: 800; font-size: 1.5rem; color: var(--gold-light); letter-spacing: 0.02em; }
.brand-sub { font-size: 0.72rem; color: #aaa; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 2px; }
.effective-badge { background: var(--gold); color: #fff; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; padding: 3px 10px; border-radius: 20px; margin-top: 4px; display: inline-block; }

.hero-strip { background: linear-gradient(120deg, #14140f 0%, var(--ink) 55%, #201a10 100%); padding: 20px 32px; display: flex; gap: 28px; flex-wrap: wrap; border-bottom: 1px solid rgba(200,145,42,0.25); }
.hero-stat { display: flex; flex-direction: column; gap: 2px; }
.hero-stat .num { font-family: 'Fraunces', serif; font-weight: 800; font-size: 1.4rem; color: var(--gold-light); line-height: 1; }
.hero-stat .lbl { font-size: 0.66rem; color: #999; text-transform: uppercase; letter-spacing: 0.08em; }

.search-bar { background: #fff; border-bottom: 2px solid var(--border); padding: 14px 32px; display: flex; align-items: center; gap: 14px; }
.search-bar input { flex: 1; border: 1.5px solid var(--border); border-radius: 8px; padding: 9px 16px; font-size: 0.92rem; background: var(--paper); color: var(--ink); outline: none; }
.search-bar input:focus { border-color: var(--gold); }

.tabs-wrap { background: var(--ink); padding: 0 24px; overflow-x: auto; display: flex; gap: 4px; scrollbar-width: none; }
.tab { padding: 11px 18px; font-family: 'Fraunces', serif; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; color: #888; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; text-transform: uppercase; user-select: none; }
.tab:hover { color: var(--gold-light); }
.tab.active { color: var(--gold-light); border-bottom-color: var(--gold); }

main { padding: 32px; max-width: 1400px; margin: 0 auto; }
.section-heading { display: flex; align-items: center; gap: 12px; margin: 32px 0 18px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
.section-heading h2 { font-weight: 700; font-size: 1.1rem; }
.cat-pill { background: var(--gold); color: #fff; font-size: 0.66rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; }
.count-badge { margin-left: auto; font-size: 0.78rem; color: var(--muted); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.product-card { background: var(--card); border: 1.5px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; position: relative; overflow: hidden; }
.product-card:hover { box-shadow: 0 6px 24px rgba(200,145,42,0.13); transform: translateY(-2px); border-color: var(--gold); }
.product-image-wrap { width: 100%; height: 140px; border-radius: 8px; overflow: hidden; background: var(--paper); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.product-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.item-no { font-family: 'Fraunces', serif; font-size: 0.68rem; font-weight: 700; color: var(--gold); letter-spacing: 0.08em; text-transform: uppercase; background: rgba(200,145,42,0.09); padding: 2px 8px; border-radius: 4px; }
.size-tag { font-size: 0.68rem; color: var(--muted); background: var(--paper); padding: 2px 7px; border-radius: 4px; border: 1px solid var(--border); }
.product-name { font-family: 'Fraunces', serif; font-weight: 700; font-size: 0.92rem; line-height: 1.35; flex: 1; }
.packing-info { font-size: 0.72rem; color: var(--muted); }
.price-block { display: flex; align-items: flex-end; gap: 10px; }
.mrp-label { font-size: 0.68rem; color: var(--muted); }
.mrp { font-family: 'Fraunces', serif; font-weight: 800; font-size: 1.4rem; }
.gst-total { display: flex; flex-direction: column; gap: 2px; font-size: 0.7rem; color: var(--muted); }
.gst-total .total-val { color: var(--accent); font-weight: 700; font-size: 0.82rem; }
.best-rate-btn { display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(37,211,102,0.1); color: var(--green-dark); border: 1.5px dashed var(--green); border-radius: 8px; padding: 8px 10px; font-family: 'Fraunces', serif; font-size: 0.72rem; font-weight: 700; text-decoration: none; }
.cart-add-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--ink); color: var(--gold-light); border: none; border-radius: 8px; padding: 10px; font-family: 'Fraunces', serif; font-size: 0.76rem; font-weight: 700; }
.qty-stepper { display: flex; align-items: center; justify-content: space-between; background: var(--ink); border-radius: 8px; flex: 1; }
.qty-stepper button { background: transparent; border: none; color: var(--gold-light); font-size: 1rem; font-weight: 700; padding: 8px 14px; }
.qty-stepper .qty-val { color: #fff; font-size: 0.8rem; font-weight: 700; }

.fab-cart { position: fixed; right: 24px; bottom: 24px; background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #fff; border: none; border-radius: 50px; padding: 14px 22px; font-family: 'Fraunces', serif; font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 28px rgba(200,145,42,0.4); z-index: 200; }
.fab-cart .badge { background: var(--accent); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300; display: flex; align-items: stretch; justify-content: flex-end; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.overlay.open { opacity: 1; pointer-events: auto; }
.overlay.center { align-items: center; justify-content: center; padding: 20px; }
.drawer { background: var(--paper); width: 420px; max-width: 100%; height: 100%; overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,0.2); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s cubic-bezier(.2,.8,.3,1); }
.overlay.open .drawer { transform: translateX(0); }
.drawer-header { background: var(--ink); color: #fff; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; }
.drawer-header h3 { color: var(--gold-light); font-size: 1.15rem; }
.close-btn { background: rgba(255,255,255,0.1); border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%; font-size: 1.1rem; }
.drawer-body { padding: 20px 24px; flex: 1; }
.drawer-footer { padding: 18px 24px; border-top: 1px solid var(--border); background: #fff; }
.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-item-name { font-family: 'Fraunces', serif; font-weight: 700; font-size: 0.86rem; margin-bottom: 3px; }
.cart-item-meta { font-size: 0.72rem; color: var(--muted); margin-bottom: 8px; }
.cart-item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cart-item-price { font-family: 'Fraunces', serif; font-weight: 700; color: var(--accent); font-size: 0.86rem; }
.cart-remove { background: none; border: none; color: var(--danger); font-size: 0.72rem; text-decoration: underline; }
.cart-empty { text-align: center; padding: 60px 10px; color: var(--muted); }
.cart-totals { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 6px; }
.cart-totals.grand { font-family: 'Fraunces', serif; font-weight: 800; font-size: 1.1rem; margin-top: 10px; padding-top: 10px; border-top: 1.5px solid var(--border); }
.btn-primary { width: 100%; background: var(--green); color: #fff; border: none; border-radius: 8px; padding: 13px; font-family: 'Fraunces', serif; font-weight: 700; font-size: 0.88rem; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-secondary { width: 100%; background: #fff; color: var(--ink); border: 1.5px solid var(--border); border-radius: 8px; padding: 12px; font-family: 'Fraunces', serif; font-weight: 700; font-size: 0.85rem; margin-bottom: 10px; }
.btn-danger-text { width: 100%; background: none; border: none; color: var(--danger); font-size: 0.8rem; text-decoration: underline; padding: 6px; }

/* Admin */
.admin-shell { max-width: 1100px; margin: 0 auto; padding: 24px; }
.admin-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.admin-tabs { display: flex; gap: 4px; background: #f3ede0; padding: 8px 24px 0; border-bottom: 2px solid var(--border); overflow-x: auto; }
.admin-tab { padding: 10px 16px; font-family: 'Fraunces', serif; font-weight: 700; font-size: 0.76rem; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; text-transform: uppercase; white-space: nowrap; }
.admin-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.admin-body { padding: 22px 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.field label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; display: block; margin-bottom: 5px; }
.field input, .field select { width: 100%; border: 1.5px solid var(--border); border-radius: 7px; padding: 9px 12px; font-size: 0.85rem; outline: none; background: var(--paper); }
.field input:focus, .field select:focus { border-color: var(--gold); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.admin-table th { text-align: left; font-family: 'Fraunces', serif; font-size: 0.66rem; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); }
.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mini-btn { background: var(--paper); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font-size: 0.72rem; font-weight: 600; }
.mini-btn:hover { border-color: var(--gold); color: var(--gold); }
.mini-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-save { background: var(--gold); color: #fff; border: none; border-radius: 8px; padding: 10px 22px; font-family: 'Fraunces', serif; font-weight: 700; font-size: 0.82rem; }
.btn-save:hover { background: #b07d1f; }
.login-shell { max-width: 380px; margin: 90px auto; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 30px; box-shadow: 0 20px 60px rgba(0,0,0,0.12); }
.login-shell h2 { text-align: center; margin-bottom: 6px; }
.login-shell p.sub { text-align: center; color: var(--muted); font-size: 0.82rem; margin-bottom: 22px; }
.login-shell input { width: 100%; margin-bottom: 12px; }
.form-error { color: var(--danger); font-size: 0.8rem; margin-top: 6px; min-height: 1em; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--gold-light); padding: 12px 22px; border-radius: 30px; font-size: 0.85rem; font-weight: 600; z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,0.3); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.toast.show { opacity: 1; }
.empty-note { color: var(--muted); font-size: 0.85rem; padding: 20px 0; text-align: center; }
.no-results { text-align: center; padding: 48px 0; color: var(--muted); grid-column: 1/-1; }

@media (max-width: 600px) {
  header { padding: 14px 16px; }
  main { padding: 16px; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .drawer { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-body { padding: 16px; }
}
