/* Paleta de colores basada en el logo */
:root {
    --bg-color: #0b1325;
    --bg-claro: #152036;
    --gold: #d4af37;
    --gold-hover: #ebd076;
    --text-light: #ffffff;
    --text-muted: #a0aabf;
    --max-width: 1200px;
}

/* Reset general */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-light);
    line-height: 1.6;
}

html, body{
    /* EL COMBO MÁGICO PARA MATAR EL DESBORDE EN MÓVILES */
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;

}

/* --- HEADER & NAVEGACIÓN --- */
header {
    background-color: rgba(11, 19, 37, 0.98);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}


/* nav-inner es el contenedor interno del header, no el section */
.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* .nav-inner img{
    min-height: 80px;
    min-width: 100px;

    max-height: 80px;
    max-width: 370px;

    object-fit: contain;
} */

.nav-inner img {
    height: 75px; /* El tamaño grande que quiere el cliente en PC */
    width: auto; /* Magia: calcula el ancho solo para no deformarse */
    max-width: 100%;
    object-fit: contain; /* Evita que se estire feo */
}


.logo {
    font-size: 1.8rem;
    font-weight: 700;
    font-style: italic;
    color: var(--text-light);
    text-decoration: none;
    letter-spacing: 1px;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo span {
    color: var(--gold);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--gold);
}

/* Botón hamburguesa: oculto en desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-light);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* Animación X cuando está abierto */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- SECCIONES: full-width por defecto --- */
/* El section ocupa el 100% del ancho de la ventana.
   El contenido interior se limita con .section-inner. */
section {
    width: 100%;
    padding: 80px 0 60px;
}

/* Contenedor interno que centra y limita el ancho del contenido */
.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 5%;
}

h2 {
    text-align: center;
    color: var(--gold);
    font-size: 1.7rem;
    margin-bottom: 3rem;
    /* font-style: italic; */
    text-transform: uppercase;
    letter-spacing: 2px;
}


/* --- INICIO (HERO CON VIDEO) --- */
#inicio {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 120px;
    padding-bottom: 60px;
    padding-left: 5%;
    padding-right: 5%;
    overflow: hidden;
}

.video-fondo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.overlay-inicio {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(11, 19, 37, 0.85), rgba(11, 19, 37, 0.95));
    z-index: -1;
}

.contenido-inicio {
    position: relative;
    z-index: 1;
}

/* --- ESTILOS DEL TEXTO DEL HERO --- */
#inicio h1 {
    font-size: 4.4rem;
    margin-bottom: 1rem;
    font-style: italic;
    text-transform: uppercase;
}

#inicio h1 span {
    color: var(--gold);
}

#inicio p {
    font-size: 1.6rem;
    max-width: 600px;
    margin-bottom: 20px;
    margin-left: auto; 
    margin-right: auto;
}

/* --- BOTONES --- */
.btn {
    display: inline-block;
    background-color: var(--gold);
    color: var(--bg-color);
    padding: 15px 35px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 4px;
    margin-top: 30px;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    text-transform: uppercase;
}

.btn:hover {
    background-color: var(--gold-hover);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    text-align: center;
    margin-top: 0;
}

/* --- ESTRUCTURAS GRID --- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-3 .card{
    text-align: center;
}

/* --- CARDS --- */
.card {
    background: rgba(255, 255, 255, 0.03);
    padding: 2.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--gold);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.card h3 {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* --- TESTIMONIOS --- */
#testimonios{
    background-color: var(--bg-claro);
}

.testimonio-autor {
    text-align: right;
    margin-top: 15px;
    color: var(--gold);
    font-weight: 700;
    font-style: italic;
}

/* --- SERVICIOS --- */
#servicios{
    background-color: var(--bg-claro);
}

.servicios-grid {
    display: grid;
    /* Creamos las 6 columnas invisibles */
    grid-template-columns: repeat(6, 1fr); 
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Las primeras 3 tarjetas ocupan 2 columnas cada una */
.servicio-card {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 3rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: border-color 0.3s, transform 0.3s, background-color 0.3s;
    grid-column: span 2;
}

/* Las últimas 2 tarjetas (la 4 y la 5) ocupan 3 columnas cada una */
.servicio-card:nth-child(4),
.servicio-card:nth-child(5) {
    grid-column: span 3;
}

.servicio-card:hover {
    border-color: var(--gold); /* Se ilumina de dorado al pasar el mouse */
    background-color: rgba(255, 255, 255, 0.02);
    transform: translateY(-5px);
}


.servicio-logo {
    margin-bottom: 1.5rem;
    width: 45px; /* Tamaño del espacio para tu logo */
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--gold); /* Por si usas iconos SVG, van a tomar este color */
}

.servicio-logo img, 
.servicio-logo svg {
    max-width: 100%;
    height: auto;
    fill: currentColor;
}

