/* =====================================================
   NAPOLI SEO - Responsive Stylesheet
   Mobile-first approach with Kolibri-inspired design
   ===================================================== */

/* ==================== Large Screens (1600px+) ==================== */
@media (min-width: 1600px) {
    .container {
        max-width: 1500px;
    }

    .hero-title {
        font-size: clamp(4rem, 7vw, 7rem);
    }
}

/* ==================== Desktop (1200px - 1399px) ==================== */
@media (max-width: 1399px) {
    .hero-shape-1 {
        width: 350px;
        height: 350px;
    }

    .hero-shape-2 {
        width: 250px;
        height: 250px;
    }
}

/* ==================== Large Tablets / Small Desktop (992px - 1199px) ==================== */
@media (max-width: 1199px) {
    .container {
        padding: 0 var(--space-5);
    }

    /* Header */
    .nav-link {
        padding: var(--space-2) var(--space-3);
    }

    /* Hero */
    .hero-shapes {
        width: 45%;
    }

    .hero-shape-1 {
        width: 300px;
        height: 300px;
    }

    .hero-shape-2 {
        width: 200px;
        height: 200px;
    }

    .hero-shape-3 {
        width: 100px;
        height: 100px;
    }

    /* Grids */
    .footer-grid {
        grid-template-columns: 1.5fr repeat(3, 1fr);
        gap: var(--space-8);
    }

    .service-hero-grid,
    .hero-animated-content {
        gap: var(--space-8);
    }

    .service-hero-grid-wide {
        grid-template-columns: 1.2fr 0.8fr;
    }

    /* Stats */
    .stats-grid {
        gap: var(--space-6);
    }
}

/* ==================== Tablets (768px - 991px) ==================== */
@media (max-width: 991px) {
    .section {
        padding: var(--space-16) 0;
    }

    .section-lg {
        padding: var(--space-20) 0;
    }

    /* Services Listing Grid - Tablet */
    .services-listing-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

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

    /* Hero */
    .hero {
        min-height: auto;
        padding: calc(var(--space-32) + 60px) 0 var(--space-16);
    }

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

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-shapes {
        position: absolute;
        width: 100%;
        height: 50%;
        top: auto;
        bottom: 0;
        opacity: 0.3;
    }

    .hero-shape-1 {
        top: auto;
        bottom: -10%;
        right: -20%;
    }

    .hero-shape-2 {
        top: 0;
        right: 50%;
        transform: translateX(50%);
    }

    .hero-shape-3 {
        bottom: 30%;
        right: 10%;
    }

    /* Page Heroes */
    .page-hero {
        padding: calc(var(--space-24) + 60px) 0 var(--space-12);
    }

    .service-hero-split,
    .service-hero-reverse,
    .service-hero-split-wide,
    .service-hero-animated {
        padding: calc(var(--space-24) + 60px) 0 var(--space-12);
    }

    .service-hero-grid,
    .service-hero-grid-wide,
    .hero-animated-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .service-hero-reverse .service-hero-grid {
        direction: ltr;
    }

    .service-hero-visual,
    .service-hero-visual-wide,
    .hero-animated-visual {
        order: -1;
    }

    .service-hero-visual svg {
        max-width: 350px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
    }

    .stat-number {
        font-size: var(--text-4xl);
    }

    /* Service Cards */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }

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

    /* Process */
    .process-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .footer-brand {
        grid-column: span 2;
        max-width: 100%;
        text-align: center;
    }

    .footer-brand .logo {
        justify-content: center;
    }

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

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .contact-info-card {
        order: -1;
    }

    /* Two Column Content */
    .two-column-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    /* About Grid */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    /* Mission Vision */
    .mission-vision-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    /* Hero Stats Inline */
    .hero-stats-inline {
        justify-content: center;
    }

    /* Local Service Featured Card */
    .local-service-card.featured {
        grid-column: span 1;
    }

    /* CWV Grid */
    .cwv-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    /* Audit Categories */
    .audit-categories {
        grid-template-columns: 1fr;
    }
}

