/* ================================================
   FORGED ECU PERFORMANCE - RESPONSIVE STYLES
   ================================================ */

/* ============================================
   TABLET (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --section-padding: var(--space-16);
    }

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

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

    .stages-grid .stage-card:last-child {
        grid-column: span 2;
        max-width: 50%;
        margin: 0 auto;
    }

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

    .hero-stats {
        gap: var(--space-8);
    }

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

/* ============================================
   DESKTOP - Contact & Forms Layout
   ============================================ */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
}

.appointment-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

/* ============================================
   TABLET PORTRAIT (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --container-padding: var(--space-4);
        --section-padding: var(--space-12);
        --header-height: 100px;
    }

    /* Header */
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(13, 13, 13, 0.98);
        backdrop-filter: blur(10px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform var(--transition-base);
        z-index: calc(var(--z-fixed) - 1);
        pointer-events: none;
    }

    .nav.active {
        transform: translateX(0);
        pointer-events: auto;
    }

    .nav-list {
        flex-direction: column;
        gap: var(--space-6);
        text-align: center;
    }

    .nav-link {
        font-size: var(--text-2xl);
    }

    .nav-toggle {
        display: flex;
        position: relative;
        z-index: calc(var(--z-fixed) + 2);
        background: transparent;
        padding: var(--space-2);
        margin: 0;
        cursor: pointer;
    }

    .nav-toggle.active .nav-toggle-line:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle.active .nav-toggle-line:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .nav-toggle-line:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .header-cta {
        display: none;
    }

    /* Mobile Menu - Chip Tuning Button */
    .nav-item-highlight {
        width: 100%;
        text-align: center;
        margin-top: var(--space-4);
        padding-top: var(--space-4);
        border-top: 1px solid var(--border-color);
    }

    .nav-item-highlight .nav-link-cta {
        justify-content: center;
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-lg);
    }

    /* Language Switcher Mobile - hide by default, show when nav is open */
    .lang-switcher {
        display: none;
    }

    .nav.active ~ .lang-switcher {
        display: flex;
        position: fixed;
        top: auto;
        bottom: var(--space-12);
        left: 50%;
        transform: translateX(-50%);
        background: var(--color-gray-800);
        padding: var(--space-3) var(--space-6);
        border-radius: var(--radius-full);
        border: 1px solid var(--border-color);
        z-index: var(--z-fixed);
        gap: var(--space-3);
        box-shadow: var(--shadow-lg);
    }

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

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

    .hero-buttons {
        flex-direction: column;
    }

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

    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-6);
    }

    .hero-stat {
        flex: 1 1 45%;
    }

    /* Sections */
    .section-title {
        font-size: var(--text-3xl);
    }

    /* Stages */
    .stages-grid {
        grid-template-columns: 1fr;
    }

    .stages-grid .stage-card:last-child {
        grid-column: span 1;
        max-width: 100%;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
    }

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

    .footer-brand {
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    /* Grids */
    .grid-2,
    .grid-3,
    .grid-4,
    .contact-layout,
    .appointment-grid-2 {
        grid-template-columns: 1fr;
    }

    /* Forms */
    .steps-progress {
        overflow-x: auto;
        padding-bottom: var(--space-4);
    }

    .step-label {
        display: none;
    }
}

/* ============================================
   MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    :root {
        --text-7xl: 3rem;
        --text-6xl: 2.5rem;
        --text-5xl: 2rem;
        --text-4xl: 1.75rem;
        --text-3xl: 1.5rem;
    }

    .logo-img {
        height: 80px;
    }

    .hero {
        min-height: auto;
        padding: var(--space-24) 0 var(--space-12);
    }

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

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

    .btn-lg {
        padding: var(--space-4) var(--space-6);
        font-size: var(--text-base);
    }

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

    .stage-gains {
        flex-direction: column;
        gap: var(--space-4);
    }

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

    .footer-bottom {
        font-size: var(--text-xs);
    }

    /* Contact list in footer */
    .contact-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }
}

/* ============================================
   LANDSCAPE PHONES
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-20) 0 var(--space-8);
    }

    .hero-stats {
        display: none;
    }
}

/* ============================================
   LARGE SCREENS (min-width: 1400px)
   ============================================ */
@media (min-width: 1400px) {
    .container {
        padding: 0 var(--space-8);
    }

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

/* ============================================
   HIGH DPI SCREENS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .header,
    .footer,
    .nav-toggle,
    .btn {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    main {
        padding-top: 0;
    }

    a {
        text-decoration: underline;
    }
}

/* ============================================
   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;
    }
}

/* ============================================
   DARK MODE (already dark, but for completeness)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Site is already dark themed */
}
