/* ============================================================
   PENTASYSAI — RESPONSIVE BREAKPOINTS
   Mobile-first overrides consolidated in one file.
   ============================================================ */

/* ——— TABLET & BELOW (≤1024px) ——— */
@media (max-width: 1024px) {
    :root {
        --section-pad: var(--space-16);
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .mega-dropdown {
        min-width: 480px;
    }

    .process-steps {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}


/* ——— MOBILE NAV BREAKPOINT (≤900px) ——— */
@media (max-width: 900px) {
    .menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-left: 1px solid rgba(15, 23, 42, 0.08);
        flex-direction: column;
        padding: calc(var(--header-height) + var(--space-8)) var(--space-6) var(--space-8);
        transform: translateX(100%);
        transition: transform var(--transition-base);
        z-index: calc(var(--z-header) - 1);
        overflow-y: auto;
    }

    .main-nav.open {
        transform: translateX(0);
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-link {
        padding: var(--space-4) var(--space-4);
        width: 100%;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }

    .nav-link::after {
        display: none;
    }

    /* Mobile Dropdown */
    .mega-dropdown {
        position: static;
        transform: none;
        min-width: 100%;
        background: rgba(15, 23, 42, 0.04);
        border: none;
        border-radius: var(--radius-md);
        box-shadow: none;
        padding: var(--space-3);
        margin-top: var(--space-2);
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: max-height var(--transition-base), padding var(--transition-base);
    }

    .nav-item.open .mega-dropdown {
        max-height: 800px;
        padding: var(--space-4);
    }

    .mega-dropdown-grid {
        grid-template-columns: 1fr;
    }

    .header-cta {
        margin-left: 0;
        margin-top: var(--space-6);
        width: 100%;
    }

    .header-cta .btn {
        width: 100%;
        justify-content: center;
    }

    /* Mobile overlay */
    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: calc(var(--z-header) - 2);
    }

    .nav-overlay.active {
        display: block;
    }
}


/* ——— MOBILE (≤768px) ——— */
@media (max-width: 768px) {
    :root {
        --section-pad: var(--space-12);
        --container-pad: var(--space-4);
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-steps {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }

    .section-header {
        margin-bottom: var(--space-10);
    }

    /* Service Pillars: stack */
    .pillars-grid,
    .three-pillars,
    .dual-pillars {
        grid-template-columns: 1fr !important;
    }

    /* About Identity Rows: stack */
    .identity-row {
        flex-direction: column !important;
        gap: var(--space-8) !important;
    }

    .identity-row.reverse {
        flex-direction: column-reverse !important;
    }
}


/* ——— SMALL MOBILE (≤480px) ——— */
@media (max-width: 480px) {
    :root {
        --section-pad: var(--space-10);
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }

    .tech-grid {
        gap: var(--space-3);
    }

    .tech-item {
        min-width: 80px;
        padding: var(--space-4) var(--space-3);
    }

    .btn {
        padding: 12px 28px;
        font-size: var(--fs-xs);
    }

    .btn-lg {
        padding: 14px 36px;
        font-size: var(--fs-small);
    }

    .cta-banner .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .service-card {
        padding: var(--space-8) var(--space-5);
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
}
