/* ===================== CSS VARIABLES ===================== */
:root {
  --bg:        #0d0d0d;
  --surface:   #161616;
  --surface2:  #1f1f1f;
  --border:    #2a2a2a;
  --accent:    #b5f13b;       /* electric lime-green */
  --accent-dk: #8dc22a;
  --text:      #f0f0f0;
  --text-muted:#888;
  --red:       #ff4d4d;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --radius:    10px;
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

/* ===================== RESET ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: max(env(safe-area-inset-top, 0), 0);
  padding-bottom: max(env(safe-area-inset-bottom, 0), 8px);
}
a { color: inherit; text-decoration: none; }
input, select, button { font-family: var(--font-body); outline: none; }

/* ===================== LOADER ===================== */
#loader {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-logo {
  font-family: var(--font-display);
  font-size: 64px;
  color: var(--accent);
  display: block;
  letter-spacing: 4px;
  animation: pulse 1s ease-in-out infinite alternate;
}
@keyframes pulse { to { opacity: 0.4; } }
.loader-bar {
  width: 160px; height: 3px;
  background: var(--border);
  border-radius: 99px;
  margin: 16px auto 0;
  overflow: hidden;
}
.loader-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  animation: loadBar 1.2s ease-in-out forwards;
}
@keyframes loadBar { from { width: 0 } to { width: 100% } }

/* ===================== HEADER ===================== */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,13,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-gs {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--accent);
  line-height: 1;
  letter-spacing: 2px;
}
.logo-text { display: flex; flex-direction: column; }
.logo-main {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--text);
}
.logo-sub { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; }

nav { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.nav-btn:hover { color: var(--text); border-color: var(--border); }
.nav-btn.active { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.admin-login-btn { color: var(--text-muted); font-size: 12px; }
.cart-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.cart-btn:hover { border-color: var(--accent); color: var(--accent); }
.badge {
  background: var(--accent);
  color: var(--bg);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

.inline-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 8px;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.45);
  animation: chatBadgePulse 1.6s infinite;
}

@keyframes chatBadgePulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(255, 77, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0); }
}

/* ===================== SECTIONS ===================== */
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===================== SHOP HERO ===================== */
.shop-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.shop-hero::before {
  content: 'GS';
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(200px, 30vw, 400px);
  color: rgba(181, 241, 59, 0.04);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  letter-spacing: 20px;
  white-space: nowrap;
}
.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 500;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 100px);
  line-height: 0.95;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 16px;
}
.hero-sub { color: var(--text-muted); font-size: 15px; font-weight: 300; }

/* ===================== FILTER BAR ===================== */
.filter-bar {
  max-width: 1280px;
  margin: 28px auto 0;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 99px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.filter-chip:hover { color: var(--text); border-color: #444; }
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.discover-toolbar {
  position: sticky;
  top: 70px;
  z-index: 80;
  background: rgba(13,13,13,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.search-sort-row {
  max-width: 1280px;
  margin: 12px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

.sort-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sort-wrap label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sort-wrap select {
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  font-size: 13px;
}

.shop-meta {
  max-width: 1280px;
  margin: 10px auto 0;
  padding: 0 24px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ===================== PRODUCTS GRID ===================== */
.products-grid {
  max-width: 1280px;
  margin: 18px auto 60px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* Skeleton */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 320px;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0%,100% { opacity: 0.4 }
  50%      { opacity: 0.8 }
}

/* Product card */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
}
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(181,241,59,0.1);
}
.product-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface2);
}
.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  inset: 0;
  display: block;
}
.product-card-img.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--border);
  background: var(--surface2);
}
.product-card-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-category {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.product-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.product-desc {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
  margin-top: 4px;
  min-height: 38px;
}
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  gap: 8px;
}
.product-price {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--text);
  letter-spacing: 0.5px;
}
.product-price span { font-size: 14px; font-family: var(--font-body); color: var(--text-muted); }
.add-to-cart-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.add-to-cart-btn:hover { background: var(--accent-dk); }
.out-of-stock-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,77,77,0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 16px; }

/* ===================== CART SIDEBAR ===================== */
.cart-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  backdrop-filter: blur(4px);
}
.cart-overlay.open { display: block; }

