/* ============================================================
   CAB4U — RESPONSIVE DESIGN & MOBILE OPTIMIZATION
   Strict Zero-Horizontal-Overflow System (320px – 1440px)
   ============================================================ */

/* Global Anti-Overflow Safeguard */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

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

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* ---------- 1280px and below ---------- */
@media (max-width: 1280px) {
  .container { padding: 0 24px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .service-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .fleet-track { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .contact-layout { grid-template-columns: 1fr 1.2fr; gap: 28px; }
  .style-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

/* ---------- 1024px — Tablet Landscape ---------- */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  
  .h1, .hero-title {
    font-size: clamp(2.8rem, 6.5vw, 4.0rem);
    line-height: 0.98;
    padding-top: 18px;
    margin-top: -12px;
  }
  .hero-title span {
    display: block;
    white-space: nowrap;
  }
  .h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

  .hero-main-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .hero-verified-badge {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    justify-content: center;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
  }

  .steps-grid::before,
  .steps-grid::after {
    display: none;
  }

  /* Connecting vertical animated dotted line between step cards in responsive */
  .step-card:not(:last-child)::after {
    content: "";
    position: absolute;
    bottom: -36px;
    left: 47px;
    transform: translateX(-50%);
    width: 3px;
    height: 36px;
    background-image: radial-gradient(circle, rgba(168, 85, 247, 0.95) 1.5px, transparent 1.5px);
    background-size: 3px 9px;
    background-repeat: repeat-y;
    z-index: 1;
    pointer-events: none;
    animation: dottedFlowVertical 0.8s linear infinite;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.8));
  }

  /* Flowing Luminous Pulse Particle on Vertical Dotted Line */
  .step-card:not(:last-child)::before {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 47px;
    width: 7px;
    height: 12px;
    background: radial-gradient(ellipse at center, #ffffff 0%, #c084fc 60%, rgba(168, 85, 247, 0) 100%);
    border-radius: 50%;
    filter: blur(0.5px) drop-shadow(0 0 8px #c084fc);
    z-index: 3;
    pointer-events: none;
    animation: flowCometPulseVertical 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  }
  .hero-car-col {
    margin-top: 10px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Choose by Style & Fleet horizontal swipe track on tablet */
  .style-grid, .fleet-track {
    grid-template-columns: none;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 16px;
    padding: 6px 0 16px 0;
    margin: 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
    cursor: grab;
  }
  .style-grid::-webkit-scrollbar,
  .fleet-track::-webkit-scrollbar {
    display: none;
  }
  .style-card {
    min-width: 290px;
    max-width: 330px;
    width: 78vw;
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 0;
  }
  .fleet-card {
    min-width: 300px;
    max-width: 340px;
    width: 80vw;
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 0;
  }

  .contact-layout, .legal-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .legal-toc-sidebar {
    position: static;
  }

  .alt-row, .fleet-detail, .alt-row-wrap {
    grid-template-columns: 1fr !important;
    gap: 28px;
    padding: 36px 0;
  }
  .fleet-detail.reverse .fleet-detail-visual,
  .fleet-detail .fleet-detail-visual,
  .alt-row.reverse .alt-visual,
  .alt-row .alt-visual {
    order: 1 !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
  }
  .fleet-detail.reverse .fleet-detail-info,
  .fleet-detail .fleet-detail-info,
  .alt-row.reverse .alt-content,
  .alt-row .alt-content {
    order: 2 !important;
  }
  .banner-section { padding: 36px; min-height: auto; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

/* ---------- 768px — Tablet Portrait & Mobile ---------- */
@media (max-width: 768px) {
  :root { --nav-height: 68px; }
  
  .container { padding: 0 18px; }
  .section-pad { padding: 45px 0; }
  .section-pad-sm { padding: 30px 0; }

  /* Premium Mobile Hero: Headline -> Centerpiece Car -> Frosted Proof -> Action Buttons */
  .hero-section {
    padding: 20px 0 30px;
  }
  .hero-main-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    min-height: auto;
  }

  .hero-text-col {
    display: contents;
  }

  .hero-title {
    order: 1;
    font-size: clamp(2.4rem, 8.6vw, 3.8rem);
    letter-spacing: -0.035em;
    line-height: 0.97;
    padding-top: 18px;
    margin-top: -14px;
    margin-bottom: 0;
  }

  .hero-car-col {
    order: 2;
    margin: 8px auto 0;
    width: 100%;
    max-width: 500px;
    position: relative;
  }
  .hero-car-transparent {
    max-width: 100%;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.95));
  }
  .hero-car-stage::before {
    top: 10%;
    left: 5%;
    width: 90%;
    height: 80%;
    background: radial-gradient(ellipse at 50% 50%, rgba(139, 44, 255, 0.45), rgba(168, 85, 247, 0.12) 50%, transparent 75%);
    filter: blur(40px);
  }

  /* Social proof badge pill under car */
  .hero-verified-badge {
    order: 3;
    margin: 8px auto 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 17, 26, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    max-width: 96%;
    text-align: left;
  }
  .avatar-stack img, .avatar-stack .avatar-circle {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }
  .verified-text {
    font-size: 12px;
    line-height: 1.35;
  }

  /* Hero action buttons */
  .hero-actions {
    order: 4;
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: 14px auto 0;
    justify-content: center;
  }
  .hero-btn-primary {
    flex: 1.15;
    padding: 12px 14px;
    font-size: 13.5px;
    font-weight: 700;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 20px rgba(139, 44, 255, 0.4);
    min-width: 0;
  }
  .hero-btn-glass {
    flex: 0.85;
    padding: 12px 12px;
    font-size: 13.5px;
    justify-content: center;
    text-align: center;
    min-width: 0;
  }

  .feature-grid,
  .service-grid,
  .contact-grid,
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    max-width: 100%;
  }
  
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
  }
  .form-group, .form-group.full, .shared-cab-optin-box {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .form-section {
    padding: 28px 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Choose by Style: Horizontal swipe slideshow aligned with container */
  .style-grid {
    grid-template-columns: none;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 16px;
    padding: 6px 0 16px 0;
    margin: 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
    cursor: grab;
  }
  .style-grid::-webkit-scrollbar { display: none; }
  .style-card {
    min-width: 285px;
    max-width: 320px;
    width: 82vw;
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 0;
  }

  /* Fleet: Horizontal swipe slideshow aligned with container */
  .fleet-track {
    grid-template-columns: none;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 16px;
    padding: 6px 0 16px 0;
    margin: 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
    cursor: grab;
  }
  .fleet-track::-webkit-scrollbar { display: none; }
  .fleet-card {
    min-width: 295px;
    max-width: 335px;
    width: 85vw;
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 0;
  }

  /* Testimonials: Continuous Automatic Marquee on responsive */
  .testimonials-marquee-wrapper::before,
  .testimonials-marquee-wrapper::after {
    width: 45px;
  }
  .testimonials-marquee-track {
    gap: 16px;
    animation-duration: 32s;
  }
  .testimonial-card {
    width: 295px;
    max-width: 295px;
    min-width: 295px;
  }

  .pillar-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .founder-box { padding: 30px 20px; border-radius: 22px; }
  .founder-row {
    grid-template-columns: 1fr !important;
    gap: 28px;
    text-align: center;
    justify-items: center;
  }
  .founder-photo {
    width: 220px;
    height: 275px;
    margin: 0 auto;
  }
  .about-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }
  .about-stat-card {
    padding: 15px 10px;
    min-width: 0;
  }
  .about-stat-num {
    font-size: clamp(1.35rem, 4.8vw, 1.8rem);
  }
  .about-stat-label {
    font-size: 11.5px;
    line-height: 1.3;
  }

  .map-container-box {
    height: 260px;
    border-radius: 20px;
  }
  .map-embed-wrapper {
    height: 100%;
  }

  .banner-section { border-radius: var(--radius-lg); padding: 28px 20px; }
  .banner-points { gap: 6px; }

  footer {
    padding: 30px 0 6px;
    margin-top: 20px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 14px;
  }
  .footer-bottom {
    text-align: center;
    justify-content: center;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 0px;
    font-size: 13px;
    line-height: 1.55;
  }
  .footer-credit-sep {
    display: none;
  }
  .footer-credit {
    display: block;
    margin-top: 3px;
  }

  body { padding-bottom: 80px; }
  .mobile-actionbar { display: flex; }
}

/* ---------- 480px — Mobile Phones (360px - 480px) ---------- */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .nav-wrap { top: 10px; padding: 0 12px; }
  .nav { padding: 8px 12px; }
  .nav-logo-img { height: 28px; max-width: 120px; }
  .nav-login-link { display: none; }
  .nav-pill-btn { padding: 7px 14px; font-size: 12px; }

  .page-top-spacer { height: 95px; }

  .hero-title { font-size: clamp(1.95rem, 8.4vw, 2.55rem); letter-spacing: -0.035em; line-height: 0.97; padding-top: 14px; margin-top: -12px; }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    gap: 9px;
  }
  .hero-btn-primary, .hero-btn-glass {
    width: 100%;
    padding: 13px 18px;
    font-size: 14px;
  }

  .form-section { padding: 22px 16px; border-radius: var(--radius-lg); }
  .contact-hub-card { padding: 22px 16px; border-radius: var(--radius-lg); }
  .contact-hub-grid { grid-template-columns: 1fr; gap: 10px; }

  .modal-card { padding: 26px 18px 22px; border-radius: 20px; max-height: 94vh; }
  .modal-close { top: 12px; right: 12px; width: 32px; height: 32px; font-size: 18px; }

  footer {
    padding: 22px 0 4px;
    margin-top: 14px;
  }
  .footer-grid {
    gap: 14px;
    margin-bottom: 10px;
  }
  .footer-desc { font-size: 13px; }
  .footer-bottom {
    padding-top: 6px;
    padding-bottom: 0;
    font-size: 13px;
    line-height: 1.5;
  }
}

