/* ============================================================
   EarnKart.shop — JustDial-Style Mobile-First Stylesheet
   ============================================================ */
:root {
  /* JustDial-inspired palette */
  --primary: #FF6B00;          /* JD orange */
  --primary-dark: #E55A00;
  --primary-light: #FFF3EC;
  --accent: #FFA500;
  --secondary: #1A1A2E;
  --success: #00A651;
  --danger: #E53E3E;
  --warning: #F6AD55;

  --bg: #F5F5F5;
  --card-bg: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #888888;
  --text-tiny: #AAAAAA;
  --border: #E8E8E8;
  --border-light: #F0F0F0;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 20px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-card: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-modal: 0 8px 32px rgba(0,0,0,0.18);
  --bottom-nav-height: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.45;
  padding-bottom: var(--bottom-nav-height);
  max-width: 480px; margin: 0 auto;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ===== SEARCH BAR ===== */
.search-bar {
  position: sticky; top: 0; z-index: 100;
  background: var(--primary); padding: 12px 14px 14px;
  display: flex; align-items: center; gap: 8px;
}
.search-input-wrap {
  flex: 1; background: white; border-radius: var(--radius-sm);
  padding: 8px 12px; display: flex; align-items: center; gap: 8px;
}
.search-input-wrap input {
  flex: 1; border: 0; outline: none; font-size: 13px;
  background: transparent;
}
.search-icon { color: var(--text-muted); font-size: 16px; }
.search-bar .nav-link {
  color: white; font-size: 12px; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
}

/* ===== STORE BANNER (referral branding) ===== */
.store-banner {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 10px 14px; display: flex; justify-content: space-between;
  align-items: center; font-size: 12px;
  border-bottom: 1px solid var(--primary-light);
}
.store-banner b { font-weight: 700; font-size: 13px; }
.store-banner .powered { font-size: 11px; opacity: 0.7; }

/* ===== CATEGORY PILLS ===== */
.category-pills {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 14px; background: white;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none; -ms-overflow-style: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.category-pill {
  white-space: nowrap; padding: 6px 14px;
  border-radius: 20px; font-size: 12px; font-weight: 500;
  border: 1.5px solid var(--border); background: white;
  cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.category-pill.active {
  background: var(--primary); color: white; border-color: var(--primary);
}

/* ===== SECTION ===== */
.section { background: white; margin-bottom: 8px; padding: 8px 0 14px; }
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 14px 8px;
}
.section-title { font-size: 16px; font-weight: 700; }
.see-all { color: var(--primary); font-size: 12px; font-weight: 600; }

/* ===== PRODUCT HORIZONTAL SCROLL ===== */
.product-scroll {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 4px 14px 8px; scrollbar-width: none;
}
.product-scroll::-webkit-scrollbar { display: none; }

/* ===== PRODUCT CARD ===== */
.product-card {
  min-width: 140px; max-width: 140px;
  background: white; border-radius: var(--radius);
  overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--border);
}
.product-card.flex {
  min-width: auto; max-width: none; width: 100%;
}
.product-img-wrap {
  position: relative; height: 120px;
  background: #F9FAFB;
  display: flex; align-items: center; justify-content: center;
}
.pimg { width: 100%; height: 100%; object-fit: cover; }
.pimg-emoji { font-size: 56px; }
.pimg-lg { font-size: 96px; }
.badge-bestseller {
  position: absolute; top: 6px; left: 6px;
  background: #1A1A1A; color: white;
  font-size: 9px; font-weight: 700;
  padding: 3px 7px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-discount {
  position: absolute; top: 6px; right: 6px;
  background: var(--primary); color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
}
.add-btn {
  position: absolute; bottom: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: white; color: var(--primary);
  border: 1.5px solid var(--primary); font-size: 22px;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-decoration: none; line-height: 1;
}
.add-btn:hover { background: var(--primary); color: white; }
.add-btn.added { background: var(--primary); color: white; }
.product-info { padding: 8px 10px 12px; }
.product-weight {
  font-size: 11px; color: var(--text-muted); margin-bottom: 3px;
  background: white; border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; display: inline-block;
}
.product-name {
  font-size: 12px; font-weight: 500; line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  min-height: 30px;
}
.product-pricing { display: flex; align-items: center; gap: 6px; }
.product-pricing .price { font-size: 14px; font-weight: 700; }
.product-pricing .mrp {
  font-size: 11px; color: var(--text-muted);
  text-decoration: line-through;
}
.earn-tag {
  font-size: 9px; background: var(--primary-light);
  color: var(--primary-dark); padding: 2px 6px;
  border-radius: 4px; margin-top: 4px; display: inline-block;
  font-weight: 600;
}

/* ===== CATEGORY GRID ===== */
.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px; padding: 10px 14px;
}
.cat-tile {
  background: #EAF4FE; border-radius: var(--radius);
  padding: 12px 6px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.cat-tile .cat-emoji { font-size: 36px; }
.cat-tile .cat-name {
  font-size: 11px; font-weight: 500; color: var(--text);
  line-height: 1.2;
}

/* ===== HERO BANNER ===== */
.hero-banner {
  background: linear-gradient(135deg, #CEE7FA 0%, #DDEDF9 100%);
  margin: 8px 14px; padding: 14px;
  border-radius: var(--radius);
  display: flex; justify-content: space-between; align-items: center;
}
.hero-banner h2 {
  font-size: 18px; font-weight: 800;
  color: #0F4F7A; margin-bottom: 4px;
}
.hero-banner p { font-size: 12px; color: #3A6F94; }
.hero-banner .hero-img { font-size: 64px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--bottom-nav-height);
  background: white; border-top: 1px solid var(--border);
  display: flex; z-index: 1000;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 10px; color: var(--text-muted); gap: 2px;
  position: relative;
}
.nav-item.active { color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 22px; line-height: 1; }
.cart-count {
  position: absolute; top: 6px; right: calc(50% - 22px);
  background: var(--primary); color: white;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
}

/* ===== FORMS / LOGIN ===== */
.auth-page {
  padding: 30px 20px; min-height: calc(100vh - var(--bottom-nav-height));
}
.auth-card {
  background: white; padding: 24px 20px;
  border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 400px; margin: 0 auto;
}
.auth-card h1 {
  font-size: 22px; font-weight: 700; margin-bottom: 6px;
  color: var(--primary);
}
.auth-card .sub { color: var(--text-muted); margin-bottom: 18px; font-size: 13px; }
.auth-card label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text); margin-top: 14px; margin-bottom: 6px;
}
.auth-card input, .auth-card select, .auth-card textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
}
.auth-card input:focus, .auth-card select:focus, .auth-card textarea:focus {
  outline: none; border-color: var(--primary);
}
.btn {
  display: inline-block; padding: 12px 18px;
  border-radius: var(--radius-sm); border: 0;
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-align: center; text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: white; color: var(--text); border: 1.5px solid var(--border); }
.btn-danger { background: white; color: #B91C1C; border: 1.5px solid #FCA5A5; }
.btn-block { width: 100%; }

.flash {
  padding: 10px 14px; border-radius: var(--radius-sm);
  margin: 14px; font-size: 13px;
}
.flash.ok { background: #DCFCE7; color: #166534; border-left: 4px solid #16A34A; }
.flash.error { background: #FEE2E2; color: #991B1B; border-left: 4px solid #DC2626; }

.tip-box {
  background: #FEF3C7; color: #92400E; font-size: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  margin-top: 14px; line-height: 1.6;
}

/* ===== CART ===== */
.cart-page { padding: 14px; }
.cart-page h1 { font-size: 20px; margin-bottom: 12px; padding: 0 4px; }
.cart-line {
  display: flex; gap: 12px; padding: 12px;
  background: white; border-radius: var(--radius);
  margin-bottom: 8px; align-items: center;
}
.cart-line .pimg-emoji { font-size: 36px; width: 50px; text-align: center; }
.cart-line .pimg { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }
.cart-line .info { flex: 1; }
.cart-line .info h4 { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.cart-line .info .meta { font-size: 11px; color: var(--text-muted); }
.cart-line .price { font-weight: 700; color: var(--primary); }
.qty-ctrl {
  display: flex; align-items: center; gap: 4px;
  background: var(--primary); border-radius: 6px;
  padding: 2px;
}
.qty-ctrl button {
  width: 26px; height: 26px; border: 0; background: transparent;
  color: white; font-size: 16px; font-weight: 700;
}
.qty-ctrl .qty-num { color: white; min-width: 18px; text-align: center; font-weight: 600; font-size: 13px; }

.cart-total-box {
  background: white; border-radius: var(--radius);
  padding: 14px; margin-top: 10px;
}
.total-line {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 13px;
}
.total-line.grand {
  font-size: 16px; font-weight: 700;
  border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px;
}
.total-line.grand b { color: var(--primary); font-size: 18px; }

.wallet-apply-box {
  background: var(--primary-light); border-radius: var(--radius);
  padding: 12px 14px; margin-top: 10px;
  border: 1px solid var(--primary);
}
.wallet-apply-box .wallet-balance {
  font-size: 13px; color: var(--primary-dark); margin-bottom: 6px;
}
.wallet-apply-box label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.wallet-apply-box input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }

/* ===== DASHBOARD ===== */
.dash {
  padding: 14px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary) 110px, var(--bg) 110px);
  min-height: calc(100vh - var(--bottom-nav-height));
}
.dash-header { color: white; margin-bottom: 14px; }
.dash-header h2 { font-size: 18px; font-weight: 700; }
.dash-header .sub { font-size: 13px; opacity: 0.9; }

.wallet-card {
  background: white; border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 10px;
}
.wallet-card .label { font-size: 12px; color: var(--text-muted); }
.wallet-card .amt {
  font-size: 28px; font-weight: 800; color: var(--primary);
  margin: 4px 0 10px;
}
.wallet-card .actions { display: flex; gap: 6px; }
.wallet-card .actions .btn { flex: 1; padding: 9px; font-size: 12px; }

.tab-bar {
  display: flex; background: white; border-radius: var(--radius);
  padding: 4px; margin-bottom: 12px;
}
.tab-bar a {
  flex: 1; padding: 9px 4px; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  border-radius: 8px;
}
.tab-bar a.active { background: var(--primary); color: white; }

.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; margin-bottom: 10px;
}
.stat-card {
  background: white; border-radius: var(--radius);
  padding: 10px 8px; text-align: center;
  border: 1px solid var(--border);
}
.stat-card .stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .stat-value { font-size: 18px; font-weight: 700; margin-top: 4px; }
.stat-card .stat-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.stat-card.l1 .stat-value { color: var(--primary); }
.stat-card.l2 .stat-value { color: #1D4ED8; }
.stat-card.l3 .stat-value { color: #D97706; }

.panel {
  background: white; border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px;
}
.panel h3 {
  font-size: 14px; font-weight: 700; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}

.referral-box {
  background: linear-gradient(135deg, var(--primary), #15A832);
  color: white; border-radius: var(--radius);
  padding: 16px; margin-bottom: 10px;
}
.referral-box h3 { font-size: 14px; margin-bottom: 4px; opacity: 0.9; }
.referral-box .code {
  font-size: 24px; font-weight: 800; letter-spacing: 2px;
  background: rgba(255,255,255,0.2); border-radius: var(--radius-sm);
  padding: 10px; text-align: center; margin: 10px 0;
  font-family: 'SF Mono', 'Menlo', monospace;
}
.referral-box .share-row { display: flex; gap: 6px; }
.referral-box .share-row button {
  flex: 1; padding: 9px; border-radius: 8px;
  background: white; color: var(--primary); border: 0;
  font-size: 12px; font-weight: 700;
}
.referral-box .store-info {
  font-size: 11px; opacity: 0.85; margin-top: 10px;
  background: rgba(0,0,0,0.15); padding: 6px 10px; border-radius: 6px;
}

.tree-level {
  background: #F9FAFB; border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 8px;
}
.tree-level h4 { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.tree-member {
  display: inline-block; background: white; padding: 5px 10px;
  border-radius: 14px; border: 1px solid var(--border);
  margin: 3px 3px 0 0; font-size: 11px; font-weight: 500;
}
.tree-member small { color: var(--text-muted); }

.txn-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.txn-row:last-child { border: 0; }
.txn-row .desc { flex: 1; }
.txn-row .desc small { color: var(--text-muted); display: block; margin-top: 2px; }
.txn-row .amt { font-weight: 700; color: var(--primary); }

/* ===== ORDER TRACKING ===== */
.track-page { padding: 14px; }
.track-page h1 { font-size: 18px; margin-bottom: 4px; }
.track-page .est-time {
  color: var(--primary); font-weight: 600; font-size: 13px; margin-bottom: 14px;
}
.tracking-steps { padding: 0 14px; }
.step {
  display: flex; gap: 14px; padding: 10px 0;
  position: relative;
}
.step::before {
  content: ''; position: absolute; left: 19px; top: 36px;
  bottom: -10px; width: 2px; background: var(--border);
}
.step:last-child::before { display: none; }
.step.completed::before { background: var(--primary); }
.step-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; z-index: 1; flex-shrink: 0;
}
.step.completed .step-icon { background: var(--primary); }
.step.active .step-icon {
  background: var(--primary); animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(12,131,31,0.2); }
}
.step-info { padding-top: 6px; }
.step-info .step-label { font-size: 13px; font-weight: 600; }
.step-info .step-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== PRODUCT DETAIL ===== */
.pdp-page { padding: 14px; }
.pdp-img-wrap {
  background: white; border-radius: var(--radius);
  padding: 30px; text-align: center; margin-bottom: 14px;
  position: relative;
}
.pdp-img-wrap .pimg-lg { width: 200px; height: 200px; object-fit: contain; margin: 0 auto; }
.pdp-info { background: white; border-radius: var(--radius); padding: 16px; }
.pdp-info h1 { font-size: 18px; margin-bottom: 6px; }
.pdp-info .pdp-weight {
  display: inline-block; background: #F3F4F6;
  padding: 3px 8px; border-radius: 4px; font-size: 11px;
  color: var(--text-muted); margin-bottom: 10px;
}
.pdp-pricing { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.pdp-pricing .price { font-size: 24px; font-weight: 800; color: var(--primary); }
.pdp-pricing .mrp { color: var(--text-muted); text-decoration: line-through; }
.pdp-pricing .disc { background: var(--primary); color: white; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.pdp-earn {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 10px; border-radius: var(--radius-sm); margin: 10px 0;
  font-size: 12px;
}
.pdp-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ===== TABLES ===== */
table.t {
  width: 100%; background: white; border-collapse: collapse;
  border-radius: var(--radius); overflow: hidden; font-size: 12px;
}
table.t th, table.t td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border);
}
table.t th { background: #F9FAFB; font-weight: 600; color: var(--text-muted); font-size: 10px; text-transform: uppercase; }
table.t tr:last-child td { border: 0; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600;
}
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-paid, .badge-approved { background: var(--primary-light); color: var(--primary-dark); }
.badge-delivered { background: var(--primary-light); color: var(--primary-dark); }
.badge-cancelled, .badge-rejected { background: #FEE2E2; color: #991B1B; }
.badge-active { background: var(--primary-light); color: var(--primary-dark); }
.badge-blocked { background: #FEE2E2; color: #991B1B; }

/* ===== ADMIN STYLES ===== */
.admin-body {
  background: #F3F4F6; max-width: 100%; padding-bottom: 0;
}
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #1F2937; color: white;
  padding: 18px 0; flex-shrink: 0;
}
.sidebar .brand {
  padding: 4px 18px 14px; border-bottom: 1px solid #374151;
  margin-bottom: 10px; font-size: 16px; font-weight: 700;
}
.sidebar a {
  display: block; color: #D1D5DB; padding: 10px 18px;
  font-size: 13px; transition: 0.15s;
}
.sidebar a:hover { background: #374151; color: white; }
.sidebar a.active { background: var(--primary); color: white; }
.admin-main { flex: 1; padding: 20px; overflow: auto; }
.admin-main h1 { font-size: 22px; margin-bottom: 16px; }
.admin-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.adm-stat {
  background: white; border-radius: var(--radius); padding: 14px;
  border-left: 4px solid var(--primary);
}
.adm-stat .l { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.adm-stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.adm-stat.warn { border-left-color: #F59E0B; }
.adm-stat.danger { border-left-color: #EF4444; }
.adm-stat.info { border-left-color: #3B82F6; }

.export-btns { display: flex; gap: 6px; margin-bottom: 12px; }
.export-btns .btn { padding: 6px 12px; font-size: 12px; }

@media (max-width: 700px) {
  .sidebar {
    width: 100%; padding: 8px;
    display: flex; flex-wrap: wrap; overflow-x: auto;
  }
  .sidebar .brand { width: 100%; border: 0; padding: 8px; margin: 0; }
  .sidebar a { padding: 6px 12px; font-size: 11px; }
  .admin-shell { flex-direction: column; }
  .admin-main { padding: 12px; }
  body.admin-body { padding-bottom: 0; }
}

/* MLM TREE viz */
.tree-viz {
  background: white; border-radius: var(--radius); padding: 20px;
  overflow-x: auto;
}
.tree-node {
  display: inline-block; background: #F9FAFB;
  border: 2px solid var(--border); padding: 8px 12px;
  border-radius: var(--radius-sm); font-size: 12px;
  margin: 4px; min-width: 120px; cursor: pointer;
  transition: 0.2s;
}
.tree-node:hover { border-color: var(--primary); transform: translateY(-2px); }
.tree-node.lvl-0 { border-color: #1F2937; background: #1F2937; color: white; }
.tree-node.lvl-1 { border-color: var(--primary); background: var(--primary-light); }
.tree-node.lvl-2 { border-color: #3B82F6; background: #DBEAFE; }
.tree-node.lvl-3 { border-color: #F59E0B; background: #FEF3C7; }
.tree-node.lvl-4 { border-color: #7C3AED; background: #EDE9FE; }
.tree-node.lvl-5 { border-color: #DB2777; background: #FCE7F3; }
.tree-node .nm { font-weight: 700; font-size: 13px; }
.tree-node .cd { font-family: monospace; font-size: 10px; opacity: 0.8; }
.tree-node .met { font-size: 10px; margin-top: 4px; }

.tree-row { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 30px; margin-top: 8px; padding-left: 16px; border-left: 2px dashed var(--border); }

@media print {
  .sidebar, .bottom-nav, .search-bar, .store-banner,
  .btn, .export-btns, .add-btn, .qty-ctrl { display: none !important; }
  body { background: white; padding: 0; max-width: 100%; }
  .admin-main { padding: 0; }
  table.t { font-size: 10px; }
}

/* ============================================================
   JustDial-style additions
   ============================================================ */

/* Table polish */
table.t th {
  background: #F9FAFB;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #E8E8E8;
}
table.t tr:hover td { background: #FFFAF5; }

/* Sidebar hover/active in orange */
.sidebar a:hover { background: rgba(255,107,0,0.15); color: white; }
.sidebar a.active { background: var(--primary); color: white; }

/* Role badge buttons */
button.role-badge {
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-width: 1.5px;
  border-style: solid;
}

/* Bottom nav active color matches orange */
.nav-item.active { color: var(--primary); }

/* Stat card values */
.adm-stat .v { color: var(--text); }

/* Tab bar inside admin */
.tab-bar a.active { background: var(--primary); color: white; }

/* Compact admin nav (.admin-nav) — not currently used but available */
.admin-nav a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; border-radius: 8px; color: #374151; text-decoration: none; }
.admin-nav a:hover, .admin-nav a.active { background: var(--primary-light); color: var(--primary); }

/* Load bar component for staff load panel */
.load-bar { background: #F3F4F6; height: 6px; border-radius: 3px; overflow: hidden; }
.load-bar > div { height: 100%; transition: width 0.3s; }

/* ============================================================
   ADMIN UI POLISH (v7)
   ============================================================ */
.admin-body {
  background: #F7F8FA;
  font-feature-settings: "tnum";
}
.admin-main h1 {
  font-size: 24px; font-weight: 700; color: #111827;
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.sidebar {
  background: linear-gradient(180deg, #1F2937 0%, #111827 100%);
  border-right: 1px solid #0F172A;
  width: 230px;
}
.sidebar .brand {
  background: rgba(255,255,255,0.04);
  font-size: 18px; letter-spacing: 0.3px;
  padding: 16px 18px;
}
.sidebar a {
  margin: 2px 8px; padding: 9px 12px;
  border-radius: 8px; font-size: 13px;
  display: flex; align-items: center;
  transition: all 0.15s;
}
.sidebar a:hover { background: rgba(255,255,255,0.08); color: white; transform: translateX(2px); }
.sidebar a.active {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: white; box-shadow: 0 4px 12px rgba(255,107,0,0.3);
}

.admin-grid {
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.adm-stat {
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.15s, box-shadow 0.15s;
}
.adm-stat:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.adm-stat .l { font-size: 10px; color: #6B7280; }
.adm-stat .v { font-size: 24px; font-weight: 800; color: #111827; }

.panel {
  background: white; border-radius: 12px; padding: 18px;
  border: 1px solid var(--border); margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.panel h3 {
  font-size: 15px; color: #111827; font-weight: 700;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

table.t { font-size: 13px; }
table.t th {
  padding: 10px 12px; background: #F9FAFB;
  color: #6B7280; font-size: 10px; font-weight: 700;
}
table.t td {
  padding: 12px; border-bottom: 1px solid #F3F4F6;
}
table.t tr:hover td { background: #FFFAF5; }

.btn { transition: all 0.15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-primary:hover { box-shadow: 0 4px 12px rgba(255,107,0,0.4); }
.btn-danger:hover { box-shadow: 0 4px 12px rgba(229,62,62,0.3); }

.tab-bar {
  background: white; border-radius: 12px; padding: 6px;
  border: 1px solid var(--border); margin-bottom: 14px;
  display: flex; gap: 4px;
}
.tab-bar a {
  padding: 10px 16px; border-radius: 8px;
  font-weight: 600; font-size: 13px;
  color: var(--text-muted); transition: 0.15s;
  flex: 0 0 auto;
}
.tab-bar a.active {
  background: var(--primary); color: white;
  box-shadow: 0 2px 6px rgba(255,107,0,0.3);
}

.export-btns { gap: 8px; margin-bottom: 16px; align-items: center; }
.export-btns .btn { padding: 7px 14px; font-size: 12px; font-weight: 600; }

.flash {
  border-radius: 10px; padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; margin: 14px 0;
}
.flash.ok { background: linear-gradient(90deg, #DCFCE7, #BBF7D0); color: #14532D; border-left: 4px solid var(--success); }
.flash.error { background: linear-gradient(90deg, #FEE2E2, #FECACA); color: #7F1D1D; border-left: 4px solid var(--danger); }

.badge {
  padding: 3px 10px; border-radius: 12px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
}

@media (min-width: 768px) {
  body.admin-body { max-width: 100%; padding-bottom: 0; }
  .admin-main { padding: 24px; }
}

/* User-facing polish */
.cart-line { transition: 0.15s; }
.cart-line:active { transform: scale(0.99); }

.order-status-ribbon {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.order-status-ribbon.cancelled { background: #FEE2E2; color: #991B1B; }
.order-status-ribbon.returned { background: #DBEAFE; color: #1E40AF; }
.order-status-ribbon.delivered { background: #DCFCE7; color: #166534; }
.order-status-ribbon.pending, .order-status-ribbon.packing, .order-status-ribbon.packed { background: #FEF3C7; color: #92400E; }
.order-status-ribbon.dispatched, .order-status-ribbon.out_for_delivery { background: #FFF3EC; color: var(--primary-dark); }

/* Cancel/return buttons on user orders page */
.order-actions {
  display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.order-actions .btn-mini {
  padding: 5px 10px; font-size: 11px; border-radius: 6px;
  border: 1px solid var(--border); background: white;
  font-weight: 600; cursor: pointer;
}
.order-actions .btn-mini.danger { color: var(--danger); border-color: #FCA5A5; }
.order-actions .btn-mini:hover { background: var(--primary-light); }

/* Modal generic */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-box {
  background: white; border-radius: 16px; padding: 24px;
  width: 380px; max-width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}

/* ============================================================
   PREMIUM POLISH v8 (real images, soft gradients)
   ============================================================ */

/* Smooth image loading */
.pimg, img[loading="lazy"] {
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Product cards — premium feel */
.product-card {
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.18s, box-shadow 0.18s;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.product-img-wrap {
  background: linear-gradient(135deg, #FAFAFA 0%, #F3F4F6 100%);
  overflow: hidden;
}

/* Search bar — premium gradient */
.search-bar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 2px 8px rgba(255,107,0,0.2);
}

/* Bottom nav — subtle glow */
.bottom-nav {
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

/* Store banner gradient */
.store-banner {
  background: linear-gradient(135deg, var(--primary-light) 0%, #FFF8F0 100%);
}

/* Hero banner — premium glass effect */
.hero-banner {
  background: linear-gradient(135deg, #FFE5D0 0%, #FFD0A8 100%);
  box-shadow: 0 4px 12px rgba(255,107,0,0.12);
  border: 1px solid rgba(255,107,0,0.1);
}
.hero-banner h2 { color: #B45309; }
.hero-banner p { color: #92400E; }

/* Wallet card — premium gradient */
.wallet-card {
  background: linear-gradient(135deg, var(--primary) 0%, #FFA500 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(255,107,0,0.25);
}
.wallet-card .label { opacity: 0.9; color: white; }
.wallet-card .amt { color: white; }

/* Referral box — premium */
.referral-box {
  background: linear-gradient(135deg, var(--primary), #FFA500);
  box-shadow: 0 8px 24px rgba(255,107,0,0.25);
}

/* Category pill — premium */
.category-pill {
  background: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  font-weight: 600;
}
.category-pill.active {
  box-shadow: 0 4px 10px rgba(255,107,0,0.3);
}

/* Category tiles in grid */
.cat-tile {
  background: linear-gradient(135deg, #EAF4FE 0%, #DDEDF9 100%);
  transition: transform 0.15s;
}
.cat-tile:active { transform: scale(0.96); }

/* Big touch-friendly buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 4px 12px rgba(255,107,0,0.25);
  font-weight: 700;
  letter-spacing: 0.3px;
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(255,107,0,0.4); }

/* Panel — premium */
.panel {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border: 1px solid var(--border-light);
}

/* Cart line item — premium */
.cart-line {
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid var(--border-light);
}

/* Form inputs — premium */
input[type="text"], input[type="number"], input[type="tel"], input[type="email"], input[type="password"], input[type="url"], textarea, select {
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(255,107,0,0.1);
}

/* Address card radio glow */
.addr-radio { transition: all 0.15s; }
.addr-radio:hover { transform: translateY(-1px); }

/* ============================================================
   v9: PREMIUM EMOJI CARDS (Instamart-look even without real photos)
   ============================================================ */

/* Emoji-as-image — premium gradient backgrounds per category feel */
.pimg-emoji {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8F4EE 60%, #FFF1E0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  border-radius: 12px;
  box-shadow: inset 0 -8px 16px rgba(255,107,0,0.05);
  position: relative;
  overflow: hidden;
}
.pimg-emoji::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6) 0%, transparent 50%);
  pointer-events: none;
}
.pimg-emoji.pimg-lg { font-size: 96px; }

/* Real image: clean white background, subtle shadow */
img.pimg, img.pimg-lg {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  background: white;
  display: block;
}

/* Product cards — bigger, more premium */
.product-card {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #F0F0F0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: transform 0.18s, box-shadow 0.18s;
}
.product-card:active { transform: scale(0.98); }
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

/* Product image wrapper */
.product-img-wrap {
  position: relative;
  padding: 8px;
  background: linear-gradient(180deg, #FAFBFC 0%, #F5F5F5 100%);
}

/* Add button — Instamart pill */
.add-btn {
  position: absolute;
  bottom: 8px; right: 8px;
  background: white;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  padding: 6px 16px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: 0.15s;
}
.add-btn:hover { background: var(--primary); color: white; }

/* Bestseller / discount badges (top-left/right) */
.badge-bestseller,
.badge-discount {
  position: absolute;
  top: 8px;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-bestseller {
  left: 8px;
  background: linear-gradient(135deg, #1E40AF, #2563EB);
  color: white;
}
.badge-discount {
  right: 8px;
  background: linear-gradient(135deg, #DC2626, #EF4444);
  color: white;
}

/* Product info */
.product-info { padding: 8px 12px 12px; }
.product-weight {
  display: inline-block;
  font-size: 9px;
  background: #F3F4F6;
  color: #6B7280;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
  font-weight: 600;
}
.product-name {
  font-size: 12px;
  font-weight: 600;
  color: #1F2937;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  min-height: 31px;
}
.product-pricing { display: flex; align-items: baseline; gap: 6px; }
.product-pricing .price {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
}
.product-pricing .mrp {
  font-size: 11px;
  color: #9CA3AF;
  text-decoration: line-through;
}

/* Earn pill — green, prominent */
.earn-pill {
  display: inline-block;
  background: linear-gradient(135deg, #DCFCE7, #BBF7D0);
  color: #14532D;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
}

/* ============================================================
   v10 — BANNERS + PREMIUM UI
   ============================================================ */

/* Carousel */
/* ===== BANNER CAROUSEL (mobile-fixed) ===== */
.banner-carousel {
  margin: 12px 0 16px;
  position: relative;
  padding: 0 14px;
}
.banner-track {
  display: flex;
  flex-wrap: nowrap;          /* prevent vertical stacking */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  border-radius: 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;            /* iOS Safari fix */
  scroll-snap-align: center;
  display: block;             /* image fills */
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 1;        /* 1200×400 ratio */
  background: #F3F4F6;
}
.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* fill banner, no distortion */
  display: block;
}
.banner-slide .banner-text {
  position: absolute;
  left: 16px;
  bottom: 16px;
  right: 16px;
  z-index: 2;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  pointer-events: none;
}
.banner-slide h3 {
  font-size: 18px; font-weight: 800;
  line-height: 1.15;
  margin-bottom: 2px;
  color: white;
}
.banner-slide p {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.95);
}
.banner-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}
.banner-dots {
  display: flex; justify-content: center;
  gap: 5px; margin-top: 10px;
}
.banner-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #D1D5DB;
  transition: all 0.3s;
  cursor: pointer;
}
.banner-dot.active {
  background: var(--primary);
  width: 18px;
  border-radius: 3px;
}

/* Banner slot (between sections) — 2:1 wide rectangle */
.banner-slot {
  display: block;
  position: relative;
  margin: 14px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  aspect-ratio: 2 / 1;        /* 600×300 ratio */
  background: #F3F4F6;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.18s, box-shadow 0.18s;
}
.banner-slot:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
.banner-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.banner-slot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 55%);
  pointer-events: none;
}
.banner-slot .banner-slot-text {
  position: absolute;
  left: 14px;
  bottom: 12px;
  right: 14px;
  color: white;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 2;
}
.banner-slot h4 {
  font-size: 15px; font-weight: 800;
  line-height: 1.2;
  margin-bottom: 2px;
  color: white;
}
.banner-slot p {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.95);
}

/* Premium category tile redesign */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 14px;
}
.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 6px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
  border-radius: 14px;
  text-decoration: none;
  color: #1F2937;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  border: 1px solid #F3F4F6;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.cat-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
  border-color: var(--primary);
}
.cat-tile .cat-emoji {
  font-size: 32px;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}
.cat-tile .cat-name {
  font-size: 11px;
  line-height: 1.2;
}

/* Cart total box — premium */
.cart-total-box {
  background: white;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin: 8px 0;
}
.cart-total-box .total-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: #4B5563;
}
.cart-total-box .total-line.grand {
  border-top: 1px dashed #E5E7EB;
  margin-top: 4px;
  padding-top: 10px;
  font-size: 15px;
  color: #111827;
  font-weight: 700;
}
.cart-total-box .total-line.grand b {
  font-size: 18px;
  color: var(--primary);
  font-weight: 800;
}

/* Section header — premium */
.section { margin: 18px 0; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  margin-bottom: 10px;
}
.section-title {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.3px;
}
.see-all {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(7, 1fr); }
  .banner-slide h3 { font-size: 28px; }
  .banner-slide p { font-size: 14px; }
  .banner-slot h4 { font-size: 20px; }
}

/* ===== v11 — Flash strip + category images ===== */
.flash-strip-wrap {
  margin: 0 0 14px;
  padding: 0 14px;
  overflow: hidden;
}
.flash-strip-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.flash-strip-track::-webkit-scrollbar { display: none; }
.flash-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 220px;
  scroll-snap-align: start;
  border-radius: 10px;
  padding: 8px 12px;
  text-decoration: none;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.15s;
}
.flash-strip:active { transform: scale(0.97); }
.flash-strip img {
  width: 36px; height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.flash-strip strong {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  display: block;
}
.flash-strip span {
  font-size: 10px;
  color: #4B5563;
  line-height: 1.3;
}

/* Category image (replaces emoji when set) */
.cat-tile .cat-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