.cart-sidebar {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 360px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.cart-header h2 { font-family: var(--font-display); font-size: 24px; letter-spacing: 1px; }
.close-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { border-color: var(--red); color: var(--red); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 12px; color: var(--accent); font-weight: 500; margin-top: 2px; }
.cart-remove {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 26px; height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cart-remove:hover { background: var(--red); border-color: var(--red); color: #fff; }
.cart-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 14px; }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}
.cart-stock-warning {
  margin-bottom: 10px;
  border: 1px solid rgba(255, 77, 77, 0.4);
  background: rgba(255, 77, 77, 0.12);
  color: #ff8080;
  font-size: 12px;
  line-height: 1.45;
  border-radius: 10px;
  padding: 9px 10px;
}
.cart-stock-warning.info {
  border-color: rgba(255, 180, 0, 0.35);
  background: rgba(255, 180, 0, 0.10);
  color: #f6c36a;
}
.cart-total { font-size: 16px; color: var(--text-muted); margin-bottom: 14px; }
.cart-total strong { color: var(--text); font-size: 20px; }
.pay-btn {
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.5px;
}
.pay-btn:hover { background: var(--accent-dk); }

/* ===================== AUTH CARD ===================== */
.auth-card {
  max-width: 400px;
  margin: 80px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow);
}
.auth-card h2 { font-family: var(--font-display); font-size: 32px; letter-spacing: 2px; margin-bottom: 6px; }
.auth-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }

/* ===================== FORMS ===================== */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 600; letter-spacing: 0.5px; color: var(--text-muted); text-transform: uppercase; }
.form-group input,
.form-group select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  transition: var(--transition);
  width: 100%;
}
.form-group input::placeholder { color: #555; }
.form-group select option { background: var(--surface2); }
.form-group input:focus,
.form-group select:focus { border-color: var(--accent); background: var(--bg); }
.field-invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(255,77,77,0.16);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.submit-btn {
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 13px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.submit-btn:hover { background: var(--accent-dk); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cancel-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  width: 100%;
}
.cancel-btn:hover { border-color: var(--text-muted); color: var(--text); }

.error-msg { color: var(--red); font-size: 13px; margin-bottom: 12px; min-height: 18px; }
.form-actions { display: flex; flex-direction: column; gap: 8px; }

/* ===================== DASHBOARD ===================== */
.dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}
.dash-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.dash-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1px;
}
.dash-tab:hover { color: var(--text); }
.dash-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.dash-panel { display: none; }
.dash-panel.active { display: block; }

.dash-split {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  align-items: start;
}

/* Product form card */
.product-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  position: sticky;
  top: 90px;
}
.product-form-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1px;
  margin-bottom: 20px;
  color: var(--text);
}

/* Product list panel */
.product-list-panel h3 {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.count-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
}