/* ==================== Mobile Navigation (768px) ==================== */
@media (max-width: 768px) {
    /* Hamburger Toggle - Visible on Mobile */
    .menu-toggle {
        display: flex;
        position: fixed;
        top: var(--space-4);
        right: var(--space-4);
        z-index: 1001;
        width: 44px;
        height: 44px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        background: var(--white);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
    }

    .header.scrolled .menu-toggle {
        background: var(--white);
    }

    /* Menu Overlay - Hidden */
    .menu-overlay {
        display: none;
    }

    /* Mobile Menu Panel */
    .nav-main {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        background: var(--white);
        z-index: 999;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 80px var(--space-4) var(--space-6);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-xl);
    }

    .nav-main.active {
        left: 0;
    }

    /* Nav Links in Mobile */
    .nav-main > .nav-link {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 48px;
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-base);
        font-weight: 500;
        color: var(--gray-800);
        border-bottom: 1px solid var(--gray-100);
        border-radius: 0;
        background: transparent;
    }

    .nav-main > .nav-link:hover,
    .nav-main > .nav-link.active {
        color: var(--primary);
        background: var(--gray-50);
    }

    /* Dropdown Structure */
    .nav-dropdown {
        position: relative;
        width: 100%;
        border-bottom: 1px solid var(--gray-100);
    }

    /* Hide desktop arrow indicator */
    .nav-dropdown-header::after {
        display: none;
    }

    /* Dropdown Header - Split Click Zone */
    .nav-dropdown-header {
        display: flex;
        align-items: center;
        width: 100%;
    }

    /* Link part takes remaining space */
    .nav-dropdown-header .nav-link {
        flex: 1;
        display: flex;
        align-items: center;
        min-height: 48px;
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-base);
        font-weight: 500;
        color: var(--gray-800);
        border-radius: 0;
        background: transparent;
        border-bottom: none;
        padding-right: 0;
    }

    .nav-dropdown-header .nav-link:hover,
    .nav-dropdown-header .nav-link.active {
        color: var(--primary);
        background: transparent;
    }

    /* Arrow Button - Separate Click Target */
    .dropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        min-width: 48px;
        height: 48px;
        background: transparent;
        border: none;
        border-left: 1px solid var(--gray-100);
        cursor: pointer;
        color: var(--gray-600);
        padding: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .dropdown-toggle:hover {
        background: var(--gray-50);
        color: var(--gray-800);
    }

    .dropdown-toggle svg {
        width: 14px;
        height: 14px;
        transition: transform 0.2s ease;
    }

    /* Arrow Rotation when Open */
    .nav-dropdown.open .dropdown-toggle svg {
        transform: rotate(180deg);
    }

    /* Dropdown Menu - Hidden by Default */
    .nav-dropdown-menu {
        position: static;
        transform: none;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        padding: 0;
        background: var(--gray-50);
        border-radius: 0;
        box-shadow: none;
        min-width: auto;
        transition: max-height 0.3s ease;
    }

    /* Dropdown Menu - Open State */
    .nav-dropdown.open .nav-dropdown-menu {
        max-height: 500px;
    }

    /* Disable hover behavior on mobile */
    .nav-dropdown:hover .nav-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 0;
    }

    .nav-dropdown.open:hover .nav-dropdown-menu {
        max-height: 500px;
    }

    /* Submenu Items */
    .nav-dropdown-menu a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: var(--space-3) var(--space-4) var(--space-3) var(--space-8);
        font-size: var(--text-sm);
        color: var(--gray-700);
        border-radius: 0;
        border-bottom: 1px solid var(--gray-100);
    }

    .nav-dropdown-menu a:last-child {
        border-bottom: none;
    }

    .nav-dropdown-menu a:hover,
    .nav-dropdown-menu a.active {
        background: var(--gray-100);
        color: var(--primary);
    }

    /* Header Actions - Hidden on Mobile */
    .header-actions {
        display: none;
    }

    /* Language switch inside mobile menu */
    .nav-lang-switch {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2);
        padding: var(--space-4);
        margin-top: var(--space-4);
        background: var(--gray-50);
        border-radius: var(--radius);
    }

    .nav-lang-switch .lang-btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-sm);
        font-weight: 600;
        color: var(--gray-500);
        background: transparent;
        border-radius: var(--radius-full);
        transition: all var(--transition-fast);
    }

    .nav-lang-switch .lang-btn:hover {
        color: var(--gray-700);
    }

    .nav-lang-switch .lang-btn.active {
        background: var(--white);
        color: var(--deep-blue);
        box-shadow: var(--shadow-sm);
    }
}