.servicio-card h3 {
    color: var(--text-light); 
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.servicio-card p {
    color: var(--text-muted); /* Párrafo más grisáceo */
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- CONTACTO --- */
.contacto-grid {
    align-items: stretch; /* Obliga al mapa y al form a tener la misma altura exacta */
}

.contacto-col-izq {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centra el form verticalmente si sobra espacio */
}

.contacto-info {
    margin-bottom: 30px;
}

.contacto-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.contacto-icon {
    width: 26px;
    height: 26px;
    color: var(--gold);
    flex-shrink: 0;
}

.contacto-texto {
    font-size: 1.1rem;
    color: var(--text-light);
}

.contacto-link {
    color: var(--gold);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.contacto-link:hover {
    color: var(--gold-hover);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contacto-item a{
    text-decoration: underline;
}

.form-control {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-light);
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.1);
}

textarea.form-control {
    resize: vertical; /* Bloquea el estiramiento horizontal, solo permite hacia abajo */
    max-height: 300px; /* Límite máximo: hasta acá se puede estirar */
    min-height: 190px; /* Límite mínimo: no deja que lo achiquen de más */
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px transparent inset;
  -webkit-text-fill-color: #fff;
  transition: background-color 5000s ease-in-out 0s;
}

.map-container {
    display: flex; /* Ayuda a que el iframe se estire */
    height: 100%;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    flex-grow: 1; /* Le dice al iframe que ocupe todo el alto disponible de la grilla */
}

.form-heading {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    text-align: left;
    border-left: 3px solid var(--gold);
    padding-left: 10px;
}

.contacto-direccion-link {
    text-decoration: none;
    color: var(--gold);
    font-weight: bold;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.contacto-direccion-link:hover,
.contacto-direccion-link span:hover {
    color: var(--gold-hover);
}

.contacto-direccion-link span {
    color: var(--gold);
}

/* --- POR QUÉ ELEGIRNOS--- */
#por-que{
    background: linear-gradient(rgba(11, 19, 37, 0.95), rgba(11, 19, 37, 0.95)), url('img/auto_reparado.png') center / cover no-repeat;
}


/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 2rem;
    background-color: #060a14;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- RESPONSIVE --- */

/* Resolución intermedia: la nav empieza a apretarse antes de colapsar */
@media (max-width: 900px) {
    .nav-links {
        gap: 1rem;
    }
    .nav-links a {
        font-size: 0.78rem;
    }
}

/* Punto de colapso total del nav: se muestra el hamburguesa */
@media (max-width: 720px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: center;
        background-color: rgba(11, 19, 37, 0.99);
        border-top: 1px solid rgba(212, 175, 55, 0.3);
        padding: 1.5rem 5%;
        gap: 1.2rem;
    }

    .nav-links.nav-open {
        display: flex;
    }

    .nav-links a {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .servicios-grid { grid-template-columns: repeat(2, 1fr); }

    /* Achicamos un poco el título y el párrafo para celulares */
    #inicio h1 { font-size: 2.4rem; } 
    #inicio p { font-size: 1.1rem; }  
    
    section { padding-top: 35px; }
}

@media (max-width: 768px) {
    .servicios-grid {
        /* En el celu volvemos a una sola columna real */
        grid-template-columns: 1fr;
    }

    .servicio-card,
    .servicio-card:nth-child(4),
    .servicio-card:nth-child(5) {
        /* Todas las tarjetas ocupan el ancho total */
        grid-column: span 1;
    }
}


@media (max-width: 480px) {
    .servicios-grid { grid-template-columns: 1fr; }
    .nav-inner img{
        max-width: 95%;
    }
}
/* @media (max-width: 480px) {
    .servicios-grid { grid-template-columns: 1fr; }
    .nav-inner img{
        max-width: 150%;
    }
} */

/* --- RESPONSIVE HEADER --- */

/* --- MENÚ HAMBURGUESA FORZADO EN CELULARES ACOSTADOS --- */
@media (max-width: 950px) and (orientation: landscape) {
    /* Mostramos el botón de la hamburguesa */
    .nav-toggle {
        display: flex;
    }

    /* Escondemos los links de arriba y armamos el menú desplegable */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: center;
        background-color: rgba(11, 19, 37, 0.99);
        border-top: 1px solid rgba(212, 175, 55, 0.3);
        padding: 1.5rem 5%;
        gap: 1.2rem;
    }

    /* Habilitamos que se abra cuando el usuario hace clic */
    .nav-links.nav-open {
        display: flex;
    }

    .nav-links a {
        font-size: 1rem;
    }
}


/* --- ESTILOS DE ERROR DEL FORMULARIO --- */
.form-group {
    display: flex;
    flex-direction: column;
    position: relative; /* Para mantener el orden si el error aparece */
}

.error-msg {
    color: #ff4d4d; /* Un rojo intenso pero legible */
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: 600;
    display: none; /* Oculto por defecto, el JS lo va a mostrar */
    animation: aparecerError 0.3s ease-in-out;
}

/* Animación para que el cartelito baje suavemente */
@keyframes aparecerError {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Esta clase se la vamos a inyectar al input con JS para que el borde se ponga rojo */
.input-error {
    border-color: #ff4d4d !important;
    background: rgba(255, 77, 77, 0.05) !important;
}

/* Volar la etiqueta flotante de Google reCAPTCHA */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* --- AJUSTES PARA TABLETS Y IPAD PRO --- */
@media (max-width: 1024px) {
    
    /* Achicamos un poco el espacio del menú para que no se superponga */
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a {
        font-size: 0.8rem;
    }

    /* Agrandamos los textos e inputs del contacto para que no se vean chiquitos */
    .form-control {
        font-size: 1.1rem;
        padding: 18px;
    }

    .contacto-texto, .contacto-link {
        font-size: 1.2rem;
    }

    .btn {
        font-size: 1.2rem;
        padding: 18px 35px;
    }
}

/* Achicamos el logo en pantallas medianas (laptops chicas o tablets) */
@media (max-width: 1050px) {
    .nav-inner img {
        height: 65px; 
    }
}

/* Achicamos el logo para el celular así no aplasta la hamburguesa */
@media (max-width: 768px) {
    .nav-inner img {
        height: 55px; 
    }
}