/* =========================================
   RESPONSIVE NAVIGATION STYLES
   Mobile (<768px) | Tablet (768-1024px) | Desktop (1024px+)
   ========================================= */

/* === DESKTOP NAVIGATION LINKS === */
.nav-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #4F46E5;
    transition: width 0.2s ease;
}

.nav-link:hover {
    color: #4F46E5;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link-active {
    color: #4F46E5;
}

.nav-link-active::after {
    width: 100%;
}

/* === MOBILE OVERLAY === */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    z-index: 60;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* === MOBILE SLIDE-IN MENU === */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100%;
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    background: #ffffff;
    z-index: 70;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.mobile-menu.active {
    transform: translateX(0);
}

/* === MOBILE NAV ITEMS === */
.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 48px;
    /* Touch-friendly minimum size */
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
    background: #f1f5f9;
    color: #4F46E5;
}

.mobile-nav-item.mobile-nav-active {
    background: #eef2ff;
    color: #4F46E5;
    font-weight: 600;
}

.mobile-nav-item i {
    flex-shrink: 0;
    color: inherit;
}

/* === SCROLL LOCK WHEN MENU OPEN === */
body.menu-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    touch-action: none;
}

/* === RESPONSIVE HERO SECTION PADDING === */
/* Adjust hero padding based on nav height */
@media (max-width: 767px) {
    .pt-44 {
        padding-top: 7rem !important;
        /* 112px for h-16 nav + extra */
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .pt-44 {
        padding-top: 9rem !important;
        /* 144px for h-20 nav + extra */
    }
}

/* === RESPONSIVE GRID LAYOUTS === */
/* All grid layouts across pages */
@media (max-width: 767px) {
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .grid-cols-4 {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
    }

    /* Fix order issues on mobile */
    .order-1,
    .order-2 {
        order: unset !important;
    }

    /* About page specific fixes */
    .relative.h-\[600px\] {
        height: 300px !important;
    }

    .h-96 {
        height: 200px !important;
    }

    /* Service page grid fixes */
    .gap-20 {
        gap: 2rem !important;
    }

    /* Service cards */
    .p-10 {
        padding: 1.5rem !important;
    }

    /* Icon sizing */
    .w-20.h-20 {
        width: 4rem !important;
        height: 4rem !important;
    }

    .w-16.h-16 {
        width: 3rem !important;
        height: 3rem !important;
    }

    .w-10.h-10 {
        width: 2rem !important;
        height: 2rem !important;
    }

    .w-8.h-8 {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    /* Pricing section fixes */
    .scale-105 {
        transform: scale(1) !important;
    }

    /* About page height fixes */
    .h-\[600px\] {
        height: auto !important;
        min-height: 250px !important;
    }

    /* Text sizing */
    .text-4xl {
        font-size: 1.5rem !important;
    }

    .text-3xl {
        font-size: 1.25rem !important;
    }

    .text-2xl {
        font-size: 1.125rem !important;
    }

    .text-xl {
        font-size: 1rem !important;
    }

    /* Section margins */
    .mb-32 {
        margin-bottom: 3rem !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }

    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    /* Fix order issues on tablet */
    .order-1,
    .order-2 {
        order: unset !important;
    }

    /* About page height fixes */
    .relative.h-\[600px\] {
        height: 400px !important;
    }

    .h-96 {
        height: 280px !important;
    }

    .gap-20 {
        gap: 3rem !important;
    }

    /* Pricing section */
    .scale-105 {
        transform: scale(1) !important;
    }

    .text-4xl {
        font-size: 2rem !important;
    }
}

/* === RESPONSIVE TYPOGRAPHY === */
@media (max-width: 767px) {
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    p {
        font-size: 1rem !important;
    }

    /* Reduce section padding on mobile */
    .py-32 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .pb-32 {
        padding-bottom: 3rem !important;
    }

    .mb-20 {
        margin-bottom: 2rem !important;
    }

    .mb-12 {
        margin-bottom: 1.5rem !important;
    }

    /* Responsive padding */
    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Stack buttons on mobile */
    .flex.gap-6.justify-center {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1rem !important;
    }

    /* Full width buttons on mobile */
    .min-w-\[240px\] {
        min-width: 100% !important;
        max-width: 320px !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    h1 {
        font-size: 3rem !important;
    }

    h2 {
        font-size: 2.25rem !important;
    }

    .py-32 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
}

/* === RESPONSIVE FOOTER === */
@media (max-width: 767px) {
    .grid.grid-cols-4 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .col-span-2 {
        grid-column: span 1 !important;
    }

    footer .text-center {
        padding-top: 1.5rem !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .grid.grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* === WHATSAPP BUTTON RESPONSIVE === */
@media (max-width: 767px) {
    .fixed.bottom-8.right-8 {
        bottom: 1rem !important;
        right: 1rem !important;
        width: 3.5rem !important;
        height: 3.5rem !important;
    }

    .fixed.bottom-8.right-8 svg {
        width: 1.75rem !important;
        height: 1.75rem !important;
    }
}

/* === PREVENT HORIZONTAL SCROLL === */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* === FOCUS STATES FOR ACCESSIBILITY === */
.mobile-nav-item:focus,
button:focus {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

/* === PRINT STYLES === */
@media print {

    .mobile-menu,
    .mobile-overlay,
    #menu-toggle {
        display: none !important;
    }
}