:root {
    --color-primary: #FF0000; /* Rojo vibrante */
    --color-secondary: #1a1a1a; /* Negro oscuro */
    --color-text-light: #f0f0f0; /* Blanco roto / Gris muy claro */
    --color-text-dark: #333333; /* Gris oscuro para contrastes */
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Montserrat', sans-serif;
}

/* Reset y estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text-light);
    background-color: #0d0d0d;
    scroll-behavior: smooth;
    padding-top: 80px; /* Espacio para el menú fijo */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    text-transform: uppercase;
    margin-bottom: 15px; /* Ligeramente reducido */
    letter-spacing: 1px;
}

h2 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 30px; /* Ligeramente reducido */
}

h3 {
    font-size: 1.8em;
    color: var(--color-text-light);
    margin-bottom: 8px; /* Ligeramente reducido */
}

p {
    margin-bottom: 12px; /* Ligeramente reducido */
    color: var(--color-text-light);
}

/* --- Navegación Principal (Sticky Header) --- */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(13, 13, 13, 0.95); /* Fondo oscuro semitransparente */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 1000; /* Asegura que esté por encima de todo */
    padding: 15px 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; /* Añadir padding lateral */
}

.nav-logo {
    display: flex; /* Para centrar la imagen si es necesario */
    align-items: center;
    height: 50px; /* Definir una altura para el contenedor del logo */
}

.nav-logo-img {
    max-height: 100%; /* El logo ocupará toda la altura disponible */
    width: auto;
    filter: brightness(1.1); /* Ligero ajuste para que destaque un poco en el fondo oscuro */
    transition: transform 0.3s ease;
}

.nav-logo-img:hover {
    transform: scale(1.05); /* Pequeña animación al pasar el ratón */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--color-text-light);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-family: var(--font-body);
    font-size: 1em;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after { /* Opcional: para la página actual */
    width: 100%;
}

.menu-toggle {
    display: none; /* Oculto por defecto en desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001; /* Asegurar que esté por encima del menú colapsado */
}

.menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animación de la hamburguesa a 'X' */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* Header / Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://source.unsplash.com/1600x900/?sportscar,tuning') no-repeat center center/cover;
    padding: 100px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--color-text-light);
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 80px); /* Ajustar para el nav fijo */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin-top: 80px; /* Para que el contenido no quede debajo del nav en el scroll */
}

.hero .logo-img {
    max-width: 250px;
    height: auto;
    margin-bottom: 20px;
    animation: fadeIn 2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-size: 3.5em;
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    animation: slideInUp 1.5s ease-out 0.5s forwards;
    opacity: 0;
}

.hero p {
    font-size: 1.3em;
    margin-bottom: 30px; /* Ligeramente reducido */
    animation: slideInUp 1.5s ease-out 0.8s forwards;
    opacity: 0;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-primary {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding: 15px 30px;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-family: var(--font-heading);
    font-size: 1.1em;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background-color: #cc0000;
    transform: scale(1.05);
}

/* Sections */
.section {
    padding: 60px 0; /* REDUCIDO */
    background-color: var(--color-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.section:nth-of-type(even) {
    background-color: #121212;
}

/* Animaciones al hacer scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px); /* Empieza ligeramente abajo */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform; /* Sugerencia para el navegador */
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animación específica para los service-item con un pequeño retraso */
.services-grid .service-item {
    transition-delay: 0s; /* Resetear el delay base */
}

.services-grid .service-item:nth-child(1).visible { transition-delay: 0.1s; }
.services-grid .service-item:nth-child(2).visible { transition-delay: 0.2s; }
.services-grid .service-item:nth-child(3).visible { transition-delay: 0.3s; }
.services-grid .service-item:nth-child(4).visible { transition-delay: 0.4s; }
.services-grid .service-item:nth-child(5).visible { transition-delay: 0.5s; }
.services-grid .service-item:nth-child(6).visible { transition-delay: 0.6s; }


/* Animación específica para los brand-item con un pequeño retraso y menos desplazamiento */
.brands-grid .brand-item {
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transform: translateY(20px); /* Menos desplazamiento para logos */
    transition-delay: 0s;
}

.brands-grid .brand-item.visible:nth-child(1) { transition-delay: 0.05s; }
.brands-grid .brand-item.visible:nth-child(2) { transition-delay: 0.10s; }
.brands-grid .brand-item.visible:nth-child(3) { transition-delay: 0.15s; }
.brands-grid .brand-item.visible:nth-child(4) { transition-delay: 0.20s; }
.brands-grid .brand-item.visible:nth-child(5) { transition-delay: 0.25s; }
.brands-grid .brand-item.visible:nth-child(6) { transition-delay: 0.30s; }


/* About Section */
#sobre-nosotros p {
    max-width: 800px;
    margin: 0 auto 15px auto; /* Ligeramente reducido */
    text-align: center;
    font-size: 1.1em;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px; /* Ligeramente reducido */
    margin-top: 30px; /* Ligeramente reducido */
}

.service-item {
    background-color: #2a2a2a;
    padding: 25px; /* Ligeramente reducido */
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-item:hover {
    transform: translateY(-10px);
    background-color: #3a3a3a;
}

.service-item h3 {
    color: var(--color-primary);
    font-size: 1.5em;
    margin-bottom: 10px;
}

.service-item p {
    font-size: 0.95em;
}

/* Brands Section */
#marcas-destacadas p {
    max-width: 800px;
    margin: -10px auto 30px auto; /* Ligeramente reducido */
    text-align: center;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px; /* Ligeramente reducido */
}

.brand-item {
    background-color: #252525;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.brand-item:hover {
    transform: translateY(-5px);
    background-color: #333;
    border-color: rgba(255, 255, 255, 0.2);
}

.brand-item img {
    max-height: 50px; 
    max-width: 100%;
    width: auto;
    height: auto;
}


/* Tuning Calculator Section */
#calculadora {
    text-align: center;
}

#calculadora .iframe-container {
    background-color: #fff;
    padding: 15px; /* Ligeramente reducido */
    border-radius: 8px;
    margin: 30px auto; /* Ligeramente reducido */
    max-width: 800px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Contact Section */
#contacto {
    text-align: center;
}

