/* ========================================
   Torino SEO - Responsive Styles v2
   Design: VancouverSEO.ai inspired
   ======================================== */

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

/* ========================================
   Large Screens (1200px and below)
   ======================================== */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 2rem;
    }

    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1.25fr;
        gap: 2rem;
    }
}

/* ========================================
   Medium Screens / Tablets (991px and below)
   ======================================== */
@media (max-width: 991px) {
    /* Navigation */
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: 100vh;
        background: var(--secondary);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 6rem 2rem 2rem;
        transition: right var(--transition-base);
        z-index: 999;
        gap: 0;
        box-shadow: -10px 0 30px rgba(91, 83, 44, 0.1);
    }

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

    .nav-links > li {
        border-bottom: 1px solid var(--gray-200);
    }

    .nav-links > li > a {
        padding: 1.25rem 0;
        font-size: 1rem;
    }

    .nav-links > li > a::after {
        display: none;
    }

    .nav-links > li > a.active {
        color: var(--accent);
        font-weight: 700;
        background: transparent;
        border-left: 3px solid var(--accent);
        padding-left: calc(1rem - 3px);
        margin-left: -1rem;
    }

    /* Dropdown */
    .has-dropdown {
        flex-wrap: wrap;
    }

    .dropdown-toggle {
        display: flex;
        position: absolute;
        right: 0;
        top: 0.75rem;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        width: 100%;
        box-shadow: none;
        border: none;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base);
        background: transparent;
    }

    .has-dropdown.active .dropdown-menu {
        max-height: 500px;
    }

    .dropdown-menu li a {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
        background: transparent;
        border-radius: 0;
    }

    .dropdown-menu li a.active {
        color: var(--accent);
        font-weight: 600;
        background: transparent;
        border-left: 3px solid var(--accent);
        padding-left: calc(1rem - 3px);
    }

    .dropdown-menu li a:hover {
        background: rgba(99, 163, 97, 0.1);
    }

    /* Language Switcher in Mobile Menu */
    .lang-switcher {
        margin-top: 2rem;
        justify-content: center;
    }

    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* About Section */
    .about-section .container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-image {
        order: -1;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }

    .stat-item:nth-child(2)::after {
        display: none;
    }

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

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

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

    /* Related Services */
    .related-services {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Service Page Grids - Tablet */
    .service-hero-grid {
        gap: 2rem;
    }

    .service-content-grid {
        gap: 2rem;
    }

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

    /* Service page inline grid overrides - Tablet */
    .service-page [style*="display: grid"] {
        gap: 2rem !important;
    }

    /* About, Process, Contact pages - Tablet */
    .about-page [style*="display: grid"],
    .process-page [style*="display: grid"],
    .contact-page [style*="display: grid"] {
        gap: 2rem !important;
    }

    .process-page [style*="grid-template-columns: 0.3fr 1fr"] {
        grid-template-columns: 0.25fr 1fr !important;
        gap: 2rem !important;
    }

    .process-page [style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
    }
}

/* ========================================
   Small Tablets / Large Phones (767px and below)
   ======================================== */
