/* ============================================================
   responsive.css — Mobile-First Responsive System
   ArabCar — Full rebuild targeting phones first
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, video, svg { max-width: 100%; display: block; }

/* Prevent iOS zoom on form focus — ALL inputs must be 16px */
input, select, textarea, button { font-size: 16px; max-width: 100%; }

/* Safe container padding */
.container {
  width: 100%;
  padding-left: clamp(16px, 5vw, 32px);
  padding-right: clamp(16px, 5vw, 32px);
}

/* ============================================================
   PHONE BASE — ≤ 767px (mobile-first, applied to all small screens)
   ============================================================ */
@media (max-width: 767px) {

  /* ── Spacing tokens scaled down for mobile ── */
  :root {
    --space-xs:  3px;
    --space-sm:  6px;
    --space-md:  12px;
    --space-lg:  20px;
    --space-xl:  36px;
    --space-2xl: 52px;
  }

  /* ── Header ── */
  .nav         { display: none; }
  .header__cta { display: none; }
  .hamburger   { display: flex; }
  .header__inner { height: 56px; gap: 10px; }
  .lang-switcher { margin-left: auto; margin-right: 8px; }
  .lang-btn { padding: 3px 8px; font-size: 0.72rem; }

  /* ── Hero ── */
  .hero { min-height: 100svh; }
  .hero__content {
    gap: 28px;           /* was 96px — the big offender */
    padding-top: 72px;
    padding-bottom: 32px;
  }
  .hero__eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    margin-bottom: 6px;
  }
  .hero__title {
    font-size: clamp(2rem, 10.5vw, 2.9rem); /* was clamp(3.5rem…) */
    line-height: 1.0;
    letter-spacing: 0.01em;
  }
  .hero__sub {
    font-size: 0.88rem;
    line-height: 1.6;
    margin-top: 8px;
    max-width: 100%;
  }

  /* Hero actions — stack vertically, full width */
  .hero__actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
  }
  .hero__actions .btn,
  .hero__actions .whatsapp-section-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 14px 20px;
    font-size: 0.95rem;
  }
  .btn--lg { padding: 14px 20px; font-size: 0.95rem; }

  /* Hero stats — horizontal row, tighter */
  .hero__stats {
    gap: 20px;
    flex-wrap: nowrap;
    align-items: flex-start;
  }
  .stat__num  { font-size: 2rem; }
  .stat__plus { font-size: 1.4rem; }
  .stat__label { font-size: 0.65rem; letter-spacing: 0.06em; margin-top: 2px; }

  /* ── Section spacing ── */
  section { padding: 40px 0; }
  .section-title { font-size: clamp(1.5rem, 7.5vw, 2rem); }
  .section-sub { font-size: 0.88rem; }
  .section-header { margin-bottom: 24px; }

  /* ── Booking bar ── */
  .booking-bar { padding: 24px 0; }
  .booking-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .booking-form__submit {
    grid-column: span 1;
    width: 100%;
    justify-content: center;
  }
  .booking-form__field label {
    font-size: 0.67rem;
    letter-spacing: 0.08em;
  }
  .booking-form__field select,
  .booking-form__field input {
    padding: 12px 14px;
    font-size: 16px; /* no iOS zoom */
    border-radius: 10px;
  }

  /* ── Fleet controls ── */
  .fleet__controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .search-box {
    width: 100%;
    min-width: unset;
    flex: unset;
    padding: 10px 14px;
  }
  .search-box input { font-size: 16px; }
  .filter-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .filter-pills::-webkit-scrollbar { display: none; }
  .pill { white-space: nowrap; padding: 7px 14px; font-size: 0.78rem; }
  .sort-box { width: 100%; }
  .sort-box select { width: 100%; font-size: 16px; }

  /* Price filter */
  .price-filter { flex-direction: column; align-items: flex-start; gap: 8px; }
  .range-track { max-width: 100%; width: 100%; }

  /* ── Car grid ── */
  .car-grid { grid-template-columns: 1fr; gap: 14px; }
  .car-card__info { padding: 14px; }
  .car-card__name { font-size: 1rem; }
  .car-card__specs { flex-wrap: wrap; gap: 8px; }
  .price-main { font-size: 1.6rem; }

  /* ── How it works ── */
  .steps { flex-direction: column; align-items: center; gap: 28px; }
  .step { min-width: unset; width: 100%; max-width: 320px; }
  .step__connector { display: none !important; }
  .step__num { font-size: 3rem; margin-bottom: 8px; }
  .step__icon { font-size: 2rem; margin-bottom: 8px; }

  /* ── Locations grid ── */
  .locations__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .location-card { padding: 14px 10px; }
  .location-card__icon { font-size: 1.6rem; margin-bottom: 6px; }
  .location-card h4 { font-size: 0.85rem; margin-bottom: 2px; }
  .location-card p { font-size: 0.72rem; }

  /* ── Testimonials ── */
  .testimonial { flex: 0 0 88vw; padding: 18px; }
  .testimonial__text { font-size: 0.9rem; line-height: 1.65; }

  /* ── Contact ── */
  .contact__grid { grid-template-columns: 1fr; gap: 28px; }
  .contact__form input,
  .contact__form select,
  .contact__form textarea { padding: 12px 14px; font-size: 16px; }

  /* ── WhatsApp strip ── */
  .whatsapp-strip { padding: 16px 0; }
  .whatsapp-strip__inner { flex-direction: column; gap: 12px; }
  .whatsapp-strip p { font-size: 0.85rem; }
  .whatsapp-section-btn { width: 100%; justify-content: center; font-size: 0.88rem; padding: 12px 20px; }

  /* ── Footer ── */
  .footer { padding: 36px 0 20px; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .footer__bottom { flex-direction: column; text-align: center; gap: 8px; }
  .newsletter-form { flex-direction: column; gap: 8px; }
  .newsletter-form input,
  .newsletter-form button { width: 100%; font-size: 16px; }

  /* ── Back to top — clear FAB ── */
  .back-to-top { bottom: 88px; right: 14px; width: 40px; height: 40px; font-size: 0.9rem; }

  /* ── Scroll indicator ── */
  .scroll-indicator { display: none; }
}