/* ==================== Large Phones (576px - 767px) ==================== */
@media (max-width: 767px) {
    .section {
        padding: var(--space-12) 0;
    }

    .section-lg {
        padding: var(--space-16) 0;
    }

    .container {
        padding: 0 var(--space-4);
    }

    /* Typography */
    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }
    h3 { font-size: var(--text-2xl); }

    .hero-title {
        font-size: var(--text-4xl);
    }

    /* Section Headers */
    .section-header {
        margin-bottom: var(--space-10);
    }

    /* Service Cards */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Stats */
    .stats-section {
        padding: var(--space-12) 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    .stat-number {
        font-size: var(--text-3xl);
    }

    /* Process */
    .process-grid {
        grid-template-columns: 1fr;
    }

    .process-timeline::before {
        left: 20px;
    }

    .timeline-item {
        padding-left: 56px;
    }

    .timeline-marker {
        width: 42px;
        height: 42px;
        font-size: var(--text-base);
    }

    /* Features */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    .feature-item {
        padding: var(--space-4);
    }

    /* Values */
    .values-grid {
        grid-template-columns: 1fr;
    }

    /* CTA */
    .cta-section {
        padding: var(--space-16) 0;
    }

    .cta-section::before {
        width: 400px;
        height: 400px;
    }

    .cta-section::after {
        width: 250px;
        height: 250px;
    }

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

    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }

    /* Footer */
    .footer {
        padding: var(--space-12) 0 var(--space-6);
    }

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

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

    .footer-nav ul {
        align-items: center;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Buttons */
    .btn-lg {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-sm);
    }

    /* Service Process Grid */
    .service-process-grid {
        grid-template-columns: 1fr;
    }

    /* Deliverables */
    .deliverables-grid {
        grid-template-columns: 1fr;
    }

    /* Tech Grid */
    .tech-grid {
        grid-template-columns: 1fr;
    }

    /* Strategies Grid */
    .strategies-grid {
        grid-template-columns: 1fr;
    }

    /* Optimization Grid */
    .optimization-grid {
        grid-template-columns: 1fr;
    }

    /* Content Services Grid */
    .content-services-grid {
        grid-template-columns: 1fr;
    }

    /* Local Services Grid */
    .local-services-grid {
        grid-template-columns: 1fr;
    }

    /* Business Types Grid */
    .business-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Process Horizontal */
    .process-horizontal {
        flex-direction: column;
        align-items: center;
    }

    .process-step {
        max-width: 100%;
    }

    .process-arrow {
        transform: rotate(90deg);
        padding: var(--space-4) 0;
    }

    /* Importance Grid */
    .importance-grid {
        grid-template-columns: 1fr;
    }

    /* Report Scores */
    .report-scores {
        flex-wrap: wrap;
        gap: var(--space-4);
    }
}