@media (max-width: 767px) {
    /* Typography */
    h1 { font-size: clamp(2rem, 8vw, 3rem); }
    h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
    h3 { font-size: clamp(1.125rem, 4vw, 1.375rem); }

    /* Container */
    .container {
        padding: 0 1.5rem;
    }

    /* Sections */
    .section {
        padding: 4rem 0;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    /* Hero */
    .hero {
        padding-top: calc(var(--header-height) + 2rem);
        min-height: auto;
        padding-bottom: 4rem;
    }

    .hero h1 {
        font-size: clamp(2.25rem, 10vw, 3.5rem);
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

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

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

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

    .hero::before {
        font-size: clamp(8rem, 30vw, 15rem);
    }

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

    .service-card {
        padding: 2rem;
    }

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

    .stat-item::after {
        display: none;
    }

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

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

    .step-number {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .testimonial-card {
        padding: 2rem;
    }

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

    .footer-about {
        grid-column: auto;
    }

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

    /* Page Header */
    .page-header {
        padding: calc(var(--header-height) + 3rem) 0 3rem;
    }

    .page-header p {
        font-size: 1.125rem;
    }

    /* Service Page Hero Grid */
    .service-hero-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .service-hero-grid > div:last-child {
        display: none;
    }

    /* Service Page Content Grids */
    .service-content-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

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

    /* Service Features Grid */
    .service-features-grid {
        grid-template-columns: 1fr !important;
    }

    .service-features-grid.cols-3,
    .service-features-grid.cols-4 {
        grid-template-columns: 1fr !important;
    }

    /* Service page inline grid overrides */
    .service-page [style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .service-page .text-center svg {
        max-width: 200px;
        margin: 0 auto;
    }

    /* About, Process, Contact pages - Mobile */
    .about-page [style*="display: grid"],
    .process-page [style*="display: grid"],
    .contact-page [style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Process page - phase layout on mobile */
    .process-page [style*="grid-template-columns: 0.3fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .process-page [style*="grid-template-columns: 0.3fr 1fr"] > div:first-child {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
    }

    .process-page [style*="grid-template-columns: 0.3fr 1fr"] > div:first-child > div:first-child {
        width: 70px !important;
        height: 70px !important;
        flex-shrink: 0;
    }

    .process-page [style*="grid-template-columns: 0.3fr 1fr"] > div:first-child > div:first-child svg {
        width: 32px !important;
    }

    .process-page [style*="grid-template-columns: 0.3fr 1fr"] > div:first-child > div:last-child {
        margin-top: 0 !important;
    }

    /* Process page - overview navigation on mobile */
    .process-page [style*="display: flex"][style*="justify-content: space-between"] {
        flex-wrap: wrap !important;
        gap: 1.5rem !important;
        justify-content: center !important;
    }

    .process-page [style*="display: flex"][style*="justify-content: space-between"] > a {
        flex: 0 0 calc(50% - 0.75rem) !important;
    }

    .process-page [style*="display: flex"][style*="justify-content: space-between"] > a > div:first-child {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.25rem !important;
    }

    .process-page [style*="display: flex"][style*="justify-content: space-between"] > a > span {
        font-size: 0.75rem !important;
    }

    /* Process page - hide connecting line on mobile */
    .process-page [style*="position: absolute"][style*="height: 4px"] {
        display: none !important;
    }

    /* Contact page form section */
    .contact-page .contact-info-grid,
    .contact-page [style*="grid-template-columns: 1.2fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Related Services */
    .related-services {
        grid-template-columns: 1fr;
    }

    /* CTA Section */
    .cta-section {
        padding: 4rem 0;
    }

    .cta-section::before {
        font-size: clamp(6rem, 25vw, 12rem);
    }

    /* Buttons */
    .btn {
        padding: 0.875rem 1.75rem;
        font-size: 0.875rem;
    }

    .btn-large {
        padding: 1rem 2rem;
        font-size: 0.9375rem;
    }
}

/* ========================================
   Small Phones (480px and below)
   ======================================== */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 1rem;
    }

    /* Header */
    .logo-text {
        font-size: 1.25rem;
    }

    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
    }

    /* Hero */
    .hero h1 {
        font-size: clamp(2rem, 12vw, 2.75rem);
    }

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

    /* Section badges */
    .section-badge,
    .hero-badge {
        font-size: 0.6875rem;
        letter-spacing: 0.08em;
    }

    /* Cards */
    .service-card,
    .testimonial-card,
    .card {
        padding: 1.5rem;
    }

    .service-icon {
        width: 60px;
        height: 60px;
    }

    .service-icon svg {
        width: 28px;
        height: 28px;
    }

    /* Process */
    .step-number {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }

    /* Stats */
    .stats-section {
        padding: 3rem 0;
    }

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

    .stat-label {
        font-size: 0.8125rem;
    }

    /* Footer */
    .footer-about .footer-logo .logo-text {
        font-size: 1.5rem;
    }

    .footer-col h4 {
        margin-bottom: 1rem;
    }

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

    .form-control {
        padding: 0.875rem 1rem;
    }

    /* FAQ */
    .faq-question {
        padding: 1.25rem;
        font-size: 0.9375rem;
    }

    .faq-answer-content {
        padding: 0 1.25rem 1.25rem;
    }

    /* Testimonials */
    .testimonial-avatar {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }

    .testimonial-card::before {
        font-size: 4rem;
    }
}

/* ========================================
   Contact Form Section Responsive
   ======================================== */
@media (max-width: 991px) {
    .services-page [style*="grid-template-columns: 1fr 1fr"],
    .about-page [style*="grid-template-columns: 1fr 1fr"],
    .process-page [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

@media (max-width: 767px) {
    .services-page [style*="grid-template-columns: 1fr 1fr"],
    .about-page [style*="grid-template-columns: 1fr 1fr"],
    .process-page [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* ========================================
   Utility Classes for Responsive
   ======================================== */
@media (max-width: 991px) {
    .hide-tablet { display: none !important; }
    .show-tablet { display: block !important; }
}

@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
}

@media (min-width: 768px) {
    .show-mobile { display: none !important; }
}

@media (min-width: 992px) {
    .show-tablet { display: none !important; }
}

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

    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .site-header,
    .site-footer,
    .mobile-menu-toggle,
    .hero-decoration,
    .btn {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    .hero,
    .section,
    .page-header {
        padding: 2rem 0;
    }

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