/* ============================================================
   VERY SMALL PHONES — ≤ 390px (iPhone SE, Galaxy A-series)
   ============================================================ */
@media (max-width: 390px) {
  .hero__title { font-size: clamp(1.75rem, 9.5vw, 2.2rem); }
  .hero__stats { gap: 14px; }
  .stat__num { font-size: 1.8rem; }
  .hero__actions .btn,
  .hero__actions .whatsapp-section-btn { padding: 12px 16px; font-size: 0.88rem; }
  .locations__grid { gap: 8px; }
  .location-card { padding: 12px 8px; }
  .location-card__icon { font-size: 1.3rem; }
  .location-card h4 { font-size: 0.78rem; }
  .location-card p { font-size: 0.65rem; }
  .mobile-menu__link { font-size: 1.7rem; }
  .car-card__specs li { font-size: 0.74rem; }
}

/* ============================================================
   TABLET PORTRAIT — 600px – 767px
   ============================================================ */
@media (min-width: 600px) and (max-width: 767px) {
  .hero__title { font-size: clamp(2.4rem, 8vw, 3rem); }
  .car-grid { grid-template-columns: repeat(2, 1fr); }
  .booking-form {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .booking-form__submit { grid-column: span 2; }
  .locations__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   TABLET LANDSCAPE — 768px – 1023px
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .nav         { display: none; }
  .header__cta { display: none; }
  .hamburger   { display: flex; }

  .hero__title { font-size: clamp(3rem, 7vw, 4.5rem); }

  .booking-form {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .booking-form__submit { grid-column: span 2; width: 100%; justify-content: center; }

  .car-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }

  .locations__grid { grid-template-columns: repeat(3, 1fr); }

  .footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .contact__grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ============================================================
   DESKTOP — 1024px – 1279px
   ============================================================ */
@media (min-width: 1024px) and (max-width: 1279px) {
  .car-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .footer__grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; }
  .locations__grid { grid-template-columns: repeat(4, 1fr); }
  .booking-form { grid-template-columns: repeat(4, 1fr) auto; }
}

/* ============================================================
   LARGE DESKTOP — ≥ 1280px
   ============================================================ */
@media (min-width: 1280px) {
  .container { max-width: 1200px; margin: 0 auto; }
  .car-grid { grid-template-columns: repeat(3, 1fr); }
  .footer__grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; }
  .locations__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   LANDSCAPE PHONE — short viewport
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 70px 0 36px; }
  .hero__content { gap: 16px; padding-top: 70px; }
  .loader { display: none; }
  .mobile-menu { justify-content: flex-start; padding-top: 70px; gap: 12px; }
  .mobile-menu nav { gap: 12px; }
  .mobile-menu__link { font-size: 1.4rem; }
}

/* ============================================================
   TOUCH DEVICES — remove hover effects
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  .car-card:hover { transform: none; box-shadow: var(--shadow-card); }
  .btn:hover { transform: none; box-shadow: none; }
  .location-card:hover { transform: none; }
  .whatsapp-fab:hover { transform: none; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .header, .hero, .loader, .back-to-top,
  .whatsapp-fab, .whatsapp-strip, .hamburger, .mobile-menu { display: none !important; }
  body { background: white; color: black; }
  .container { max-width: 100%; padding: 0; }
}