#contacto .contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; /* Ligeramente reducido */
    margin-top: 30px; /* Ligeramente reducido */
}

#contacto .contact-item {
    display: flex;
    align-items: center;
    gap: 10px; /* Ligeramente reducido */
    font-size: 1.1em; /* Ligeramente reducido */
    color: var(--color-text-light);
    transition: color 0.3s ease;
}

#contacto .contact-item:hover {
    color: var(--color-primary);
}

#contacto .contact-item a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px; /* Ligeramente reducido */
}

#contacto .contact-item img {
    width: 28px; /* Ligeramente reducido */
    height: 28px; /* Ligeramente reducido */
}

/* FAQ Section */
#faq {
    text-align: center;
    padding-bottom: 80px; /* Ligeramente reducido */
}

.faq-container {
    margin-top: 30px; /* Ligeramente reducido */
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.faq-item {
    background-color: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 12px; /* Ligeramente reducido */
    overflow: hidden;
}

.faq-question {
    padding: 18px 22px; /* Ligeramente reducido */
    font-size: 1.1em;
    font-weight: bold;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: #3a3a3a;
}

.faq-question.active {
    background-color: var(--color-primary);
    color: #fff;
}

.faq-question.active .arrow-icon {
    transform: rotate(180deg);
    color: #fff;
}

.arrow-icon {
    font-size: 1.4em; /* Ligeramente reducido */
    line-height: 1;
    transition: transform 0.3s ease, color 0.3s ease;
    color: var(--color-primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out;
    padding: 0 22px; /* Ligeramente reducido */
    color: var(--color-text-light);
    font-size: 0.95em; /* Ligeramente reducido */
}

.faq-answer.open {
    max-height: 500px; /* AUMENTADO MÁS POR SEGURIDAD */
    padding-top: 12px; /* Ligeramente reducido */
    padding-bottom: 18px; /* Ligeramente reducido */
}


/* Footer */
.footer {
    background-color: var(--color-secondary);
    color: var(--color-text-light);
    text-align: center;
    padding: 25px 0; /* Ligeramente reducido */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Ajustes para el menú móvil */
    .main-nav .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: rgba(13, 13, 13, 0.98);
        padding: 15px 0; /* Ligeramente reducido */
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
        max-height: 0;
        overflow-y: auto; /* Permitir scroll interno si el contenido es demasiado grande */
        transition: max-height 0.5s ease-out;
        -webkit-overflow-scrolling: touch; /* Suavizar el scroll en iOS */
    }

    .main-nav .nav-links.open {
        display: flex;
        max-height: 80vh; /* Se adapta a un 80% de la altura de la vista */
    }

    .main-nav .nav-links li {
        text-align: center;
        margin: 8px 0; /* Ligeramente reducido */
    }

    .main-nav .nav-links a {
        font-size: 1.1em; /* Ligeramente reducido */
        padding: 8px 0; /* Ligeramente reducido */
        display: block;
    }

    .menu-toggle {
        display: flex;
    }

    /* Ajuste del logo en móvil para que no sea demasiado grande */
    .nav-logo {
        height: 40px;
    }
    .nav-logo-img {
        max-height: 100%;
    }

    /* Otros ajustes */
    .section {
        padding: 40px 0; /* REDUCIDO MÁS PARA MÓVIL */
    }
    h2 { font-size: 2em; margin-bottom: 25px; }
    .hero-title { font-size: 2.5em; }
    .hero p { font-size: 1em; margin-bottom: 25px; }
    .hero .logo-img { max-width: 180px; margin-bottom: 15px; }
    .service-item { padding: 20px; }
    .brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
    .brand-item {
        height: 80px;
        padding: 15px;
        border-radius: 8px;
    }
    .brand-item img { max-height: 40px; }
    .faq-question { padding: 15px 20px; font-size: 1em;}
    .faq-answer { padding: 0 20px; }
    .faq-answer.open { padding-bottom: 15px; }

    body {
        padding-top: 80px;
    }
}

@media (max-width: 480px) {
    h2 { font-size: 1.8em; margin-bottom: 20px; }
    .hero-title { font-size: 2em; }
    .btn-primary { padding: 12px 25px; font-size: 1em; }
    .hero .logo-img { max-width: 150px; }
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .faq-question { font-size: 0.95em;}
}