/* Light theme, mobile-first */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --muted: #4b5563;
  --text: #0f172a;
  --stroke: rgba(0, 0, 0, 0.08);
  --accent: #0f172a;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --max: 1160px;
  --transition: 150ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding: 0;
  margin: 0;
  width: 100%;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; border-radius: var(--radius); }

.page { max-width: 100%; margin: 0; padding: 0; display: grid; gap: 0; }
section { display: grid; gap: 14px; }

section:not(.hero) {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  padding: 28px 18px;
}

@media (min-width: 960px) {
  section:not(.hero) {
    padding: 32px 28px;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

section:not(.hero) .card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}

.button.ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--stroke);
}

.button:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(15,23,42,0.15); }

.input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
}

label { font-weight: 600; font-size: 14px; }

.hero label { color: #ffffff; }

.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Header */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--stroke);
  width: 100%;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.02em; }
.brand > span:not(.brand-mark) { display: none; }

.brand-mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f172a, #1f2937);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(15,23,42,0.18);
}

.menu-button {
  min-width: 64px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
}

.menu-button:hover {
  background: #f8fafc;
  border-color: var(--accent);
}

/* Navigation Drawer */
.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 100vw);
  background: #ffffff;
  border-left: 1px solid var(--stroke);
  box-shadow: -16px 0 50px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 22;
  overflow-y: auto;
}

.menu-panel.open {
  transform: translateX(0);
}

/* Menu Header */
.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}

.menu-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.menu-close {
  min-width: 64px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
  position: relative;
}

.menu-close:hover {
  background: #f8fafc;
  border-color: var(--accent);
  transform: none;
}

.menu-close::before {
  content: none;
}

/* Menu List */
.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.admin-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
}
.admin-toggle-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-toggle-label {
  font-weight: 600;
  font-size: 14px;
}
.admin-toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}
.admin-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.admin-toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #d1d5db;
  transition: 0.2s;
  border-radius: 999px;
}
.admin-toggle-switch .slider::before {
  position: absolute;
  content: '';
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}
.admin-toggle-switch input:checked + .slider {
  background: #0f172a;
}
.admin-toggle-switch input:checked + .slider::before {
  transform: translateX(18px);
}

.menu-item {
  display: block;
}

.menu-item a {
  display: block;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
}

.menu-item a:hover {
  background: #e2e8f0;
  border-color: var(--stroke);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transform: translateX(-2px);
}

.menu-item a:active {
  background: #cbd5e1;
  transform: scale(0.98);
}

/* Current page highlight */
.menu-item.active a {
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  border-left: 3px solid #3b82f6;
}

/* Auth-specific items */
.menu-item.auth-required {
  display: none;
}

.menu-item.guest-only {
  display: none;
}

/* Backdrop overlay */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  z-index: 21;
  backdrop-filter: blur(2px);
}

.backdrop.show {
  opacity: 1;
  pointer-events: all;
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .menu-panel {
    width: 100vw;
    padding: 20px 16px;
  }
}

@media (min-width: 768px) {
  .menu-panel {
    width: 380px;
  }
}

/* Hero and filters */
.hero {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  min-height: 60vh;
  margin: 0;
  padding: 104px 16px 140px; /* extra bottom space so native selects have room to open downward */
  background: url("../assets - Copy/hero.png") center/cover no-repeat;
  border: none;
  border-radius: 0;
  /* Allow dropdowns to render outside the hero card (fixes clipped selects) */
  overflow: visible;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,14,26,0.72) 0%, rgba(10,14,26,0.45) 45%, rgba(10,14,26,0.15) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max);
}
.hero-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 18px 18px 16px;
  max-width: 1040px;
  margin: 0 auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
}
.hero-title {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
  color: #ffffff;
  margin: 0 0 6px 0;
}
.hero-subtitle {
  color: rgba(255,255,255,0.88);
  font-size: 15px;
  line-height: 1.4;
  margin: 0 0 12px 0;
}