/* ==================== Small Phones (< 576px) ==================== */
@media (max-width: 575px) {
    .container {
        padding: 0 var(--space-4);
    }

    /* Header */
    .header {
        padding: var(--space-3) 0;
    }

    .header-inner {
        gap: var(--space-3);
    }

    .logo img,
    .logo svg {
        height: 32px;
        width: auto;
    }

    /* Mobile menu adjustments for small phones */
    .nav-main {
        padding: 80px var(--space-4) var(--space-6);
        width: 90%;
        max-width: 300px;
    }

    .nav-link {
        font-size: var(--text-sm);
        padding: 0 var(--space-3);
        min-height: 44px;
    }

    .nav-dropdown-menu a {
        font-size: var(--text-xs);
        min-height: 40px;
    }

    .header-actions {
        width: calc(90% - var(--space-8));
        max-width: calc(300px - var(--space-8));
        left: var(--space-4);
    }

    /* Services Listing - Mobile */
    .service-listing-card {
        flex-direction: column;
        text-align: center;
        padding: var(--space-5);
    }

    .service-listing-icon {
        margin: 0 auto var(--space-4);
    }

    .service-listing-content h3 {
        font-size: var(--text-lg);
    }

    .service-listing-content p {
        font-size: var(--text-sm);
    }

    .service-listing-link {
        justify-content: center;
    }

    /* Hero */
    .hero {
        padding: calc(var(--space-24) + 60px) 0 var(--space-12);
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-eyebrow {
        font-size: var(--text-xs);
    }

    .hero-description {
        font-size: var(--text-base);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
    }

    .stat-item {
        padding: var(--space-3) 0;
    }

    .stat-number {
        font-size: var(--text-2xl);
    }

    .stat-label {
        font-size: var(--text-xs);
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Business Types */
    .business-types-grid {
        grid-template-columns: 1fr;
    }

    /* FAQ */
    .faq-question {
        font-size: var(--text-base);
        padding: var(--space-4) 0;
    }

    /* Cards */
    .service-card,
    .process-card,
    .value-card,
    .tech-card,
    .optimization-card,
    .strategy-card,
    .content-service-card,
    .local-service-card {
        padding: var(--space-5);
    }

    /* Contact Info */
    .contact-info-card {
        padding: var(--space-5);
    }

    /* Hero Stats Inline */
    .hero-stats-inline {
        flex-direction: column;
        gap: var(--space-4);
    }

    /* Lang Switch */
    .lang-switch {
        position: fixed;
        bottom: var(--space-4);
        right: var(--space-4);
        z-index: var(--z-fixed);
        background: var(--white);
        box-shadow: var(--shadow-lg);
    }

    /* Breadcrumbs */
    .breadcrumbs {
        font-size: var(--text-xs);
        flex-wrap: wrap;
    }
}

/* ==================== Extra Small Phones (375px and below) ==================== */
@media (max-width: 375px) {
    .container {
        padding: 0 var(--space-3);
    }

    /* Mobile menu - full width on tiny screens */
    .nav-main {
        width: 100%;
        max-width: 100%;
        left: -100%;
    }

    .nav-main.active {
        left: 0;
    }

    .nav-link {
        font-size: var(--text-sm);
        min-height: 44px;
    }

    .dropdown-toggle {
        width: 44px;
        min-height: 44px;
    }

    .header-actions {
        width: calc(100% - var(--space-6));
        max-width: none;
        left: var(--space-3);
        right: var(--space-3);
    }

    .lang-switch {
        flex-direction: row;
    }

    .lang-btn {
        flex: 1;
        text-align: center;
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .header,
    .footer,
    .cta-section,
    .menu-toggle,
    .lang-switch,
    .btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .hero,
    .section,
    .section-lg {
        padding: 20pt 0;
    }

    h1, h2, h3, h4 {
        color: #000;
        page-break-after: avoid;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* ==================== Reduced Motion ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==================== High Contrast ==================== */
@media (prefers-contrast: high) {
    :root {
        --gray-100: #ddd;
        --gray-200: #ccc;
        --gray-300: #999;
        --gray-400: #666;
        --gray-500: #444;
        --gray-600: #222;
    }

    .service-card,
    .process-card,
    .value-card {
        border-width: 2px;
    }
}

/* ==================== Dark Mode (future) ==================== */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here when needed */
}
