:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --brand: #0b64ff;
  --brand-dark: #004ecc;
  --dark: #0f172a;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  max-width: 1040px;
  margin: 0 auto;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--brand);
}

.brand-logo img { height: 28px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-links a:hover { color: var(--text); text-decoration: underline; }

.main-wrap {
  flex: 1 0 auto;
  padding: 24px 0 96px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.store-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.store-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.store-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-verified { background: #dbeafe; color: #1d4ed8; }
.badge-manual { background: #f1f5f9; color: #334155; }
.badge-pdf { background: #ede9fe; color: #6d28d9; }
.badge-physical { background: #fef3c7; color: #92400e; }
.badge-service { background: #dcfce7; color: #166534; }
.badge-appointment { background: #fce7f3; color: #9d174d; }

.social-row { display: flex; flex-wrap: wrap; gap: 8px; }

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.pill-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  -webkit-overflow-scrolling: touch;
}

.filter-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.filter-pill.active {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 720px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.product-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.product-thumb {
  width: 76px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: #f1f5f9;
}

.product-title {
  margin: 4px 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.product-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.price-wrap { display: flex; align-items: baseline; gap: 6px; }
.price-now { font-size: 1.2rem; font-weight: 800; }
.price-mrp { font-size: 0.85rem; color: #94a3b8; text-decoration: line-through; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary { background: var(--dark); color: #fff; }
.btn-primary:hover { background: #1e293b; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; }
.btn-block { width: 100%; }

.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--dark);
  color: #fff;
  padding: 12px 16px;
  z-index: 40;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.18);
}

.cart-bar-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 16px; }
}

.modal-panel {
  background: var(--surface);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 20px;
}

@media (min-width: 640px) {
  .modal-panel { border-radius: 16px; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.input, .textarea, .select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
  background: #fff;
}

.textarea { min-height: 76px; resize: vertical; }

.banner {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.banner-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #fde68a; }
.banner-success { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.banner-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  margin: 12px 0;
}

.qr-box svg { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 8px; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.flex-gap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.data-table th, table.data-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}
table.data-table th { color: var(--muted); font-weight: 600; }

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 18px 0;
  font-size: 0.82rem;
  color: var(--muted);
}
