/* ==========================================================================
   BANIYA BAZAAR — DESIGN SYSTEM (base.css)
   Premium Blue Theme — Pan-India Multivendor + Instant Delivery Platform
   ========================================================================== */

@import url('mobile-site.css');
@import url('chatbot.css');
@import url('delivery.css');

:root {
  /* ---- Brand Core ---- */
  --navy-950: #061833;
  --navy-900: #0A1F44;
  --navy-800: #0F2E63;
  --navy-700: #15397A;
  --navy-600: #1B4FCC;
  --blue-600: #1B4FCC;
  --blue-500: #2E62E8;
  --blue-400: #5B82F0;
  --blue-100: #E8EEFC;
  --blue-50:  #F3F6FE;

  --red-700: #B8241E;
  --red-600: #E0312A;
  --red-500: #EF4138;
  --red-100: #FCE6E4;
  --red-50:  #FDF2F1;

  --gold-600: #B8860F;
  --gold-500: #D4A437;
  --gold-400: #E6BE5C;
  --gold-100: #FAF1DC;

  --green-700: #0F7A37;
  --green-600: #16A34A;
  --green-100: #E5F7EC;

  --amber-600: #D97706;
  --amber-100: #FEF3E2;

  /* ---- Neutrals ---- */
  --gray-950: #0B1120;
  --gray-900: #111827;
  --gray-800: #1F2937;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white: #FFFFFF;

  /* ---- Surfaces / Semantic ---- */
  --bg-page: #F4F7FC;
  --bg-surface: #FFFFFF;
  --bg-shell: #EEF2FA;
  --border-soft: #E3E9F5;
  --border-default: #D6DEEF;

  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-400);
  --text-on-dark: #EAF0FF;
  --text-on-dark-muted: #9FB3E0;

  /* ---- Typography ---- */
  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  /* ---- Radii ---- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(10, 31, 68, 0.06);
  --shadow-md: 0 4px 14px rgba(10, 31, 68, 0.09);
  --shadow-lg: 0 12px 32px rgba(10, 31, 68, 0.14);
  --shadow-card-hover: 0 8px 24px rgba(15, 46, 99, 0.16);

  /* ---- Layout ---- */
  --container-max: 1320px;
  --sidebar-w: 264px;
  --topbar-h: 64px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-base: 220ms;
}

/* ---- Reset ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
ul, ol { list-style: none; }
svg { display: block; flex-shrink: 0; }

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.25;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .container { padding: 0 16px; width: 100%; max-width: 100%; }
}

/* ---- Utility ---- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.mt-8{margin-top:8px;} .mt-16{margin-top:16px;} .mt-24{margin-top:24px;} .mt-32{margin-top:32px;}
.mb-8{margin-bottom:8px;} .mb-16{margin-bottom:16px;} .mb-24{margin-bottom:24px;} .mb-32{margin-bottom:32px;}

.section { padding: 48px 0; }
@media (max-width: 768px) { .section { padding: 32px 0; } }

/* Prevent grid children from forcing horizontal overflow via min-content sizing */
[style*="display:grid"] > *, [style*="display: grid"] > * { min-width: 0; }
.hero-grid > *, .cat-grid > *, .product-row > *, .quickstat-grid > *, .news-grid > *,
.account-shell > *, .stat-grid > *, .cart-grid > *, .address-grid > *, .listing-shell > *,
.pd-grid > *, .dash-stat-grid > *, .dash-grid-2 > * { min-width: 0; }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.section-head h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
}
.section-head .view-all {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--blue-600);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-600);
  background: var(--blue-100);
  padding: 5px 12px;
  border-radius: var(--r-pill);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--blue-600);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(27, 79, 204, 0.28);
}
.btn-primary:hover { background: var(--navy-700); }

.btn-accent {
  background: var(--red-600);
  color: var(--white);
}
.btn-accent:hover { background: var(--red-700); }

