/* ==============================================================
   1. VARIABLES GLOBALES (TEMAS Y COLORES)
   Documentación: Paleta de colores central. Cambiar un color aquí 
   actualizará toda la página automáticamente.
   ============================================================== */
:root {
    --color-principal: #2c3e50;    /* Azul oscuro: Encabezados y Footer */
    --color-acento: #e74c3c;       /* Rojo: Botones y destacados */
    --color-fondo: #f4f7f6;        /* Gris muy claro: Fondo general */
    --color-texto: #333333;        /* Gris oscuro: Texto de lectura */
    --color-blanco: #ffffff;       /* Blanco puro */
    --fuente-principal: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ==============================================================
   2. ESTILOS BASE Y ESTRUCTURA
   ============================================================== */
body {
    background-color: var(--color-fondo);
    color: var(--color-texto);
    font-family: var(--fuente-principal);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

section {
    padding: 40px 0;
    border-bottom: 1px solid #ddd;
}

h2 {
    color: var(--color-principal);
    border-left: 5px solid var(--color-acento);
    padding-left: 10px;
}

/* ==============================================================
   3. ENCABEZADO Y NAVEGACIÓN (HEADER)
   ============================================================== */
.header-principal {
    background-color: var(--color-principal);
    color: var(--color-blanco);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    width: 100%;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 80px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Marca y Logo (Unificado) */
.marca-empresa {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-empresa {
    height: 100px;
    width: auto;
    position: absolute; /* Logo flotante para no estirar la barra */
    top: 5px;
    left: 20px;
    z-index: 10;
    filter: drop-shadow(0px 4px 4px rgba(0,0,0,0.2));
    transition: transform 0.3s;
}

.logo-empresa:hover {
    transform: scale(1.05);
}

.header-texto {
    margin-left: 110px; /* Deja espacio para el logo flotante */
    text-align: left;
}

.header-texto h1 {
    font-size: 1.3rem;
    margin: 0;
}

.header-texto p {
    font-size: 0.8rem;
    margin: 0;
}

/* Navegación PC */
.nav-menu {
    display: flex;
    gap: 4px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--color-blanco);
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background-color: var(--color-acento);
    color: var(--color-blanco) !important;
}

.nav-activo {
    color: var(--color-blanco) !important;
    font-weight: bold;
}

.nav-menu a.nav-activo:hover {
    background-color: var(--color-acento);
    color: var(--color-principal) !important;
}

.menu-toggle {
    display: none;
    font-size: 30px;
    background: none;
    border: none;
    color: var(--color-blanco);
    cursor: pointer;
}

/* ==============================================================
   4. CARRUSEL / BANNER PRINCIPAL
   Documentación: Altura fija de 600px. Las imágenes se centran 
   y se recortan inteligentemente sin perder proporción.
   ============================================================== */
.carrusel {
    width: 100%;
    height: 600px;          /* Altura máxima estandarizada */
    overflow: hidden;
    position: relative;
    background-color: var(--color-blanco);
    display: flex;          /* Activamos Flexbox para centrar contenido */
    justify-content: center; 
    align-items: center;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
    /* Centrado interno del slide */
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide img, .banner-img {
    width: auto;
    max-width: 100%;
    height: 600px;
    object-fit: cover;         /* Clave: Llena el espacio sin deformar */
    object-position: center;     /* Clave: Centra el enfoque de la foto */
    display: block;
}

.indicadores {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}

.punto {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.punto.active {
    background-color: var(--color-acento);
    transform: scale(1.2);
}

/* ==============================================================
   5. TARJETAS DE SORTEOS
   ============================================================== */
.grid-sorteos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 380px)); 
    gap: 25px;
    padding: 30px;
    max-width: 1000px;
    margin: 0 auto;
    justify-content: center;
}

.sorteo-card {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.sorteo-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.sorteo-img-container {
    position: relative;
    width: 100%;
    height: 400px;
}

.sorteo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-activo {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27ae60;
    color: white;
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.sorteo-info {
    padding: 15px;
    text-align: center;
}

.sorteo-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: var(--color-principal);
    line-height: 1.2;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    margin-top: 10px;
    font-size: 0.85rem;
    border-radius: 8px;
    color: #7f8c8d;
}

.info-item strong {
    color: #34495e;
}

.valor-destacado strong {
    color: #2ecc71;
    font-size: 1.1em;
}

.btn-comprar {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    width: 100%;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.3s;
}

.btn-comprar:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

/* ==============================================================
   6. CONTACTO Y FORMULARIOS
   ============================================================== */
.grid-contacto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.bloque-info, .bloque-redes {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.bloque-formulario {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 40px auto;
    border: 1px solid #eee;
}

.formulario-contacto {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.campo {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.campo label {
    font-weight: bold;
    color: var(--color-principal);
    font-size: 0.9rem;
}

.campo input, .campo select, .campo textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.campo input:focus, .campo textarea:focus {
    outline: none;
    border-color: var(--color-acento);
}

.btn-enviar {
    background-color: var(--color-acento);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 10px;
}

.btn-enviar:hover {
    background-color: var(--color-principal);
    transform: translateY(-2px);
}

/* Botón WhatsApp */
.seccion-contacto {
    text-align: center;
    padding: 40px 20px;
    border: none !important;
}

.seccion-contacto h2 {
    border: none !important;
    padding-left: 0;
}

.btn-whatsapp-contacto {
    display: inline-block;
    background-color: #25D366;
    color: #ffffff !important;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 15px;
}

.btn-whatsapp-contacto:hover {
    background-color: #128C7E;
    transform: scale(1.05);
}

/* Redes Sociales y Otros */
.iconos-redes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.red-social {
    text-decoration: none;
    font-weight: bold;
    color: var(--color-principal);
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    transition: all 0.3s;
}

.red-social:hover {
    background: var(--color-principal);
    color: white;
}

.lista-loterias {
    list-style: none;
    padding: 0;
}

.lista-loterias li { margin-bottom: 10px; }

.lista-loterias a {
    color: var(--color-acento);
    text-decoration: none;
    font-weight: bold;
}

/* ==============================================================
   7. PIE DE PÁGINA (FOOTER)
   ============================================================== */
footer {
    background-color: var(--color-principal);
    color: var(--color-blanco);
    text-align: center;
    padding: 30px 10px;
    margin-top: 40px;
}

footer a {
    color: var(--color-blanco);
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.9rem;
}

/* ==============================================================
   8. ADAPTACIÓN PARA CELULARES (MEDIA QUERIES UNIFICADAS)
   Documentación: Todo el código responsivo está agrupado aquí 
   para facilitar su mantenimiento.
   ============================================================== */

/* Pantallas tipo Tablet y Celular (hasta 768px) */
@media (max-width: 768px) {
    /* Ajustes del Menú y Header */
    .menu-toggle { display: block; }
    
    .nav-menu {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 70px;
        right: 5%;
        left: auto;
        width: 200px;
        background-color: var(--color-principal);
        padding: 10px 0;
        border-radius: 12px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    }

    .nav-menu.activo { display: flex !important; }

    .nav-menu a {
        width: 100%;
        height: 35px;
        text-align: left;
        padding: 3px 20px;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        border-radius: 0;
    }

    .nav-menu a:last-child { border-bottom: none; }

    /* Ajuste de Logo para Celulares */
    .logo-empresa {
        height: 100px !important;
        position: static; /* Quitamos el absoluto para que se alinee normal */
        margin-top: 10px;
    }

    .header-texto {
        margin-left: 10px; /* Reducimos el margen porque el logo ya no flota */
    }

    /* Ajuste del Carrusel para Celulares */
    .carrusel {
        height: 300px !important; 
        /* Evita que la foto ocupe toda la pantalla del móvil  */
    }

    .slide img, .banner-img {
        height: 300px !important;
        width: auto; 
        max-width: 100%;
    }
}

/* Pantallas de Celular muy pequeñas (hasta 650px) */
@media (max-width: 650px) { 
    .bloque-formulario {
        margin: 20px 15px;
        padding: 20px;
    }    
}