/* Mobile-First Responsive Design */

/* Mobile Navigation */
@media (max-width: 768px) {
    body.nav-open {
        overflow: hidden;
    }

    body.nav-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
        z-index: 999;
    }

    .header {
        z-index: 1002;
    }

    .mobile-menu-toggle {
        display: flex;
        z-index: 1002;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: min(100%, 320px);
        height: 100dvh;
        background: #ffffff;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        margin-left: 0 !important;
        padding: 2.5rem 0.85rem 1.25rem;
        gap: 0;
        transition: transform 0.28s ease, visibility 0.28s ease;
        box-shadow: 12px 0 40px rgba(15, 23, 42, 0.14);
        overflow-x: hidden;
        overflow-y: auto;
        transform: translateX(-105%);
        visibility: hidden;
        z-index: 1001;
        list-style: none;
    }

    .nav-menu.active {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-menu::before {
        content: 'Menu';
        position: absolute;
        top: 1rem;
        left: 0.85rem;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: #94a3b8;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #e2e8f0;
        padding: 0;
        flex-shrink: 0;
    }

    .nav-menu .dropdown {
        width: 100%;
        position: static !important;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }

    .nav-menu .dropdown-content {
        display: none !important;
        position: static !important;
        inset: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        margin: 0 0 0.5rem;
        padding: 0.25rem 0;
        box-shadow: none;
        list-style: none;
        overflow: hidden;
    }

    .nav-menu .dropdown.open .dropdown-content {
        display: block !important;
    }

    .nav-menu .dropdown-content li {
        border-bottom: 0;
        padding: 0;
        list-style: none;
    }

    .nav-menu .dropdown-content a {
        display: block;
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
        font-weight: 500;
        color: #334155;
    }

    .nav-menu .dropdown-content a:hover,
    .nav-menu .dropdown-content a.active {
        color: #0284c7;
        background: rgba(14, 165, 233, 0.08);
    }

    .dropdown:hover .dropdown-content,
    .nav-menu .dropdown:hover .dropdown-content {
        display: none !important;
    }

    .nav-menu .dropdown.open:hover .dropdown-content {
        display: block !important;
    }

    .nav-menu > li > a:not(.dropbtn) {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 0.95rem 0.35rem;
        font-size: 1rem;
        font-weight: 600;
        color: #0f172a;
    }

    .nav-menu a::after {
        display: none !important;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        color: #0284c7;
        background: transparent;
    }

    .nav-menu .dropbtn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.95rem 0.35rem;
        font-size: 1rem;
        font-weight: 600;
        color: #0f172a;
        border: 0;
        background: transparent;
        text-align: left;
        font-family: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-menu .dropbtn:focus {
        outline: none;
    }

    .nav-menu .dropbtn:focus-visible {
        outline: 2px solid #0284c7;
        outline-offset: 2px;
        border-radius: 6px;
    }

    .nav-menu .dropbtn span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.7rem;
        color: #0284c7;
        transition: transform 0.25s ease;
    }

    .nav-menu .dropdown.open .dropbtn {
        color: #0284c7;
    }

    .nav-menu .dropdown.open .dropbtn span {
        transform: rotate(180deg);
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        margin-top: 0.5rem;
        margin-left: 0;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .mobile-menu-toggle.active {
        position: fixed;
        top: 1rem;
        right: 1rem;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    }
}

/* Hero Section - Mobile */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 0;
    }

    .hero-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

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

    .hero-image-wrapper {
        order: -1;
    }
}

/* Services Grid - Mobile */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-card {
        padding: 1.5rem;
    }
}

/* Features Grid - Mobile */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Section Spacing - Mobile */
@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
}

/* Footer - Mobile */
@media (max-width: 768px) {
    .footer-top,
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer {
        padding: 2.5rem 0 1.75rem;
    }
}

/* Container Padding - Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 1.25rem;
    }

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

    .service-card {
        padding: 1.25rem;
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

/* Large Screen Optimizations */
@media (min-width: 1025px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }
}

/* Contact Form - Mobile */
@media (max-width: 768px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-form-wrapper {
        padding: 1.5rem;
    }
}

/* Process Phases - Mobile */
@media (max-width: 768px) {
    .phase-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .phase-number {
        font-size: 2rem;
    }

    .phase-details-grid {
        grid-template-columns: 1fr;
    }

    .process-phase-alt {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Portfolio Grid - Mobile */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* Region Features - Mobile */
@media (max-width: 768px) {
    .region-features {
        grid-template-columns: 1fr;
    }
}

/* Blog Grid - Mobile */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* Process Steps - Mobile */
@media (max-width: 768px) {
    .process-steps {
        grid-template-columns: 1fr;
    }
}

/* Solutions Grid - Mobile */
@media (max-width: 768px) {
    .solutions-grid {
        grid-template-columns: 1fr;
    }
}

/* Benefits List - Mobile */
@media (max-width: 768px) {
    .benefits-list {
        grid-template-columns: 1fr;
    }
}

/* Communication Grid - Mobile */
@media (max-width: 768px) {
    .communication-grid {
        grid-template-columns: 1fr;
    }
}

/* Page Hero - Mobile */
@media (max-width: 768px) {
    .page-hero {
        padding: 2rem 0;
    }

    .page-hero h1 {
        font-size: 1.75rem;
    }

    .page-hero p {
        font-size: 1rem;
    }
}

/* Service Detail - Mobile */
@media (max-width: 768px) {
    .service-detail-header h2 {
        font-size: 1.5rem;
    }

    .service-icon-large {
        font-size: 3rem;
    }
}

/* Process Intro - Mobile */
@media (max-width: 768px) {
    .process-intro h2 {
        font-size: 1.75rem;
    }
}

/* Region Intro - Mobile */
@media (max-width: 768px) {
    .region-intro h2 {
        font-size: 1.75rem;
    }
}