/* ---------- 360px and 340px / 320px — Ultra Small Devices ---------- */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .nav-wrap { padding: 0 8px; top: 8px; }
  .nav { padding: 6px 10px; }
  .nav-logo-img { height: 24px; max-width: 105px; }
  .nav-pill-btn { padding: 6px 11px; font-size: 11.5px; }

  .hero-title { font-size: clamp(1.65rem, 8.2vw, 1.95rem); line-height: 0.98; padding-top: 12px; margin-top: -10px; }
  .eyebrow { font-size: 10.5px; letter-spacing: 0.1em; }
  .avatar-stack img, .avatar-stack .avatar-circle { width: 26px; height: 26px; font-size: 9.5px; }

  .hero-actions {
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: 100%;
    margin-top: 12px;
  }
  .hero-btn-primary, .hero-btn-glass {
    font-size: 13.5px;
    padding: 12px 16px;
    width: 100%;
  }

  .hero-verified-badge {
    padding: 6px 12px;
    gap: 8px;
  }
  .verified-text {
    font-size: 11.5px;
  }

  .form-section { padding: 18px 12px; }
  .form-group input, .form-group select, .form-group textarea {
    padding: 11px 12px;
    font-size: 13.5px;
  }
  .form-actions button, .form-actions a {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .banner-section { padding: 20px 14px; }
  .banner-points .pill-tag { font-size: 11px; padding: 5px 10px; }
  .btn { width: 100%; justify-content: center; padding: 12px 16px; font-size: 13px; }

  footer {
    padding: 20px 0 6px;
  }
  .footer-badge-pill { font-size: 11px; padding: 5px 10px; }
  .footer-col h5 { font-size: 12.5px; }
  .footer-col a { font-size: 13px; }
  .footer-bottom {
    padding-top: 6px;
    font-size: 12.5px;
  }

  .mobile-actionbar {
    padding: 6px 8px;
    gap: 6px;
  }
  .mobile-actionbar a {
    font-size: 11.5px;
    padding: 7px 4px;
    gap: 4px;
  }
  .mobile-actionbar a i {
    font-size: 12.5px;
  }
}