.btn-white {
  background: var(--white);
  color: var(--navy-900);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.btn-white:hover { background: #f8fafc; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-default);
  color: var(--navy-800);
}
.btn-outline:hover { border-color: var(--blue-600); color: var(--blue-600); background: var(--blue-50); }

.btn-outline-light {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.35);
  color: var(--white);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--navy-800);
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-success { background: var(--green-600); color: var(--white); }
.btn-success:hover { background: var(--green-700); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 30px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 38px; height: 38px; padding: 0; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Badges / Tags ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  line-height: 1.6;
}
.badge-blue { background: var(--blue-100); color: var(--blue-600); }
.badge-red { background: var(--red-100); color: var(--red-600); }
.badge-green { background: var(--green-100); color: var(--green-700); }
.badge-gold { background: var(--gold-100); color: var(--gold-600); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-amber { background: var(--amber-100); color: var(--amber-600); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.pill-tag {
  font-size: 11px; font-weight: 700; color: var(--white);
  padding: 3px 8px; border-radius: var(--r-sm);
  position: absolute; top: 10px; left: 10px; z-index: 2;
}
.pill-tag.off { background: var(--red-600); }
.pill-tag.new { background: var(--green-600); }
.pill-tag.bestseller { background: var(--gold-600); }
.pill-tag.popular { background: var(--blue-600); }

/* ---- Card ---- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-size: 13px; font-weight: 600; color: var(--gray-700);
}
.field label .opt { color: var(--text-muted); font-weight: 400; }
.input, .select, .textarea {
  border: 1.5px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: 14px;
  background: var(--white);
  color: var(--text-primary);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  width: 100%;
}
.input::placeholder { color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3.5px var(--blue-100);
  outline: none;
}
.textarea { resize: vertical; min-height: 90px; font-family: var(--font-body); }
.input-icon-wrap { position: relative; }
.input-icon-wrap .input { padding-left: 40px; }
.input-icon-wrap svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-muted);
}
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.field-hint { font-size: 12px; color: var(--text-muted); }
.field-error { font-size: 12px; color: var(--red-600); }

.checkbox-row, .radio-row {
  display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--gray-700);
}
.checkbox-row input, .radio-row input { width: 16px; height: 16px; accent-color: var(--blue-600); }

.switch {
  position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink:0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--gray-300); border-radius: var(--r-pill);
  transition: background var(--t-fast) var(--ease);
}
.switch .track::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: var(--white); border-radius: 50%; transition: transform var(--t-fast) var(--ease);
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .track { background: var(--blue-600); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border-soft); }
table.data-table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 13.5px; min-width: 640px; }
.data-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 700; padding: 12px 16px; background: var(--gray-50);
  border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); color: var(--gray-700); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--t-fast) var(--ease); }
.data-table tbody tr:hover { background: var(--blue-50); }
.data-table .cell-strong { color: var(--gray-900); font-weight: 600; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---- Star rating ---- */
.stars { display: inline-flex; align-items: center; gap: 2px; color: var(--gold-500); }
.stars svg { width: 13px; height: 13px; }
.rating-pill {
  display: inline-flex; align-items: center; gap: 3px; background: var(--green-600);
  color: var(--white); font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-sm);
}
.rating-pill svg { width: 10px; height: 10px; fill: var(--white); }

/* ---- Breadcrumb ---- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--blue-600); }
.breadcrumb svg { width: 12px; height: 12px; }
.breadcrumb .current { color: var(--text-secondary); font-weight: 500; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 25, 53, 0.55);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--r-xl); max-width: 460px; width: 100%;
  box-shadow: var(--shadow-lg); padding: 28px; position: relative; max-height: 90vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 18px; right: 18px; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--gray-100); color: var(--gray-600);
}
.modal-close:hover { background: var(--gray-200); }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state .icon-wrap {
  width: 72px; height: 72px; border-radius: 50%; background: var(--blue-50); color: var(--blue-400);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.empty-state .icon-wrap svg { width: 32px; height: 32px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; max-width: 320px; margin: 0 auto 18px; }

/* ---- Toast ---- */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--navy-900); color: var(--white); padding: 13px 18px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s var(--ease);
}
.toast svg { width: 17px; height: 17px; color: var(--green-600); flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Tooltip-ish chip ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--gray-100); font-size: 12.5px; font-weight: 600; color: var(--gray-700); border: 1px solid var(--border-soft);
}
.chip.active { background: var(--blue-600); color: var(--white); border-color: var(--blue-600); }

/* ---- Skeleton loader ---- */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%);
  background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: var(--r-sm);
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- Animations ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.5s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