.admin-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-product-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}
.admin-product-row:hover { border-color: #333; }
.adr-img {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
}
.adr-info { flex: 1; min-width: 0; }
.adr-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adr-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.adr-price { font-family: var(--font-display); font-size: 18px; color: var(--accent); flex-shrink: 0; }
.adr-actions { display: flex; gap: 6px; }
.edit-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.edit-btn:hover { border-color: var(--accent); color: var(--accent); }
.delete-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.delete-btn:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* Orders */
.orders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.orders-header h3 { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; }
.refresh-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.refresh-btn:hover { color: var(--text); border-color: #444; }

.orders-list { display: flex; flex-direction: column; gap: 12px; }
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.order-card:hover { border-color: #333; }
.order-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.order-ref { font-size: 11px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.order-customer { font-size: 15px; font-weight: 600; }
.order-contact { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.order-amount { font-family: var(--font-display); font-size: 26px; color: var(--accent); }
.order-items { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.order-items li { margin-left: 16px; margin-top: 3px; }
.order-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.status-paid    { background: rgba(181,241,59,0.15); color: var(--accent); border: 1px solid rgba(181,241,59,0.3); }
.status-pending { background: rgba(255,180,0,0.12); color: #ffb400; border: 1px solid rgba(255,180,0,0.3); }
.status-shipped { background: rgba(59,130,246,0.12); color: #3b82f6; border: 1px solid rgba(59,130,246,0.3); }
.status-delivered { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }

.order-date { font-size: 11px; color: var(--text-muted); }
.status-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  margin-left: auto;
}
.status-select:focus { border-color: var(--accent); }



/* ===================== ADMIN LOGOUT BUTTON ===================== */
.admin-logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.adminLogout:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ===================== CHECKOUT MODAL ===================== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 5000;
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
body.chat-modal-open {
  overflow: hidden;
  height: 100dvh;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  margin: 20px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.25s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-header h3 { font-family: var(--font-display); font-size: 24px; letter-spacing: 1px; }
.modal-total { font-size: 15px; color: var(--text-muted); margin-bottom: 16px; }
.modal-total strong { color: var(--text); font-size: 20px; }

.delivery-quote-card {
  background: linear-gradient(180deg, rgba(181,241,59,0.08), rgba(255,255,255,0));
  border: 1px solid rgba(181,241,59,0.2);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 10px 0 18px;
}
.delivery-quote-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.delivery-quote-line strong {
  color: var(--text);
  font-size: 14px;
  text-align: right;
}
.delivery-quote-line.total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 10px;
  color: var(--text);
}
.delivery-quote-line.total strong {
  color: var(--accent);
  font-size: 18px;
}
.delivery-quote-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.track-chat-actions {
  margin-top: 16px;
}
.chat-launch-btn {
  width: 100%;
}

.recent-chat-card {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(181,241,59,0.2);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(181,241,59,0.08), rgba(255,255,255,0));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.recent-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.recent-chat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}
.recent-chat-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.saved-chat-list {
  display: grid;
  gap: 10px;
}
.saved-chat-item {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: var(--transition);
}
.saved-chat-item:hover {
  border-color: rgba(181,241,59,0.4);
  transform: translateY(-1px);
}
.saved-chat-open {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.saved-chat-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.saved-chat-open:focus-visible,
.saved-chat-item-action:focus-visible,
.saved-chat-item-delete:focus-visible {
  outline: 2px solid rgba(181,241,59,0.65);
  outline-offset: 2px;
}
.saved-chat-item-main strong {
  font-size: 14px;
  color: var(--text);
}
.saved-chat-item-main small {
  font-size: 12px;
  color: var(--text-muted);
}
.saved-chat-item-action {
  border: 1px solid rgba(181,241,59,0.32);
  background: rgba(181,241,59,0.12);
  color: var(--accent);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.saved-chat-item-delete {
  border: 1px solid rgba(255,77,77,0.34);
  background: rgba(255,77,77,0.1);
  color: var(--red);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.saved-chat-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-modal {
  max-width: 560px;
  width: min(560px, calc(100vw - 24px));
}
.chat-modal {
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 760px);
  max-height: min(82vh, 760px);
  overflow: hidden;
  min-height: 0;
  overscroll-behavior: contain;
}

@supports (height: 100dvh) {
  .chat-modal {
    max-height: min(86dvh, 760px);
  }
}
.chat-modal-open #trackSection .track-map-card,
.chat-modal-open #trackSection .track-chat-actions {
  display: none !important;
}
.chat-context {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 14px;
}
.chat-tools {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 10px;
}
.chat-delete-btn {
  background: transparent;
  border: 1px solid rgba(255,77,77,0.5);
  color: var(--red);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.chat-delete-btn:hover {
  background: rgba(255,77,77,0.12);
  border-color: var(--red);
}
.chat-messages {
  flex: 1;
  background:
    radial-gradient(circle at top left, rgba(181,241,59,0.035), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
    var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 280px;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 40px 18px;
}
.chat-message {
  max-width: min(78%, 520px);
  border-radius: 16px 16px 16px 6px;
  padding: 8px 11px 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(0,0,0,0.14);
  position: relative;
  width: fit-content;
}
.chat-message::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: translateY(50%) rotate(45deg);
  opacity: 0.92;
  border-radius: 2px;
  pointer-events: none;
}
.chat-message.customer {
  align-self: flex-end;
  border-color: rgba(181,241,59,0.20);
  background: rgba(181,241,59,0.10);
  border-radius: 16px 16px 6px 16px;
}
.chat-message.customer::after {
  right: -4px;
  background: rgba(181,241,59,0.12);
}
.chat-message.rider,
.chat-message.admin {
  background: rgba(255,255,255,0.04);
}
.chat-message.rider {
  align-self: flex-end;
  border-color: rgba(181,241,59,0.20);
  background: rgba(181,241,59,0.10);
  border-radius: 16px 16px 6px 16px;
}
.chat-message.rider::after {
  right: -4px;
  background: rgba(181,241,59,0.10);
}
.chat-message.admin {
  align-self: flex-start;
}
.chat-message.admin::after {
  left: -4px;
  background: rgba(255,255,255,0.04);
}
.chat-message.system {
  max-width: 100%;
  align-self: center;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  border-style: dashed;
  border-radius: 999px;
  text-align: center;
}
.chat-message.customer .chat-message-meta,
.chat-message.customer .chat-message-body {
  text-align: right;
}
.chat-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
  letter-spacing: 0.2px;
}
.chat-message-body {
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13,13,13,0), rgba(13,13,13,0.85));
  position: sticky;
  bottom: 0;
  z-index: 2;
  align-items: center;
  flex-shrink: 0;
}
.chat-compose input {
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 14px;
  border-radius: 999px;
  font-size: 14px;
  min-height: 48px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  -webkit-appearance: none;
  -webkit-user-select: text;
  user-select: text;
  appearance: none;
}
.chat-send-btn {
  min-width: 110px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
}

.chat-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.chat-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===================== TOAST ===================== */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9000;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { border-color: var(--accent); color: var(--accent); }
.toast.error   { border-color: var(--red); color: var(--red); }

/* ===================== FOOTER ===================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  padding: 28px 24px 36px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr auto 1fr;
  gap: 20px;
  align-items: start;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 10px;
}
.site-footer p,
.footer-notes {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a {
  color: var(--text);
  font-size: 13px;
  padding: 4px 0;
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-notes {
  display: grid;
  gap: 8px;
}
.footer-notes strong {
  color: var(--text);
}

/* ===================== POLICY PAGES ===================== */
.page-shell {
  min-height: calc(100vh - 70px);
  padding: 40px 16px 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-card {
  width: min(1080px, 100%);
  padding: 42px 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  box-shadow: var(--shadow);
  text-align: center;
}
.page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.page-info-card {
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
}
.page-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 8px;
}
.page-link {
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
}
.page-text {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}
.policy-copy {
  max-width: 860px;
  margin: 0 auto;
  text-align: left;
  display: grid;
  gap: 18px;
}
.policy-copy h2 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--accent);
}
.policy-copy p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 15px;
}
.policy-copy a,
.page-text a {
  color: var(--accent);
  font-weight: 600;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .dash-split { grid-template-columns: 1fr; }
  .product-form-card { position: static; }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
    padding: 0 20px;
  }

  .product-card-body {
    padding: 16px;
  }

  .product-footer {
    padding: 12px 14px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0 12px;
    height: 64px;
    gap: 8px;
  }
  .logo-text { display: none; }
  nav {
    gap: 6px;
    max-width: 100%;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  nav::-webkit-scrollbar { display: none; }
  .nav-btn {
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 8px;
    min-height: 38px;
    flex: 0 0 auto;
    touch-action: manipulation;
  }
  .cart-btn {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 38px;
    flex: 0 0 auto;
    touch-action: manipulation;
  }
  .cart-sidebar { width: 100%; }
  .auth-card {
    max-width: 100%;
    margin: 24px 12px;
    padding: 24px 16px;
  }
  .form-row { grid-template-columns: 1fr; }
  .shop-hero { padding: 34px 16px 30px; }
  .hero-eyebrow { font-size: 10px; letter-spacing: 2px; }
  .hero-title { font-size: clamp(40px, 16vw, 58px); margin-bottom: 10px; }
  .hero-sub { font-size: 13px; line-height: 1.5; }
  .filter-bar {
    margin: 16px auto 0;
    padding: 0 16px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-chip { flex: 0 0 auto; }
  .discover-toolbar { top: 64px; }
  .search-sort-row { grid-template-columns: 1fr; }
  .search-sort-row { margin-top: 10px; padding: 0 16px; gap: 10px; }
  .shop-meta { padding: 0 16px; }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin: 12px auto 40px;
    padding: 0 14px;
  }
  .product-card-media { aspect-ratio: 4 / 5; }
  .product-card-body { padding: 12px; }
  .product-name { font-size: 15px; }
  .product-desc { font-size: 11px; min-height: 32px; }
  .product-price { font-size: 20px; }
  .product-footer { padding: 10px 12px; }
  .add-to-cart-btn { padding: 9px 12px; font-size: 11px; }
  .sort-wrap select { border-radius: var(--radius); }
  .dashboard { padding: 20px 16px 40px; }
  .order-card-top { flex-direction: column; }
  .modal {
    margin: 10px;
    padding: 24px 18px;
    border-radius: 14px;
  }
  .toast {
    width: calc(100% - 20px);
    max-width: 420px;
    white-space: normal;
    text-align: center;
  }
  .track-wrapper { margin: 20px auto; padding: 0 14px 40px; }
  .track-search-card { padding: 22px 16px; }
  .track-search-card h2 { font-size: 26px; }
  .track-input-row { flex-direction: column; }
  .track-go-btn { width: 100%; }
  .track-info-grid { grid-template-columns: 1fr; }
  .track-map { height: 280px; }
  .track-legend { gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
  .recent-chat-card {
    align-items: stretch;
    flex-direction: column;
  }
  .recent-chat-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .saved-chat-item {
    align-items: flex-start;
    flex-direction: column;
  }
  .saved-chat-item-main {
    width: 100%;
  }
  .saved-chat-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .saved-chat-item-action,
  .saved-chat-item-delete {
    min-height: 38px;
    padding: 8px 14px;
  }
  .modal-overlay#chatOverlay {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    overscroll-behavior: contain;
  }
  .chat-modal {
    width: 100%;
    max-width: none;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    padding: 18px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
  }
  @supports (height: 100dvh) {
    .chat-modal {
      height: 100dvh;
      max-height: 100dvh;
      min-height: 100dvh;
    }
  }
  .chat-context {
    margin-bottom: 0;
  }
  .chat-tools {
    margin: 0;
  }
  .chat-messages {
    min-height: 0;
    height: 100%;
    max-height: none;
    -webkit-overflow-scrolling: touch;
  }
  .chat-compose {
    grid-template-columns: 1fr auto;
    position: relative;
    bottom: auto;
    background: var(--bg);
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 4px);
    margin-top: 8px;
    width: 100%;
    gap: 8px;
    padding-left: 0;
    padding-right: 0;
  }
  .chat-compose input {
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 11px 12px;
  }
  .form-group input,
  .form-group select,
  .form-group textarea,
  .track-input-row input,
  .search-bar input {
    font-size: 16px;
    width: 100%;
    max-width: 100%;
  }
  .chat-send-btn {
    min-width: 50px;
    min-height: 44px;
    width: auto;
    padding: 0 12px;
    font-size: 14px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .site-footer {
    padding: 24px 16px 32px;
  }
  .footer-brand {
    font-size: 24px;
  }
  .page-shell {
    padding: 24px 12px 40px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .page-card {
    padding: 28px 18px;
  }
  .page-grid {
    grid-template-columns: 1fr;
  }
  .policy-copy h2 {
    font-size: 24px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .chat-modal {
    max-height: 94vh;
    padding: 14px;
    min-height: 0;
  }
  @supports (height: 100dvh) {
    .chat-modal {
      max-height: 94dvh;
    }
  }
  .chat-context {
    font-size: 12px;
  }
  .chat-messages {
    min-height: 140px;
  }
  .chat-compose input {
    padding: 11px 12px;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 0 12px;
  }

  .product-card-body {
    padding: 10px;
  }

  .product-name {
    font-size: 14px;
  }

  .product-price {
    font-size: 18px;
  }

  .product-footer {
    padding: 8px 10px;
    gap: 6px;
  }

  .add-to-cart-btn {
    padding: 8px 10px;
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 12px;
    margin: 10px auto 36px;
  }

  .product-card-body {
    padding: 10px;
  }

  .product-name {
    font-size: 14px;
  }

  .product-desc {
    font-size: 11px;
    min-height: 28px;
  }

  .product-price {
    font-size: 18px;
  }

  .product-footer {
    padding: 8px 10px;
    gap: 6px;
  }

  .add-to-cart-btn {
    padding: 8px 10px;
    font-size: 10px;
  }

  .shop-hero {
    padding: 28px 12px 24px;
  }

  .hero-title {
    font-size: clamp(32px, 14vw, 48px);
    margin-bottom: 8px;
  }

  .hero-sub {
    font-size: 12px;
  }
}

@media (max-width: 320px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 10px;
    margin: 8px auto 32px;
  }

  .product-card-body {
    padding: 8px;
  }

  .product-name {
    font-size: 13px;
  }

  .product-desc {
    font-size: 11px;
    min-height: 0;
  }

  .product-price {
    font-size: 16px;
  }

  .product-footer {
    padding: 6px 8px;
    gap: 4px;
  }

  .add-to-cart-btn {
    padding: 6px 8px;
    font-size: 10px;
  }

  .shop-hero {
    padding: 24px 10px 20px;
  }

  .hero-title {
    font-size: clamp(28px, 12vw, 40px);
    margin-bottom: 6px;
  }

  .hero-sub {
    font-size: 11px;
  }
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #444; }


/* ===================== AUTH TABS ===================== */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.auth-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1px;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.info-msg { color: var(--accent); font-size: 13px; margin-bottom: 12px; }

/* ===================== RIDER DASHBOARD HEADER ===================== */
.rider-dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}
.rider-welcome {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 1px;
}
.rider-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ===================== AVAILABILITY TOGGLE ===================== */
.availability-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 99px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ===================== LOGOUT BTN ===================== */
.logout-btn {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.logout-btn:hover { background: var(--red); color: #fff; }

/* ===================== NEW ORDER BANNER ===================== */
.new-order-banner {
  background: rgba(181,241,59,0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 12px 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  animation: pulse-border 1.5s ease-in-out infinite;
}
@keyframes pulse-border {
  0%,100% { box-shadow: 0 0 0 0 rgba(181,241,59,0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(181,241,59,0); }
}
.new-order-banner button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ===================== RIDER ORDER CARD ===================== */
.rider-order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  transition: var(--transition);
}
.rider-order-card:hover { border-color: #333; }
.rider-order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.rider-order-amount {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--accent);
}
.rider-order-items {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.rider-order-items li { margin-left: 16px; margin-top: 3px; }
.rider-order-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.accept-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.accept-btn:hover { background: var(--accent-dk); }
.reject-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.reject-btn:hover { border-color: var(--red); color: var(--red); }
.view-map-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.view-map-btn:hover { border-color: var(--accent); color: var(--accent); }
.delivered-btn {
  background: #10b981;
  color: white;
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.delivered-btn:hover { background: #059669; }

/* ===================== RIDERS LIST (ADMIN) ===================== */
.riders-list { display: flex; flex-direction: column; gap: 12px; }
.rider-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  transition: var(--transition);
}
.rider-card:hover { border-color: #333; }
.rider-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2);
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.rider-card-info { flex: 1; min-width: 200px; }
.rider-card-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.rider-card-meta { font-size: 12px; color: var(--text-muted); line-height: 1.8; }
.rider-card-meta span { display: block; }
.rider-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.approve-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.approve-btn:hover { background: var(--accent-dk); }
.reject-rider-btn {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.reject-rider-btn:hover { background: var(--red); color: #fff; }
.view-docs-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.view-docs-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ===================== GOOGLE MAPS PICKER ===================== */
.map-picker {
  width: 100%;
  height: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 10px;
  background: var(--surface2);
  overflow: hidden;
}
.location-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.location-btn:hover { border-color: var(--accent); color: var(--accent); }
.location-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}
.location-set { color: var(--accent) !important; }

/* ===================== RIDER MODAL ACTIONS ===================== */
.rider-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ===================== STATUS BADGES (extra) ===================== */
.status-assigned  { background: rgba(59,130,246,0.12); color: #3b82f6; border: 1px solid rgba(59,130,246,0.3); }
.status-delivered { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.status-approved  { background: rgba(181,241,59,0.15); color: var(--accent); border: 1px solid rgba(181,241,59,0.3); }
.status-rejected  { background: rgba(255,77,77,0.12); color: var(--red); border: 1px solid rgba(255,77,77,0.3); }
.status-pending   { background: rgba(255,180,0,0.12); color: #ffb400; border: 1px solid rgba(255,180,0,0.3); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
  .rider-dash-header { flex-direction: column; }
  .rider-controls { flex-wrap: wrap; }
}



/* ===================== SIZE PREVIEW ON PRODUCT CARD ===================== */
.product-sizes-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.size-dot {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

/* ===================== SIZE PICKER MODAL ===================== */
.size-modal {
  max-width: 480px;
}
.size-product-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 20px;
}
.size-product-preview img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.size-product-img-placeholder {
  width: 60px;
  height: 60px;
  background: var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.size-option {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-width: 52px;
  text-align: center;
}
.size-option:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.size-option.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.size-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}
.size-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===================== CART ITEM SIZE ===================== */
.cart-item-size {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* Make checkout modal scrollable on small screens */
.checkout-modal {
  max-height: 90vh;
  overflow-y: auto;
}


/* ===================== TRACK ORDER ===================== */
.track-wrapper {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 24px 60px;
}
.track-search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  margin-bottom: 28px;
  text-align: center;
}
.track-search-card h2 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.track-input-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.track-input-row input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-body);
}
.track-input-row input:focus { border-color: var(--accent); outline: none; }
.track-go-btn { width: auto; padding: 12px 28px; }

/* Status card */
.track-status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.track-status-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.track-ref-label { font-size: 11px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.track-ref-value { font-family: var(--font-display); font-size: 20px; letter-spacing: 1px; color: var(--accent); }
.track-status-badge {
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
.track-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.track-info-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.track-info-item span { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.track-info-item strong { font-size: 14px; color: var(--text); }

/* Map card */
.track-map-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.track-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.track-map-header h3 { font-family: var(--font-display); font-size: 20px; letter-spacing: 1px; }
.track-map { width: 100%; height: 360px; }
.track-legend {
  display: flex;
  gap: 20px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.legend-dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.legend-dot.rider    { background: #3b82f6; }
.legend-dot.customer { background: #b5f13b; }

/* ETA */
.track-eta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.eta-label { font-size: 11px; color: var(--text-muted); }
.eta-time  { font-family: var(--font-display); font-size: 28px; color: var(--accent); letter-spacing: 1px; }

/* Responsive */
@media (max-width: 600px) {
  .track-info-grid { grid-template-columns: 1fr; }
  .track-input-row { flex-direction: column; }
  .track-go-btn { width: 100%; }
  .track-map { height: 260px; }
}


/* ===================== SEARCH BAR ===================== */
.search-bar-wrapper {
  max-width: 1280px;
  margin: 16px auto 0;
  padding: 0 24px;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 10px 20px;
  transition: var(--transition);
  max-width: 560px;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181,241,59,0.1);
}
.search-icon { color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  min-width: 0;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-clear {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  padding: 0;
}
.search-clear:hover { background: var(--red); border-color: var(--red); color: #fff; }

@media (max-width: 640px) {
  .search-bar-wrapper { padding: 0 16px; }
  .search-bar { max-width: 100%; }
}
/* ===================== IPHONE NOTCH & HIGH DPI OPTIMIZATION ===================== */
@supports (padding: max(0px)) {
  @media (max-width: 1024px) {
    body {
      padding-top: max(8px, env(safe-area-inset-top));
      padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    .page-shell {
      padding-left: max(12px, env(safe-area-inset-left));
      padding-right: max(12px, env(safe-area-inset-right));
    }
    
    .header-inner {
      padding-left: max(12px, env(safe-area-inset-left));
      padding-right: max(12px, env(safe-area-inset-right));
    }
    
    /* iOS HIG: 44x44px minimum touch targets */
    .submit-btn, .nav-btn, .chat-send-btn, button,
    input[type="button"], input[type="submit"], .action-btn {
      min-height: 44px;
      min-width: 44px;
    }
    
    /* Prevent iOS zoom: form inputs must be 16px font */
    input[type="text"], input[type="email"], input[type="password"],
    input[type="tel"], input[type="number"], textarea, select {
      min-height: 44px;
      font-size: 16px !important;
      padding: 10px 12px;
    }
    
    input:focus, textarea:focus, select:focus {
      font-size: 16px !important;
      zoom: 1;
    }
  }
}

/* High DPI screens (460+ ppi like iPhone 12 Pro) */
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 450dpi) {
  .submit-btn, button, .nav-btn {
    min-height: 48px;
    min-width: 48px;
  }
}
