/* ============================================================
   MILES MOTORS — Global Stylesheet
   Palette: Royal Navy / Deep Crimson / Ivory
   Fonts: Cormorant Garamond (display) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── VARIABLES ── */
:root {
  --beige:       #F4F1EB;
  --beige-dark:  #E8E3D8;
  --beige-card:  #EEEADE;
  --charcoal:    #1A2340;
  --charcoal-mid:#243058;
  --sage:        #8B2635;
  --sage-light:  #C4909A;
  --sage-dark:   #6B1E2B;
  --warm-white:  #FAF8F5;
  --text-muted:  #6B6B78;
  --border:      rgba(26,35,64,0.13);
  --shadow:      0 4px 24px rgba(26,35,64,0.10);
  --shadow-lg:   0 12px 48px rgba(26,35,64,0.18);
  --radius:      16px;
  --radius-sm:   10px;
  --radius-pill: 999px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--beige);
  color: var(--charcoal);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--beige); }
::-webkit-scrollbar-thumb { background: var(--beige-dark); border-radius: 3px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 68px;
  background: var(--beige);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-logo img {
  height: 70px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--charcoal);
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--sage);
  transition: width 0.3s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-container {
  display: flex;
  align-items: center;
  background: var(--charcoal);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  gap: 8px;
}
.searchbar {
  background: transparent;
  border: none;
  outline: none;
  color: var(--warm-white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  width: 160px;
}
.searchbar::placeholder { color: rgba(250,248,245,0.45); }
.search-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  padding: 0;
}
.search-btn svg { fill: var(--warm-white); width: 15px; height: 15px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--charcoal);
  color: var(--beige);
  padding: 3rem 2rem 1.5rem;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-brand p {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: rgba(244,241,235,0.55);
  max-width: 260px;
  line-height: 1.7;
}
.footer-logo-img { height: 52px; filter: brightness(0) invert(1); opacity: 0.85; }
.footer-col h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--sage-light);
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col ul li a {
  font-size: 0.85rem;
  color: rgba(244,241,235,0.6);
  transition: color 0.2s;
}
.footer-col ul li a:hover { color: var(--beige); }
.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(244,241,235,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(244,241,235,0.35);
}

/* ============================================================
   BUTTONS (global)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
}
.btn-dark {
  background: var(--charcoal);
  color: var(--warm-white);
}
.btn-dark:hover {
  background: var(--charcoal-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-sage {
  background: var(--sage);
  color: #fff;
}
.btn-sage:hover {
  background: var(--sage-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,38,53,0.30);
}
.btn-outline {
  background: transparent;
  color: var(--charcoal);
  border: 1.5px solid var(--charcoal);
}
.btn-outline:hover {
  background: var(--charcoal);
  color: var(--warm-white);
}

/* ============================================================
   CAR CARD (shared between listings + detail)
   ============================================================ */
.car-card {
  background: var(--beige-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.car-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.car-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.car-card-body {
  padding: 1rem 1.1rem 1.2rem;
}
.car-card-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(26,35,64,0.09);
  color: var(--charcoal-mid);
  margin-bottom: 0.5rem;
}
.car-card-badge.used {
  background: var(--beige-dark);
  color: var(--text-muted);
}
.car-card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  color: var(--charcoal);
}
.car-card-specs {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.car-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.car-card-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sage);
}
.car-card-cta {
  font-size: 0.75rem;
  padding: 7px 16px;
}

/* ============================================================
   FILTER BAR (shared)
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  max-width: 1200px;
  margin: 0 auto 2rem;
}
.filter-bar .dropdown { position: relative; }
.dropdown-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 18px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--charcoal);
  transition: background 0.2s, border-color 0.2s;
}
.dropdown-toggle:hover {
  background: var(--beige-dark);
  border-color: var(--charcoal);
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 160px;
  z-index: 999;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dropdown-menu li {
  padding: 9px 16px;
  font-size: 0.85rem;
  transition: background 0.15s;
  cursor: pointer;
  color: var(--charcoal);
}
.dropdown-menu li:hover { background: var(--beige-dark); }
.price-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.price-range label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.price-range input {
  width: 110px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--beige);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.825rem;
  color: var(--charcoal);
  outline: none;
  transition: border-color 0.2s;
}
.price-range input:focus { border-color: var(--sage); }
#filterBtn {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--charcoal);
  color: var(--warm-white);
  font-size: 0.825rem;
  font-weight: 500;
  transition: background 0.2s;
}
#filterBtn:hover { background: var(--sage); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0;
}
.pagination button {
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--charcoal);
  transition: all 0.2s;
}
.pagination button:hover {
  background: var(--charcoal);
  color: var(--warm-white);
  border-color: var(--charcoal);
}
#page-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 28px;
  text-align: center;
  color: var(--charcoal);
}

/* ============================================================
   SECTION UTILITY
   ============================================================ */
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.5rem;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--charcoal);
}
.section-title em { font-style: italic; color: var(--sage); }

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.anim-fade-up  { animation: fadeUp  0.7s ease both; }
.anim-fade-in  { animation: fadeIn  0.6s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.45s; }
.delay-5 { animation-delay: 0.6s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; }
  .filter-bar { border-radius: var(--radius); padding: 12px; }
  .price-range { flex-wrap: wrap; }
}

/* ============================================================
   HAMBURGER MENU (mobile)
   ============================================================ */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Animate to X when open */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* MOBILE NAV DRAWER */
.mobile-nav {
  display: none;
  position: fixed;
  top: 68px;
  left: 0; right: 0;
  background: var(--beige);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(26,35,64,0.1);
  flex-direction: column;
  gap: 0;
  transform: translateY(-10px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.mobile-nav.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}
.mobile-nav a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--charcoal);
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
  transition: color 0.2s, padding-left 0.2s;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover {
  color: var(--sage);
  padding-left: 8px;
}
.mobile-nav a.active { color: var(--sage); }

@media (max-width: 900px) {
  .hamburger { display: flex; }
  .nav-links  { display: none; }
  .searchbar  { width: 100px; }
}
@media (max-width: 480px) {
  .search-container { display: none; }
}

/* ============================================================
   MOBILE — single column car cards
   ============================================================ */
@media (max-width: 540px) {
  #car-list {
    grid-template-columns: 1fr !important;
  }
  .car-card-img {
    height: 220px;
  }
}

/* ============================================================
   FLOATING WHATSAPP (all pages)
   ============================================================ */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 58px;
  height: 58px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(37,211,102,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 32px rgba(37,211,102,0.55);
}
.whatsapp-float svg { width: 30px; height: 30px; fill: #fff; }
.whatsapp-float-tooltip {
  position: absolute;
  right: 68px;
  background: var(--charcoal);
  color: var(--warm-white);
  font-size: 0.78rem;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.whatsapp-float:hover .whatsapp-float-tooltip { opacity: 1; }

@media (max-width: 768px) {
  .whatsapp-float { bottom: 20px; right: 20px; width: 52px; height: 52px; }
  .whatsapp-float svg { width: 26px; height: 26px; }
}