/* --- RESPONSIVE FIXES --- */

/* Laptops & Tablets (1200px and down) */
@media (max-width: 1200px) {
    .container {
        padding: 0 4%;
    }

    .hero h1 {
        font-size: 60px;
    }
}

/* Tablets (992px and down) */
@media (max-width: 992px) {
    .container {
        margin: 0 auto;
        padding: 0 40px;
    }

    #navbar {
        padding: 10px 0;
    }

    .hero {
        padding-top: 140px;
        min-height: auto;
        padding-bottom: 80px;
    }

    .hero h1 {
        font-size: 48px;
        margin-top: 20px;
        line-height: 1.2;
    }

    .hero-content {
        max-width: 100%;
    }

    .about-grid,
    .why-grid,
    .contact-grid,
    .address-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-img,
    .team-img {
        height: 400px;
    }

    .section-header h2 {
        font-size: 32px;
    }
}

/* Small Tablets & Mobile (768px and down) */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .nav-links {
        display: none;
    }

    .nav-links.mobile-active {
        display: flex !important;
    }

    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        font-size: 22px;
        margin-right: -10px;
    }

    /* --- SPLASH SCREEN MOBILE --- */
    .splash-screen {
        padding: 0 15px;
        box-sizing: border-box;
    }

    .splash-content {
        width: 100%;
        max-width: 100%;
    }

    .splash-logo {
        width: 100px !important;
        height: 100px !important;
        margin-bottom: 25px !important;
        padding: 12px !important;
    }

    .splash-name {
        font-size: 28px !important; 
        line-height: 1.2 !important;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        margin-bottom: 8px !important;
    }

    .splash-name span {
        display: block; /* Broken into two lines for better UI on small screens */
    }

    .splash-tagline {
        font-size: 13px !important;
        max-width: 280px;
        margin: 0 auto;
        opacity: 0.9;
    }

    .splash-loader {
        margin-top: 30px !important;
    }

    /* --- HERO SECTION --- */
    .hero {
        text-align: center;
        padding: 120px 15px 100px 15px; /* Balanced padding */
        min-height: auto;
        background: linear-gradient(135deg, rgba(15, 118, 110, 0.98), rgba(15, 118, 110, 0.85)), url('https://images.pexels.com/photos/3938022/pexels-photo-3938022.jpeg?auto=compress&cs=tinysrgb&w=1600');
        background-size: cover;
        background-position: center;
    }

    .hero-content {
        max-width: 100%;
        margin: 0 auto;
        overflow: hidden; /* Prevent overflow from children */
    }

    .hero h1 {
        font-size: 34px;
        line-height: 1.2;
        margin-bottom: 20px;
        letter-spacing: -1px;
    }

    .hero-badge {
        font-size: 11px !important;
        letter-spacing: 2px !important;
        margin-bottom: 10px !important;
        white-space: normal;
        line-height: 1.4;
    }

    .hero p {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 30px !important; /* Proper spacing to buttons */
    }

    /* --- BUTTONS --- */
    .hero-btns {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px !important; /* Increased for better separation as per user request */
        width: 100%;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 280px; /* Standardized width */
        margin: 0 auto;
        display: flex;
        box-sizing: border-box; /* Critical for border containment */
        padding: 14px 24px;
        justify-content: center;
    }

    /* Fix for outline/secondary buttons */
    .btn-secondary, .btn-outline {
        border-width: 2px !important;
    }

    /* --- GENERAL SECTIONS --- */
    section:not(.hero) {
        padding: 50px 0 !important;
    }

    .section-header {
        margin-bottom: 35px;
    }

    .section-header h2 {
        font-size: 26px !important;
        line-height: 1.3 !important;
    }

    /* --- CARDS & GRIDS --- */
    .about-grid,
    .why-grid,
    .contact-grid,
    .address-grid,
    .category-grid,
    .dispatch-grid,
    .md-grid {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
    }

    .md-contact-wrapper {
        gap: 0 !important;
    }

    .md-contact-name {
        white-space: normal !important;
    }

    /* --- MOBILE CATEGORY ANIMATIONS --- */
    .cat-card {
        transform: none !important;
        animation: none !important; /* Only runs when .active is added */
        opacity: 0;
        visibility: hidden;
    }

    /* Secret Sauce: Reveal logic via JS */
    body.js-active .cat-card.active {
        opacity: 1 !important;
        visibility: visible !important;
        animation: mobile-slide-in-right 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }

    /* Perfect Alternating Pattern */
    .cat-card:nth-child(even).active {
        animation-name: mobile-slide-in-left !important;
    }

    /* Column-based direction overrides for premium 2-by-2 feel */
    .cat-card:nth-child(1).active, .cat-card:nth-child(2).active,
    .cat-card:nth-child(5).active, .cat-card:nth-child(6).active {
        animation-name: mobile-slide-in-right !important;
    }
    .cat-card:nth-child(3).active, .cat-card:nth-child(4).active,
    .cat-card:nth-child(7).active, .cat-card:nth-child(8).active {
        animation-name: mobile-slide-in-left !important;
    }

    .card {
        padding: 25px !important;
    }

    .md-grid {
        display: flex !important;
        flex-direction: column !important;
        padding: 40px 20px !important;
        gap: 35px !important;
        background: #fff !important;
        border-radius: 24px !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08) !important;
        text-align: center;
    }

    .md-grid .md-content-col {
        display: contents !important;
    }

    .md-grid .section-header {
        order: 1 !important;
        margin-bottom: 5px !important;
        text-align: center !important;
    }

    .md-grid .section-header h2 {
        font-size: 28px !important;
        margin-top: 5px !important;
    }

    .md-grid .md-image-col {
        order: 2 !important;
        margin: 0 auto !important;
    }

    .md-grid .md-photo {
        max-width: 250px !important; /* Slightly smaller for mobile premium look */
        border-radius: 20px !important;
    }

    .md-grid .md-body {
        order: 3 !important;
        text-align: left !important; /* Kept text left for readability within centered layout */
        padding: 0 10px !important;
    }

    .md-grid .md-body p {
        font-size: 15px !important;
        line-height: 1.6 !important;
        margin-bottom: 15px !important;
    }

    .about-img,
    .team-img {
        height: 300px;
    }

    .about-badge {
        padding: 12px 18px !important;
        left: 15px !important;
        bottom: -15px !important;
    }

    /* --- PRODUCTION-GRADE STICKY FOOTER --- */
    .premium-footer {
        width: 100% !important;
        flex-shrink: 0 !important; /* Prevent footer from shrinking */
        padding: 50px 0 20px 0 !important;
        background-color: #0f3d3e !important;
    }

    /* Column alignment fix */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
        text-align: center !important;
    }

    .footer-column h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-column ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 20px;
    }
}

/* Very Small Devices (480px and down) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 28px !important;
    }

    .hero p {
        font-size: 14px;
    }

    .hero-btns .btn {
        max-width: 260px; /* Slightly smaller for very thin screens */
    }

    .section-header h2 {
        font-size: 24px !important;
    }

    .logo img {
        height: 34px;
    }

    .card {
        padding: 20px !important;
    }

    .about-img,
    .team-img {
        height: 250px;
    }
}

/* --- FULL HEIGHT LAYOUT CORE (STICKY FOOTER) --- */
html {
    scroll-behavior: smooth; /* Native smooth scroll fallback */
    height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
    width: 100%;
}

#main-content {
    flex: 1 0 auto; /* Expands to fill available space and push footer down */
    width: 100%;
    position: relative;
    z-index: 5; /* Place above hidden overlays but below nav (1000) */
}