/*  ESTILOS GENERALES  */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #333;
    background: #fff;
}

/*  CABECERA  */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.6rem;
    font-weight: 200;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 20px;
}

nav a {
    color: #fff;
    text-decoration: none;
    transition: 0.3s;
}

nav a:hover {
    color: #007bff;
}

/*  HERO  */
.hero {
    height: 80vh;
    background: url('img/fondo_concesionario.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    color: #fff;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.hero-texto {
    position: relative;
    z-index: 2;
}

.hero-texto h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
}

.hero-texto p {
    font-size: clamp(1rem, 3vw, 1.3rem);
}

/*  TIPOS DE COCHES  */
.tipos {
    margin-top: 100px;
    padding: 60px 5%;
    text-align: center;
}

.tipos h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 30px;
}

.tipos-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

.tipo {
    flex: 1 1 200px;
    max-width: 250px;
    transition: transform 0.3s ease;
}

.tipo:hover {
    transform: scale(1.05);
}

.tipo img {
    width: 100%;
    height: auto;
}

.tipo p {
    margin-top: 10px;
    font-weight: 500;
}

.boton-centro {
    margin-top: 40px;
}

.btn {
    background: #111;
    color: #fff;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: 0.3s;
}

.btn:hover {
    background: #007bff;
}

/*  MODELOS  */
.modelos {
    margin-top: 100px;
    padding: 60px 5%;
    text-align: center;
}

.modelos h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 10px;
}

.subtitulo {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 40px;
}

/* Tarjetas de modelos */
.modelos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
    align-items: stretch;
    justify-items: center;
}

.modelo-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    max-width: 360px;
    text-align: center;
}

.modelo-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.modelo-card img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background-color: #f8f8f8;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 8px;
}

.modelo-card h3 {
    margin: 10px 0 5px;
    font-size: 1.35rem;
    font-weight: 600;
}

.modelo-card p {
    color: #555;
}

.precio {
    display: block;
    font-weight: bold;
    color: #007bff;
    margin: 10px 0;
    font-size: 1.1rem;
}

.modelo-card .btn {
    margin-top: 10px;
    font-weight: 500;
}

/*  CONTACTO  */
.contacto {
    margin-top: 100px;
    padding: 80px 5%;
}

.contacto h2 {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 10px;
}

.contacto p {
    text-align: center;
    margin-bottom: 40px;
    color: #555;
}

/* Contenedor principal: formulario + horario */
.contacto-contenedor {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Formulario a la izquierda */
form {
    flex: 1 1 500px;
    max-width: 650px;
}

/* Horario a la derecha */
.horario {
    flex: 1 1 300px;
    background: #f6f6f6;
    border-radius: 10px;
    padding: 25px;
    height: fit-content;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.horario h3 {
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
    padding-bottom: 5px;
}

/* Campos del formulario */
.fila {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.campo {
    flex: 1;
    margin-bottom: 20px;
}

label {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

input,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fafafa;
}

textarea {
    resize: vertical;
}

button.btn {
    background: #007bff;
    border: none;
    color: #fff;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button.btn:hover {
    background: #0056b3;
}

/* Mensaje de éxito */
#mensajeExito2 {
    display: none;
    color: green;
    margin-top: 15px;
    font-weight: 500;
    text-align: left;
    font-size: 1.1rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*  FOOTER  */
footer {
    background: #111;
    color: #fff;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

/*  MEDIA QUERY ÚNICA PARA PANTALLAS GRANDES  */
@media (min-width: 900px) {
    header {
        padding: 20px 60px;
    }

    .contacto-contenedor {
        align-items: flex-start;
    }

    .fila {
        flex-wrap: nowrap;
    }

    .hero {
        height: 90vh;
    }
}

/*  MODAL  */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.modal-contenido {
    background: #fff;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    position: relative;
    text-align: left;
    animation: aparecer 0.3s ease;
}

@keyframes aparecer {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cerrar {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    transition: 0.2s;
}

.cerrar:hover {
    color: #007bff;
}