/* ================================================================
   BazaarMap.in — Global App CSS
   Mobile-first | Bootstrap 5 override + custom design system
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@600;700&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --brand-primary:   #f7b731;
  --brand-secondary: #fc5c65;
  --brand-dark:      #1a1a2e;
  --brand-darker:    #0f0f1a;
  --brand-card:      #16213e;
  --brand-border:    #2a2a5a;
  --brand-muted:     #6c757d;
  --brand-success:   #20c997;
  --brand-info:      #4fc3f7;

  --text-primary:    #f0f0f8;
  --text-secondary:  #a0a0c0;
  --text-muted:      #6060a0;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-sm:  0 2px 10px rgba(0,0,0,0.3);
  --shadow-md:  0 6px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.5);

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset / Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--brand-darker);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: #ffd166; text-decoration: none; }

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--brand-dark); }
::-webkit-scrollbar-thumb { background: var(--brand-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-primary); }

/* ─── Typography ────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--text-primary); }

/* ─── Card ──────────────────────────────────────────────────── */
.bm-card {
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-brand {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #111;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(247,183,49,0.25);
  cursor: pointer;
}
.btn-brand:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(247,183,49,0.4);
  color: #111;
}
.btn-brand:active { transform: translateY(0); }

.btn-brand-outline {
  background: transparent;
  border: 2px solid var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0.7rem 1.5rem;
  transition: var(--transition);
}
.btn-brand-outline:hover {
  background: var(--brand-primary);
  color: #111;
}

/* ─── Form Inputs ───────────────────────────────────────────── */
.bm-input {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  width: 100%;
  transition: var(--transition);
  outline: none;
}
.bm-input::placeholder { color: var(--text-muted); }
.bm-input:focus {
  border-color: var(--brand-primary);
  background: rgba(247,183,49,0.05);
  box-shadow: 0 0 0 3px rgba(247,183,49,0.15);
}
.bm-input.is-invalid { border-color: var(--brand-secondary); }

.bm-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.bm-input-group {
  position: relative;
  margin-bottom: 1.2rem;
}
.bm-input-group .input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}
.bm-input-group .bm-input { padding-left: 2.6rem; }
.bm-input-group .input-icon-right {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}
.bm-input-group .bm-input.has-icon-right { padding-right: 2.6rem; }

/* ─── Alerts / Flash ────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: none;
  font-weight: 500;
}
.alert-success { background: #0d2e1e; color: #5cffa0; }
.alert-danger   { background: #2e0d0d; color: #ff6b6b; }
.alert-warning  { background: #2e220d; color: #fcd34d; }
.alert-info     { background: #0d1e2e; color: #7dd3fc; }

/* ─── Badges ────────────────────────────────────────────────── */
.bm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  letter-spacing: 0.04em;
}
.bm-badge-primary   { background: rgba(247,183,49,0.15); color: var(--brand-primary); }
.bm-badge-success   { background: rgba(32,201,151,0.15); color: var(--brand-success); }
.bm-badge-danger    { background: rgba(252,92,101,0.15);  color: var(--brand-secondary); }
.bm-badge-info      { background: rgba(79,195,247,0.15);  color: var(--brand-info); }

/* ─── Divider ───────────────────────────────────────────────── */
.bm-divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 0;
}
.bm-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--brand-border);
}
.bm-divider span {
  position: relative;
  background: var(--brand-card);
  padding: 0 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Spinner ───────────────────────────────────────────────── */
.bm-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Auth Layout ───────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 80% 10%, rgba(247,183,49,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 10% 90%, rgba(252,92,101,0.08) 0%, transparent 60%),
    var(--brand-darker);
}

.auth-card {
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  font-family: 'Poppins', sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.auth-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.8rem;
}

/* Role toggle tabs */
.role-tabs {
  display: flex;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.5rem;
  gap: 4px;
}
.role-tab {
  flex: 1;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.role-tab.active {
  background: linear-gradient(135deg, var(--brand-primary), #fcd34d);
  color: #111;
  box-shadow: 0 2px 8px rgba(247,183,49,0.3);
}
.role-tab:hover:not(.active) { color: var(--text-primary); background: rgba(255,255,255,0.06); }

/* OTP boxes */
.otp-inputs { display: flex; gap: 0.6rem; justify-content: center; margin: 1rem 0; }
.otp-box {
  width: 48px; height: 56px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: var(--transition);
}
.otp-box:focus {
  border-color: var(--brand-primary);
  background: rgba(247,183,49,0.06);
  box-shadow: 0 0 0 3px rgba(247,183,49,0.15);
}

/* ─── Navbar ────────────────────────────────────────────────── */
.bm-navbar {
  background: rgba(22,33,62,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--brand-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 0;
}
.bm-navbar .brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Location pill ─────────────────────────────────────────── */
.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--brand-border);
  border-radius: 99px;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  max-width: 200px;
  overflow: hidden;
}
.location-pill:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.location-pill .loc-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Cart badge ────────────────────────────────────────────── */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand-primary);
  color: #111;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.cart-btn:hover { background: #fcd34d; transform: scale(1.04); }
.cart-count {
  background: var(--brand-secondary);
  color: #fff;
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ─── Product Card ──────────────────────────────────────────── */
.product-card {
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-primary); }
.product-card-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: rgba(255,255,255,0.03); }
.product-card-body { padding: 0.8rem; }
.product-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.2rem; }
.product-price { font-size: 1rem; font-weight: 700; color: var(--brand-primary); }
.product-mrp  { font-size: 0.78rem; color: var(--text-muted); text-decoration: line-through; margin-left: 4px; }
.product-discount { font-size: 0.72rem; font-weight: 700; color: var(--brand-success); }

/* ─── Shop Card ─────────────────────────────────────────────── */
.shop-card {
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: var(--transition);
  cursor: pointer;
}
.shop-card:hover { border-color: var(--brand-primary); transform: translateX(4px); }
.shop-logo {
  width: 56px; height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.shop-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.shop-meta { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Utilities ─────────────────────────────────────────────── */
.text-brand   { color: var(--brand-primary) !important; }
.text-muted-bm { color: var(--text-muted) !important; }
.bg-card      { background: var(--brand-card) !important; }
.border-brand { border-color: var(--brand-border) !important; }
.rounded-bm   { border-radius: var(--radius-md) !important; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 576px) {
  .auth-card { padding: 2rem 1.2rem; }
  .bm-card   { padding: 1.2rem; }
}
