/* ==========================================================================
   RESPONSIVE LAYOUT BREAKPOINTS
   ========================================================================== */

/* --------------------------------------------------------------------------
   Huge Displays (1920px and above)
   -------------------------------------------------------------------------- */
@media screen and (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    html {
        font-size: 18px; /* Scale font slightly for large displays */
    }
}

@media screen and (min-width: 2560px) {
    .container {
        max-width: 2200px;
    }
    
    html {
        font-size: 20px; /* Scale further on 4K/UHD displays */
    }
}

/* --------------------------------------------------------------------------
   Desktop & Laptops (Below 1280px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1280px) {
    .container {
        padding: 0 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   Tablets & Landscapes (Below 991px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 991px) {
    .section {
        padding: 6rem 0;
    }

    .section-title {
        font-size: 2.25rem;
    }

    /* Navigation Menu Transition to Mobile Sidedrawer */
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(300px, 85vw);
        height: 100vh;
        background: var(--bg-tertiary);
        flex-direction: column;
        align-items: flex-start;
        padding: 6rem 2rem 2rem 2rem;
        gap: 1.5rem;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.08);
        transition: right var(--transition-normal);
        z-index: 998;
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .mega-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        display: none; /* Toggled via JS class */
        padding: 1rem 1.25rem;
        margin-top: 0.5rem;
        background: var(--bg-primary);
        border-left: 3px solid var(--accent);
        border-radius: 6px;
    }

    .mega-menu-grid {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 1.25rem;
    }

    .mega-menu-col-title {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.25rem;
    }

    .mega-menu-link {
        padding: 0.5rem 0;
        display: block;
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    }
    [data-theme="dark"] .mega-menu-link {
        border-bottom-color: rgba(255, 255, 255, 0.03);
    }
    .mega-menu-link:last-child {
        border-bottom: none;
    }

    .has-mega-menu.active .mega-menu {
        display: block;
    }

    .nav-menu .nav-item {
        width: 100%;
    }

    .nav-menu .nav-link {
        padding: 0.75rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .nav-menu .has-mega-menu.active > .nav-link {
        border-bottom-color: var(--accent);
        color: var(--accent);
    }

    .header-actions {
        gap: 1.25rem;
    }

    .header-cta-btn {
        display: none; /* Hide primary header CTA on mobile, link is inside menu */
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .footer-about {
        grid-column: span 2;
        margin-bottom: 1rem;
    }

    /* Responsive grid collapse overrides for tablets */
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .why-us-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .services-promo-card {
        grid-column: span 2;
        gap: 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   Tablets (Below 768px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .section {
        padding: 5rem 0;
    }

    .section-title-wrapper {
        margin-bottom: 3rem;
    }

    /* Grid reductions */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-about {
        grid-column: span 1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Mobile Landscapes / Wide Screen Phones (Below 425px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    .floating-actions {
        left: auto;
        right: 1.5rem;
        bottom: 1.5rem;
        flex-direction: row-reverse;
        gap: 0.75rem;
    }

    .float-btn {
        width: 46px;
        height: 46px;
    }

    .services-promo-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .services-promo-card > div {
        max-width: 100% !important;
    }
}

/* --------------------------------------------------------------------------
   Mobile Portrait Devices (Below 576px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 576px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .hero-stats-card {
        padding: 1.5rem;
    }

    .services-promo-card {
        grid-column: span 1;
    }
}

@media screen and (max-width: 425px) {
    .section-title {
        font-size: 1.85rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        max-width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Small Mobile Devices (Below 375px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 375px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .logo-main {
        font-size: 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   Tiny Mobile Devices (Below 320px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 320px) {
    .section-title {
        font-size: 1.65rem;
    }
    
    .logo-sub {
        letter-spacing: 0.12em;
    }
}