/* ---------- Error Pages Responsive (Zero Scroll Single Screen with Mobile Actionbar) ---------- */
@media (max-width: 768px) {
  body.error-page-body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .error-main {
    padding: clamp(84px, 12vh, 102px) 0 clamp(64px, 9vh, 72px);
    justify-content: center;
  }
  .error-stage-wrap {
    padding: 0 18px;
  }
  .error-visual-stage {
    padding-top: clamp(24px, 4.5vh, 44px);
    margin: 0 auto clamp(14px, 2.4vh, 22px);
    max-width: 88%;
  }
  .error-visual-stage::before {
    width: 90%;
    height: 90%;
    filter: blur(32px);
  }
  .error-automotive-art {
    max-height: clamp(100px, 17vh, 140px);
    filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.95));
  }
  .error-h1 {
    font-size: clamp(1.4rem, 5.4vw, 1.75rem);
    letter-spacing: -0.035em;
    line-height: 1.08;
    margin-bottom: clamp(8px, 1.3vh, 12px);
  }
  .error-desc {
    font-size: clamp(12.5px, 3.2vw, 14px);
    line-height: 1.5;
    margin-bottom: clamp(16px, 2.6vh, 24px);
    max-width: 90%;
  }
  .error-cta-row {
    flex-direction: column;
    width: 100%;
    max-width: 290px;
    margin: 0 auto;
    gap: 10px;
  }
  .error-cta-row .hero-btn-primary,
  .error-cta-row .hero-btn-glass {
    width: 100%;
    padding: 11px 20px;
    font-size: 13.5px;
    justify-content: center;
    text-align: center;
  }

  /* Ad Modal Mobile Tuning */
  .ad-modal-card {
    max-width: 94%;
    border-radius: 22px;
  }
  .ad-modal-banner {
    aspect-ratio: 16 / 9;
    height: auto;
    padding: 8px;
  }
  .ad-modal-img {
    width: 100%;
    height: 100%;
  }
  .ad-modal-body {
    padding: 18px 16px 20px;
  }
  .ad-modal-title {
    font-size: 1.22rem;
  }
  .ad-modal-desc {
    font-size: 12.5px;
    margin-bottom: 14px;
  }
  .ad-modal-pills {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 18px;
  }
  .ad-modal-pill {
    font-size: clamp(9.5px, 2.5vw, 11px);
    padding: 7px 4px;
    gap: 4px;
  }
  .ad-modal-actions {
    flex-direction: column;
    gap: 8px;
  }
  .ad-modal-actions .btn {
    width: 100%;
  }
}





