/*
 * ========================================
 * static/css/public.css
 * Archivo principal de estilos para la parte pública del sitio.
 * REGENERADO PARA MOBILE-FIRST Y 100% RESPONSIVO.
 *
 * Contenido:
 * 1. Variables CSS (Paleta de Colores)
 * 2. Estilos Base y Reset
 * 3. Tipografía General
 * 4. Botones de Acción (Call to Action Buttons)
 * 5. Estilos de Encabezado (Header y Navegación Principal)
 * 6. Estilos del Botón Flotante de WhatsApp
 * 7. Secciones Generales del Contenido Principal
 * 8. Estilos Específicos de Secciones (Hero, Servicios, Proceso, Sobre Nosotros, Características, Ubicación)
 * 9. Estilos del Modal de Formulario de Contacto
 * 10. Estilos de Mensajes de Django
 * 11. Estilos de Pie de Página (Footer)
 * 12. Media Queries (Diseño Responsivo para Tablets y Desktop)
 * ========================================
 */

/* ========================================
 * 1. Variables CSS (Paleta de Colores)
 * Define colores para una fácil gestión y consistencia.
 * ========================================
 */
:root {
    --primary-blue: #0A2463; /* Azul Oscuro, color principal de la marca */
    --secondary-red: #D83B3B; /* Rojo vibrante, color de acento y botones */
    --light-grey: #F0F2F5; /* Gris muy claro para fondos de secciones claras */
    --white: #FFFFFF; /* Color blanco para texto y fondos claros */
    --dark-text: #333333; /* Texto oscuro principal */
    --medium-text: #666666; /* Texto secundario o de párrafo */
    --border-color: #E0E0E0; /* Color para bordes sutiles */
    --shadow-light: rgba(0, 0, 0, 0.08); /* Sombra ligera para elementos */
}

/* ========================================
 * 2. Estilos Base y Reset
 * Reset de estilos predeterminados del navegador y estilos globales.
 * ========================================
 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--light-grey);
    font-size: 16px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* Padding horizontal para evitar que el contenido toque los bordes */
}

/* ========================================
 * 3. Tipografía General
 * Estilos para títulos y párrafos. Mobile-first.
 * ========================================
 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.8em;
}

/* Tamaños de fuente para Mobile */
h1 { font-size: 2em; }
h2 { font-size: 1.7em; }
h3 { font-size: 1.3em; }

p {
    font-size: 1em;
    margin-bottom: 1em;
    color: var(--medium-text);
}

a {
    color: var(--secondary-red);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--primary-blue);
}

/* ========================================
 * 4. Botones de Acción (Call to Action Buttons)
 * ========================================
 */
.btn-primary {
    display: inline-block;
    background-color: var(--secondary-red);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    width: fit-content;
}

.btn-primary:hover {
    background-color: #bb3030;
    transform: translateY(-2px);
}

/* ========================================
 * 5. Estilos de Encabezado (Header y Navegación Principal)
 * ========================================
 */
.main-header {
    background-color: transparent;
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 999;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.main-header.scrolled {
    background-color: var(--primary-blue);
    box-shadow: 0 2px 5px var(--shadow-light);
    padding: 10px 0;
}

.main-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.brand-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.3em; /* Tamaño para mobile */
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.main-header.scrolled .brand-name {
    color: var(--white);
}

.main-nav .nav-list {
    list-style: none;
    display: flex; /* Se usa flex para el toggle en JS */
    flex-direction: column; /* Apilado para mobile */
    width: 100%;
    background-color: var(--primary-blue);
    position: absolute;
    top: 60px; /* Debajo del header */
    left: 0;
    padding: 20px 0;
    box-shadow: 0 2px 5px var(--shadow-light);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    visibility: hidden; /* Oculto por defecto */
}

.main-nav .nav-list.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible; /* Visible cuando está activo */
}

.main-nav .nav-list li {
    margin: 10px 0;
}

.main-nav .nav-link,
.main-nav .nav-button {
    display: block;
    padding: 10px 20px;
    text-align: center;
    width: 100%;
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: color 0.3s ease;
}

.main-nav .nav-link:hover {
    color: var(--secondary-red);
}

.main-nav .nav-button {
    margin: 10px auto;
}

.menu-toggle {
    display: block; /* Siempre visible en mobile */
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8em;
    cursor: pointer;
}

/* ========================================
 * 6. Estilos del Botón Flotante de WhatsApp
 * ========================================
 */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
    background-color: #25d366; /* Color de WhatsApp */
    color: var(--white);
    border-radius: 50%;
    text-align: center;
    font-size: 2em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* ========================================
 * 7. Secciones Generales del Contenido Principal
 * ========================================
 */
section {
    padding: 40px 0; /* Solo padding vertical, el container maneja el horizontal */
    text-align: center;
}