.hero-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 0 0 12px 0;
}
.hero-card label { color: rgba(255,255,255,0.92); font-size: 13px; }
.hero-card .input,
.hero-card select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}
.hero-card .input::placeholder { color: rgba(255,255,255,0.8); }
.hero-card select { background: rgba(255,255,255,0.12); }
.hero-card select option {
  color: #0f172a;
  background: #ffffff;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.hero-actions .button {
  flex: 1 1 180px;
  min-width: 180px;
  text-align: center;
}

.hero .button {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.45);
}

.hero .location-btn {
  width: 48px;
  padding: 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
}

.hero .location-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.location-btn.is-loading {
  position: relative;
  color: transparent;
}

.location-btn.is-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.flash {
  outline: 2px solid rgba(15, 23, 42, 0.35);
  outline-offset: 2px;
  transition: outline 200ms ease;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 12px 16px;
  background: #0f172a;
  color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 30;
  font-weight: 600;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hero .button:not(.ghost) {
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
}

.hero .button.ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.7);
}

.filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.categories {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 12px;
  background: #f7f9fc;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 12px 32px rgba(15,23,42,0.06);
}
.categories::-webkit-scrollbar {
  height: 6px;
}
.categories::-webkit-scrollbar-thumb {
  background: #cfd5df;
  border-radius: 999px;
}
.categories::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 767px) {
  .header-inner { padding: 10px 14px; }

  .hero {
    padding: 86px 12px 28px;
    min-height: 58vh;
    align-items: flex-start;
  }
  .hero-card {
    padding: 14px 14px 12px;
    background: rgba(255,255,255,0.12);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  }
  .hero-title { font-size: 22px; line-height: 1.2; margin-bottom: 4px; }
  .hero-subtitle { font-size: 13px; line-height: 1.35; margin-bottom: 10px; }
  .hero-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .hero-card label { font-size: 12px; }
  .hero-card .input,
  .hero-card select {
    padding: 9px 11px;
    font-size: 13px;
  }
  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .hero-actions .button {
    flex: 1 1 140px;
    min-width: 140px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .categories {
    scrollbar-width: auto;
    padding-bottom: 4px;
  }
  .categories::-webkit-scrollbar {
    height: 8px;
  }
  .categories::-webkit-scrollbar-thumb {
    background: #b6c0cf;
  }
}

.category-filter-bar {
  width: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--stroke);
  padding: 12px 18px 8px;
  max-width: 100%;
  margin: 0;
}

.category-filter-bar .categories {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .category-filter-bar {
    padding: 16px 28px 12px;
  }
  
  .category-filter-bar .categories {
    padding: 12px 14px;
  }
}



.category-chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d8deea;
  background: #ffffff;
  color: #334155;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.category-chip.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(15,23,42,0.16);
}

.vehicle-card { display: grid; gap: 10px; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); }
.vehicle-card:hover { transform: translateY(-2px); box-shadow: 0 16px 42px rgba(15,23,42,0.14); }
.vehicle-card:active { transform: translateY(0); }
.vehicle-card-link { display: grid; gap: 10px; color: inherit; text-decoration: none; }
.vehicle-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; }
.vehicle-price { font-weight: 800; }
.badge { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--stroke); font-size: 12px; color: var(--muted); background: #f8fafc; }

.vehicle-card-image {
  width: 100%;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2f7;
  aspect-ratio: 3 / 2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}

.vehicle-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (min-width: 900px) {
  .vehicle-card-image {
    aspect-ratio: 16 / 9;
  }
}

.table { width: 100%; border-collapse: collapse; }
.table td, .table th { border: 1px solid var(--stroke); padding: 10px; text-align: left; }

.list { list-style: none; display: grid; gap: 8px; color: var(--muted); }

.muted { color: var(--muted); }

@media (min-width: 960px) {
  body { padding: 0; }
  .page { padding-top: 0; gap: 0; }
}
