/* ============================================================
   CAPPS — MOBILE RESPONSIVE OVERRIDES
   CSS-only, media-query scoped, !important to win specificity
   wars against the existing desktop-first stylesheets.

   Load this file LAST, after every other <link rel="stylesheet">,
   so the cascade + !important guarantees it applies on mobile.

   Breakpoints:
     - max-width: 991px  → tablets / small laptops
     - max-width: 767px  → phones (landscape + portrait)
     - max-width: 480px  → small phones
   ============================================================ */


/* ============================================================
   TABLET (≤991px) — collapse the two-column layouts early
   ============================================================ */
@media screen and (max-width: 991px) {

    .capps-hyper-nav-capsule {
        display: none !important;
    }

    .hero-grid,
    .why-grid,
    .capps-demo-grid,
    .capps-leader-intro__grid {
        flex-direction: column !important;
    }

        .capps-leader-intro__grid .col-md-6 {
            width: 100% !important;
            max-width: 100% !important;
            flex: 0 0 100% !important;
        }

    .capps-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .capps-features-marquee {
        display: none !important;
    }
}


/* ============================================================
   PHONE (≤767px) — the main fix zone
   ============================================================ */
@media screen and (max-width: 767px) {

    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    * {
        max-width: 100% !important;
    }

    img, video, iframe {
        max-width: 100% !important;
        height: auto !important;
    }

    .container {
        width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* ---------- Top floating bar ---------- */
    .capps-hyper-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 8px 12px !important;
    }

    .capps-hyper-inner {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .capps-hyper-nav-capsule {
        display: none !important;
    }

    .capps-hyper-logo-img {
        width: 120px !important;
        height: auto !important;
    }

    .capps-hyper-tools-box {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .capps-hyper-phone-link span {
        display: none !important;
    }

    .capps-hyper-cta-btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    .capps-hyper-flags-box {
        gap: 4px !important;
    }

    .capps-hyper-flag-action img {
        width: 18px !important;
        height: auto !important;
    }

    /* ---------- Sidebar (desktop side-dot nav) ---------- */
    .capps-sidebar {
        display: none !important;
    }

    /* push content below the fixed top bar */
    .capps-root {
        padding-top: 64px !important;
    }

    /* ---------- Hero ---------- */
    .capps-hero-container {
        flex-direction: column !important;
        padding: 24px 0 !important;
    }

    .capps-hero-content-left {
        width: 100% !important;
    }

    .capps-hero-title {
        font-size: 28px !important;
        line-height: 1.25 !important;
    }

    .capps-hero-subtitle {
        font-size: 15px !important;
    }

    .capps-hero-actions {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .capps-hero-cta {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .capps-features-marquee {
        display: none !important;
    }

    .hero-preview-tabs {
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        display: flex !important;
        gap: 6px !important;
        padding-bottom: 8px !important;
    }

    .hero-tab {
        flex: 0 0 auto !important;
        font-size: 12px !important;
        padding: 6px 10px !important;
    }

    .hero-mockup-wrapper {
        flex-direction: column !important;
    }

    .hero-info-card {
        position: static !important;
        width: 100% !important;
        margin-top: 16px !important;
    }

    /* ---------- Metrics ---------- */
    .capps-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .capps-metric-value {
        font-size: 26px !important;
    }

    .capps-social-proof__logos-wrapper {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* ---------- Showcase gallery (alternating image/text rows) ---------- */
    .showcase-item,
    .showcase-item.reverse {
        flex-direction: column !important;
        display: flex !important;
    }

        .showcase-item .browser-frame {
            width: 100% !important;
        }

        .showcase-item .showcase-text {
            width: 100% !important;
            padding: 16px 0 !important;
        }

    /* ---------- Why CAPPS / stats ---------- */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* ---------- Leader intro ---------- */
    .capps-leader-intro__grid {
        flex-direction: column-reverse !important;
    }

    .capps-leader-intro__img {
        width: 100% !important;
        height: auto !important;
    }

    /* ---------- Demo form ---------- */
    .capps-demo-grid {
        flex-direction: column !important;
    }

    .capps-demo-info,
    .capps-demo-form-card {
        width: 100% !important;
    }

    .capps-demo-row--split {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .capps-demo-field {
        width: 100% !important;
    }

    .capps-demo-input,
    .capps-demo-submit {
        font-size: 16px !important;
    }
    /* 16px prevents iOS auto-zoom on focus */

    .capps-demo-contact-alt {
        flex-direction: column !important;
        gap: 10px !important;
    }

    /* ---------- CTA section ---------- */
    .cta-actions {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

        .cta-actions a {
            width: 100% !important;
            text-align: center !important;
        }

    /* ---------- Footer ---------- */
    .capps-footer-mid-section {
        min-height: auto !important;
    }

    .capps-bg-map-iframe {
        position: relative !important;
        height: 220px !important;
    }

    .row.mb-5 > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 24px !important;
    }

    .capps-footer-contact-grid {
        gap: 10px !important;
    }

    .row.items-center.mt-4 > [class*="col-"] {
        width: 100% !important;
        text-align: left !important;
        margin-bottom: 8px !important;
    }

    /* ---------- Floating utility buttons (phone/whatsapp/mail/agenda) ---------- */
    .phonebox-wrapper,
    .whatsapp-wrapper,
    .mailbox-wrapper,
    .agendabox-wrapper {
        width: 44px !important;
        height: 44px !important;
        right: 10px !important;
    }

    .phonebox-wrapper {
        bottom: 172px !important;
    }

    .whatsapp-wrapper {
        bottom: 124px !important;
    }

    .mailbox-wrapper {
        bottom: 76px !important;
    }

    .agendabox-wrapper {
        bottom: 28px !important;
    }

    /* ---------- Video modal ---------- */
    .video-modal__content {
        width: 92% !important;
    }
}


/* ============================================================
   SMALL PHONE (≤480px)
   ============================================================ */
@media screen and (max-width: 480px) {

    .capps-hero-title {
        font-size: 23px !important;
    }

    .capps-hero-subtitle {
        font-size: 14px !important;
    }

    .capps-hero-badge {
        font-size: 11px !important;
        padding: 6px 10px !important;
    }

    .capps-metrics-grid {
        grid-template-columns: 1fr !important;
    }

    .capps-metric-value {
        font-size: 24px !important;
    }

    .capps-demo-title {
        font-size: 22px !important;
    }

    .capps-demo-form-card {
        padding: 16px !important;
    }

    .stat-card h3 {
        font-size: 26px !important;
    }

    .capps-hyper-logo-img {
        width: 100px !important;
    }

    .capps-hyper-cta-btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    .capps-bg-map-iframe {
        height: 180px !important;
    }
}