section:nth-of-type(even) {
    background-color: var(--white);
}

section:nth-of-type(odd) {
    background-color: var(--light-grey);
}

/* ========================================
 * 8. Estilos Específicos de Secciones
 * ========================================
 */

/* Sección Hero (Inicio) */
.hero-section {
    background: url("{% static 'img/hero.png' %}") no-repeat center center/cover;
    color: var(--white);
    padding: 80px 20px; /* Padding interno para que el contenido no se pegue */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh; /* Altura mínima para que la imagen se vea bien */
}
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}
.hero-content h2 {
    font-size: 2em;
    color: var(--white);
    margin-bottom: 15px;
}
.hero-content p {
    font-size: 1.1em;
    margin-bottom: 25px;
    color: var(--white);
    opacity: 0.9;
}

/* Sección de Servicios */
.services-grid {
    display: grid;
    grid-template-columns: 1fr; /* Una columna para mobile */
    gap: 20px;
    margin-top: 30px;
}

.service-card {
    background-color: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--shadow-light);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.service-card h3 {
    font-size: 1.3em;
    color: var(--primary-blue);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--secondary-red);
    padding-bottom: 5px;
    display: inline-block;
}

.service-card p {
    font-size: 0.95em;
    color: var(--medium-text);
}

/* Sección "Cómo Funciona" (Proceso Simple y Rápido) */
.how-it-works-grid {
    display: grid;
    grid-template-columns: 1fr; /* Una columna para mobile */
    gap: 30px;
    margin-top: 30px;
}

.step-card {
    text-align: center;
    padding: 20px;
    background-color: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px var(--shadow-light);
}

.step-card .icon {
    font-size: 2.5em;
    color: var(--secondary-red);
    margin-bottom: 15px;
    display: block;
}

.step-card h3 {
    font-size: 1.2em;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.step-card p {
    font-size: 0.9em;
    color: var(--medium-text);
    opacity: 0.9;
}

/* Sección "Sobre Nosotros" (About Us) */
.about-us-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

/* Secciones de Características (Feature Sections - con imagen y texto) */
.feature-section {
    padding: 50px 0;
    text-align: center;
}

.feature-content {
    display: flex;
    flex-direction: column; /* Columna para mobile */
    align-items: center;
    gap: 20px;
}

.feature-image-wrapper {
    flex-shrink: 0;
    width: 90%; /* Ajuste para mobile */
    max-width: 400px;
}

.feature-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--shadow-light);
}

.feature-text {
    text-align: left;
    padding: 0 20px; /* Padding interno para el texto */
}

.feature-text h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
}

.feature-text p {
    font-size: 1em;
    color: var(--medium-text);
}

/* Sección de Ubicación (Visítanos o Contáctanos) */
.location-section {
    padding: 50px 0;
    text-align: center;
}

.location-content {
    display: flex;
    flex-direction: column; /* Columna para mobile */
    align-items: center;
    gap: 30px;
}

.location-text {
    text-align: center;
    padding: 0 20px; /* Padding interno */
}

.location-text h2 {
    color: var(--primary-blue);
    font-size: 2em;
    margin-bottom: 15px;
}

.location-text .contact-details p {
    margin: 10px 0;
    color: var(--medium-text);
    opacity: 0.9;
    font-size: 1.1em;
}

.location-text .contact-details a {
    color: var(--secondary-red);
    font-weight: bold;
}

.location-image-wrapper {
    width: 90%; /* Ajuste para mobile */
    max-width: 400px;
}

.location-image-wrapper iframe {
    width: 100%;
    height: 300px; /* Altura fija para el mapa en mobile */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ========================================
 * 9. Estilos del Modal de Formulario de Contacto
 * ========================================
 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    width: 95%; /* Ancho para mobile */
    max-width: 450px;
    position: relative;
    animation-name: animatetop;
    animation-duration: 0.4s;
    text-align: left;
    margin: 20px auto;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
}

.close-button {
    color: var(--medium-text);
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--secondary-red);
}

.modal-content h2 {
    color: var(--primary-blue);
    font-size: 1.5em;
    margin-bottom: 10px;
}

.modal-content p {
    font-size: 0.9em;
    margin-bottom: 20px;
    color: var(--medium-text);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--dark-text);
    font-size: 0.9em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    color: var(--dark-text);
    background-color: var(--light-grey);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-group input[type="number"]:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.1);
    outline: none;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--medium-text);
    font-size: 0.85em;
}

.errorlist {
    color: var(--secondary-red);
    list-style-type: none;
    padding: 0;
    margin-top: 5px;
    font-size: 0.85em;
    text-align: left;
}

/* ========================================
 * 10. Estilos de Mensajes de Django
 * ========================================
 */
