/* PALETA DE COLORES */
/* Fondo: Blanco (#FFFFFF) */
/* Oscuro: Azul Oscuro (#0F2B46) */
/* Claro: Azul Claro (#4A90E2) */
/* Texto secundario: Gris claro (#666) */

/* RESET Y ESTILOS BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    background-color: #FFFFFF; /* Fondo Blanco */
    color: #333; /* Texto general */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

a {
    text-decoration: none;
    color: #4A90E2;
}

/* 1. CABECERA Y NAVEGACIÓN */
.header {
    background-color: #0F2B46; /* Azul Oscuro */
    color: #FFFFFF;
    padding: 10px 0;
    border-bottom: 5px solid #4A90E2; /* Tira de Azul Claro */
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.header h1 {
    font-size: 1.8em;
    margin: 0;
}

.header nav ul {
    list-style: none;
    display: flex;
}

.header nav ul li {
    margin-left: 20px;
}

.header nav ul li a {
    color: #FFFFFF;
    font-weight: bold;
    padding: 10px 0;
    transition: color 0.3s;
}

.header nav ul li a:hover {
    color: #4A90E2; /* Azul Claro al pasar el ratón */
}

/* 2. BOTONES */
.button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
    border: none;
    cursor: pointer;
}

.button.primary {
    background-color: #4A90E2; /* Azul Claro */
    color: #FFFFFF;
}

.button.primary:hover {
    background-color: #0F2B46; /* Azul Oscuro */
}

.button.secondary {
    background-color: transparent;
    border: 2px solid #4A90E2;
    color: #4A90E2;
}

.button.secondary:hover {
    background-color: #4A90E2;
    color: #FFFFFF;
}


/* 3. SECCIÓN HERO (INICIO) */
.hero {
    background-color: #FFFFFF;
    padding: 80px 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5em;
    color: #0F2B46; /* Azul Oscuro */
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #666;
}

/* 4. SECCIONES GENERALES */
.section-title {
    font-size: 2em;
    text-align: center;
    color: #0F2B46;
    margin-bottom: 40px;
    border-bottom: 2px solid #4A90E2;
    display: inline-block;
    padding-bottom: 5px;
}

.trucks-section {
    padding: 60px 0;
    background-color: #F8F8F8; /* Un gris muy claro para diferenciar */
}

.contact-section {
    padding: 60px 0;
    text-align: center;
    background-color: #FFFFFF;
}

/* 5. GALERÍA DE CAMIONES */
.truck-gallery {
    display: grid;
    /* 3 columnas en pantallas grandes */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.truck-card {
    background-color: #FFFFFF;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.truck-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.truck-card img {
    width: 100%;
    height: 200px; /* Altura fija para uniformidad */
    object-fit: cover; /* Asegura que la imagen cubra el área sin deformarse */
    display: block;
}

.truck-info {
    padding: 20px;
}

.truck-info h3 {
    color: #0F2B46;
    margin-bottom: 10px;
}

.truck-info .price {
    font-size: 1.5em;
    color: #4A90E2;
    font-weight: bold;
    margin-bottom: 10px;
}

.truck-info .details {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9em;
}

/* 6. PIE DE PÁGINA */
.footer {
    background-color: #0F2B46; /* Azul Oscuro */
    color: #FFFFFF;
    text-align: center;
    padding: 15px 0;
    font-size: 0.9em;
}


/* =============================================== */
/* ESTILOS DE LOGIN Y DASHBOARD (Admin) */
/* =============================================== */

.admin-body {
    background-color: #F8F8F8;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h3 {
    color: #4A90E2;
    margin-bottom: 20px;
    font-weight: 300;
}

/* Formulario General */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #0F2B46;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.error-message {
    color: #D9534F;
    margin-top: 15px;
    font-weight: bold;
}

/* Header del Dashboard */
.admin-header {
    background-color: #0F2B46;
    color: #FFFFFF;
    padding: 15px 0;
    border-bottom: 3px solid #4A90E2;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-controls span {
    font-size: 0.9em;
}

/* Contenido Principal del Dashboard */
.admin-main {
    padding-top: 40px;
}

.truck-form {
    max-width: 700px;
    margin: 30px auto;
    padding: 30px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.info-message {
    text-align: center;
    padding: 10px;
    background-color: #E6F0FF; /* Azul claro muy sutil */
    color: #0F2B46;
    border-radius: 4px;
    margin-bottom: 20px;
}

.large-button {
    width: 100%;
    padding: 15px;
}

/* ANIMACIONES HERO */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.hero-animate {
    animation-duration: 1s;
    animation-fill-mode: both;
    animation-name: fadeInUp;
}

.hero-delay-1 {
    animation-delay: 0.2s;
}

.hero-delay-2 {
    animation-delay: 0.4s;
}

.hero h2.hero-animate {
    color: #0F2B46;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}


/* ESTILOS DEL MODAL */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8); /* Fondo oscuro semitransparente */
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation-name: fadeInUp;
    animation-duration: 0.4s;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 10px;
    cursor: pointer;
    z-index: 10;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
}

.modal-gallery {
    flex: 1 1 400px;
    padding: 20px;
    background-color: #f9f9f9;
    min-width: 0; /* CRITICAL FIX: Allows flex child to shrink below content size */
}

.modal-gallery img#modal-main-image {
    width: 100%;
    height: 300px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    max-width: 100%; /* Ensures it doesn't exceed parent width */
}

.modal-thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s;
}

.modal-thumbnails img:hover,
.modal-thumbnails img.active {
    border-color: #4A90E2;
    opacity: 1;
}

.modal-info {
    flex: 1 1 300px;
    padding: 30px;
}

.modal-info h2 {
    color: #0F2B46;
    margin-top: 0;
}

.modal-price {
    font-size: 1.8em;
    color: #4A90E2;
    font-weight: bold;
    margin: 10px 0;
}

.modal-details-text {
    margin: 20px 0;
    line-height: 1.6;
    color: #333;
}

.modal-details-text p {
    margin-bottom: 10px;
}

/* CAROUSEL CONTROLS */
.carousel-container {
    position: relative;
    width: 100%;
    display: flex; 
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9; /* Match modal gallery bg */
}

.carousel-container img#modal-main-image {
    margin: 0;
    max-width: 100%;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(15, 43, 70, 0.7); /* Brand dark blue with opacity */
    color: white;
    border: none;
    font-size: 24px;
    padding: 10px;
    cursor: pointer;
    z-index: 5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.carousel-control:hover {
    background-color: rgba(74, 144, 226, 0.9); /* Brand light blue */
}

.carousel-control.prev {
    left: 10px;
}

.carousel-control.next {
    right: 10px;
}