.messages {
    list-style: none;
    padding: 0;
    margin: 20px auto;
    width: 90%;
    max-width: 600px;
}
.messages li {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
}
.messages .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.messages .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
 * 11. Estilos de Pie de Página (Footer)
 * ========================================
 */
.footer {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
    font-size: 0.9em;
}

.footer-content {
    display: flex;
    flex-direction: column; /* Columna para móvil */
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

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

.footer-logo {
    max-width: 100px;
    height: auto;
    margin-bottom: 10px;
}

.footer-brand h2 {
    font-size: 1.8em;
    color: var(--white);
    margin-bottom: 5px;
}

.footer-brand p {
    font-size: 1.1em;
    color: var(--white);
    opacity: 0.8;
}

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

.footer-social h3 {
    font-size: 1.4em;
    color: var(--white);
    margin-bottom: 15px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-icons a {
    color: var(--white);
    font-size: 1.8em;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-icons a:hover {
    transform: translateY(-3px);
    color: var(--secondary-red);
}

.footer-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 20px;
    margin-top: 20px;
    color: var(--white);
    opacity: 0.7;
    font-size: 0.85em;
}

/* ========================================
 * 12. Media Queries (Diseño Responsivo para Tablets y Desktop)
 * ========================================
 */

@media (min-width: 768px) {
    /* Tipografía */
    h1 { font-size: 2.8em; }
    h2 { font-size: 2.2em; }
    h3 { font-size: 1.6em; }

    /* Header */
    .brand-name {
        font-size: 1.5em; /* Ajuste para desktop */
    }
    .main-nav .nav-list {
        display: flex; /* Muestra la navegación en fila para desktop */
        flex-direction: row;
        position: static; /* Quita la posición absoluta */
        width: auto;
        background-color: transparent;
        box-shadow: none;
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
        gap: 25px; /* Espacio entre los elementos del nav */
    }

    .main-nav .nav-list li {
        margin: 0; /* Elimina márgenes verticales */
    }

    .main-nav .nav-link,
    .main-nav .nav-button {
        display: inline-block; /* Vuelve a inline-block */
        padding: 0; /* Elimina padding excesivo */
        width: auto;
    }
    .main-nav .nav-button {
        padding: 8px 18px; /* Ajuste el padding para el botón en el nav */
        font-size: 0.9em; /* Tamaño de fuente ligeramente más pequeño */
        margin: 0; /* Elimina margen automático */
    }

    .menu-toggle {
        display: none; /* Oculta el botón de hamburguesa en desktop */
    }

    /* Secciones Generales */
    section {
        padding: 60px 0; /* Mayor padding vertical para desktop */
    }

    /* Hero Section */
    .hero-section {
        padding: 120px 0;
        min-height: 70vh; /* Mayor altura para desktop */
    }
    .hero-content h2 {
        font-size: 3em;
    }
    .hero-content p {
        font-size: 1.3em;
    }
    .btn-primary {
        padding: 15px 30px;
        font-size: 1.1em;
    }

    /* Servicios */
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 2 o 3 columnas flexibles */
        gap: 30px;
    }

    .service-card {
        padding: 30px;
    }

    .service-card h3 {
        font-size: 1.5em;
    }

    /* Cómo Funciona */
    .how-it-works-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 3 columnas */
        gap: 40px;
    }

    .step-card .icon {
        font-size: 3em;
    }

    .step-card h3 {
        font-size: 1.5em;
    }

    /* Modal */
    .modal-content {
        width: 80%;
        max-width: 500px;
    }

    /* Feature Sections (Imágenes y Texto) - Desktop */
    .feature-content {
        flex-direction: row; /* Fila para desktop */
        text-align: left;
        gap: 40px; /* Más espacio entre imagen y texto */
    }

    .feature-content.reverse {
        flex-direction: row-reverse; /* Invertir orden para la segunda sección */
    }

    .feature-image-wrapper {
        width: 50%; /* Ocupa la mitad del ancho */
        max-width: none;
    }

    .feature-text {
        width: 50%;
        padding: 0; /* Elimina padding extra */
    }
    
    /* Ubicación Section - Desktop */
    .location-content {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        gap: 40px; /* Más espacio entre mapa y texto */
    }

    .location-text {
        text-align: left;
        width: 50%;
        padding: 0; /* Elimina padding extra */
    }

    .location-image-wrapper {
        width: 40%;
        max-width: none;
    }

    .location-image-wrapper iframe {
        height: 350px; /* Ajuste la altura del mapa para desktop */
    }

    /* Footer */
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .footer-brand,
    .footer-social {
        text-align: left;
        flex: 1;
    }

    .footer-social {
        text-align: right;
    }

    .social-icons {
        justify-content: flex-end;
    }
}

/* Animaciones */
.fade-in {
    animation: fadeIn ease 0.5s;
}

@keyframes fadeIn {
    0%   {opacity: 0;}
    100% {opacity: 1;}
}