/* ============================================== */
/* RESET & BASE                                   */
/* ============================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Onest';
    src: url('../fonts/Onest-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --rojo-supermaxi: #C8102E;
    --rojo-fecha: #DD1F30;
    --rojo-oscuro: #9B0A1E;
    --amarillo-fecha: #FFC828;
    --amarillo-btn: #F5C518;
    --azul-oscuro: #1B2A4A;
    --azul-btn: #1B3A5C;
    --blanco: #FFFFFF;
    --gris-claro: #F0F0F0;
    --gris-fondo: #E8E8E8;
    --sombra: rgba(0, 0, 0, 0.25);
    --font-main: 'Onest', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--blanco);
    background: var(--rojo-supermaxi);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================== */
/* NAVEGACIÓN ENTRE SECCIONES                     */
/* ============================================== */
.section-nav {
    position: fixed;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.nav-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: var(--blanco);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(6px);
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: scale(1.1);
}

.nav-arrow.disabled {
    opacity: 0.25;
    pointer-events: none;
}

.nav-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.25s ease;
}

.nav-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.nav-dot.active {
    background: var(--blanco);
    border-color: var(--blanco);
    transform: scale(1.2);
}

/* ============================================== */
/* SECCIÓN BASE                                   */
/* ============================================== */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Portada y Fechas: altura fija con scroll si el contenido excede */
.section-fit-viewport,
.section-fechas {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.section-bg .bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.section-content {

    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Portada y Fechas: contenido scrolleable si no cabe */
.section-fit-viewport .section-content,
.section-fechas .section-content {

    height: 100vh;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.section-fit-viewport .section-content::-webkit-scrollbar,
.section-fechas .section-content::-webkit-scrollbar { width: 6px; }
.section-fit-viewport .section-content::-webkit-scrollbar-track,
.section-fechas .section-content::-webkit-scrollbar-track { background: transparent; }
.section-fit-viewport .section-content::-webkit-scrollbar-thumb,
.section-fechas .section-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 3px; }

/* Header full width — TODOS iguales */
.section-header-full {
    width: 100%;
    margin-bottom: 1.5vh;
    flex-shrink: 0;
    max-height: 40vh;
    overflow: hidden;
}

.section-header-full .header-img {
    width: 100%;
    height: 100%;
    max-height: 40vh;
    display: block;
    object-fit: contain;
    object-position: center bottom;
}

/* Contenido centrado */
.content-centered {
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.2vh;
    padding: 0 20px;
}

.content-centered img {
    margin: 0 auto;
}

/* ============================================== */
/* *APLICAN TÉRMINOS Y CONDICIONES                */
/* ============================================== */
.tyc-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--amarillo-fecha);
    margin-bottom: 1.5vh;
    letter-spacing: 0.02em;
}

/* ============================================== */
/* FOOTER DE SECCIÓN: Logo + Disclaimer           */
/* ============================================== */
.section-footer {
    width: 100%;
    margin-top: 2vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    max-width: 240px;
    padding: 15px 20px;
}

.footer-logo .logo-img {
    width: 100%;
    margin: 0 auto;
}

.footer-disclaimer {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    padding: 10px 20px;
    text-align: center;
}

.footer-disclaimer p {
    font-size: 11px;
    font-weight: 600;
    color: var(--blanco);
    letter-spacing: 0.03em;
}

/* ============================================== */
/* SECCIÓN 1: PORTADA                             */
/* ============================================== */
.portada-textos {
    max-width: 800px;
    margin-bottom: 1vh;
}

/* Botones — siempre lado a lado, más grandes */
.portada-botones {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    margin-bottom: 1.5vh;
    width: 100%;
    max-width: 700px;
    padding: 0 20px;
}

.btn-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, filter 0.2s ease;
    cursor: pointer;
}

.btn-nav:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.btn-nav:active {
    transform: scale(0.98);
}

/* Texto sobre botones: Onest Light 9px */
.btn-label {
    font-size: 9px;
    font-weight: 300;
    color: var(--blanco);
    opacity: 0.9;
    max-width: 200px;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.btn-img {
    max-width: 200px;
    height: auto;
}

/* ============================================== */
/* SECCIÓN 2: ÁLBUM / GALERÍA                     */
/* ============================================== */
.section-album {
    min-height: 100vh;
    background: var(--gris-fondo);
}

.album-textos {
    max-width: 650px;
    margin-bottom: 2vh;
}

.galeria-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.galeria-bg-white {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    padding: 25px;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    min-height: 300px;
}

.galeria-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--rojo-supermaxi);
}

.galeria-loading p {
    margin-top: 15px;
    font-weight: 600;
    font-size: 16px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gris-claro);
    border-top-color: var(--rojo-supermaxi);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.cromo-item {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    background: var(--blanco);
    box-shadow: 0 2px 8px var(--sombra);
}

.cromo-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.cromo-item img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 861 / 1221;
    object-fit: cover;
}

.galeria-vacia {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--rojo-supermaxi);
}

.galeria-vacia p {
    font-size: 18px;
    font-weight: 600;
}

/* Paginación */
.galeria-paginacion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
}

.btn-pag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid var(--rojo-supermaxi);
    background: var(--blanco);
    color: var(--rojo-supermaxi);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pag:hover:not(:disabled) {
    background: var(--rojo-supermaxi);
    color: var(--blanco);
}

.btn-pag:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pag-numeros {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pag-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid var(--rojo-supermaxi);
    background: var(--blanco);
    color: var(--rojo-supermaxi);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main);
}

.pag-num:hover {
    background: var(--rojo-supermaxi);
    color: var(--blanco);
}

.pag-num.active {
    background: var(--rojo-supermaxi);
    color: var(--blanco);
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active { opacity: 1; visibility: visible; }

.lightbox-content { max-width: 90vw; max-height: 90vh; position: relative; }

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -15px; right: -15px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--rojo-supermaxi);
    color: var(--blanco);
    border: 3px solid var(--blanco);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    z-index: 10;
}

.lightbox-close:hover { transform: scale(1.15); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: var(--blanco);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    backdrop-filter: blur(4px);
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.4); }
.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }

/* ============================================== */
/* SECCIÓN 3: FECHAS                              */
/* ============================================== */
.fechas-textos {
    max-width: 650px;
    margin-bottom: 1vh;
}

.fechas-tabla {
    width: 100%;
    margin: 0 auto 1.5vh auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
}

.tabla-fechas-html {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fecha-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.fecha-dia {
    color: var(--rojo-fecha);
    padding: 8px 18px;
    min-width: 150px;
    max-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    border-radius: 0;
    flex-shrink: 0;
    border: 1.5px solid var(--rojo-fecha);
}

.fecha-dia span {
    font-size: 14px;
    font-weight: 700;
    margin-right: 5px;
}

.fecha-row-blanco .fecha-dia { background: var(--blanco); }
.fecha-row-amarillo .fecha-dia { background: var(--amarillo-fecha); }

.fecha-lugares {
    padding: 5px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    text-align: left;
}

.fecha-lugares p {
    font-size: 15px;
    font-weight: 300;
    color: var(--blanco);
    line-height: 1.4;
}

.fecha-lugares strong {
    font-weight: 700;
}

/* ============================================== */
/* RESPONSIVE - MOBILE                            */
/* ============================================== */
@media (max-width: 768px) {
    /* En mobile: no forzar height, dejar que el contenido fluya */
    .section-fit-viewport,
    .section-fechas {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .section-fit-viewport .section-content,
    .section-fechas .section-content {
        height: auto;
        overflow: visible;
    }

    /* Portada mobile: distribuir contenido para ocupar toda la pantalla */
    .section-portada .section-content {
        min-height: 100vh;
        justify-content: space-between;
    }

    /* Portada mobile: header más grande */
    .section-portada .section-header-full {
        min-height: 32vh;
    }

    .section-portada .section-header-full .header-img {
        object-fit: cover;
        object-position: center center;
        min-height: 32vh;
    }

    /* Portada mobile: bajar textos y botones para rellenar espacio */
    .section-portada .portada-textos {
        margin-top: 0;
    }

    .section-portada .portada-botones {
        margin-top: 1.5vh;
        margin-bottom: 3vh;
    }

    /* MARGEN LATERAL MOBILE — aire en los costados */
    .section-content {
        padding: 0 35px;
    }

    /* Header full width: pegado arriba, se extiende fuera del padding */
    .section-header-full {
        max-height: none;
        margin-left: -35px;
        margin-right: -35px;
        width: calc(100% + 70px);
        margin-top: 0;
    }

    /* Asegurar que la sección empieza desde arriba */
    .section {
        align-items: flex-start;
    }

    .section-content {
        justify-content: flex-start;
    }

    .section-header-full .header-img {
        max-height: none;
        object-fit: contain;
        width: 100%;
        height: auto;
    }

    /* Disclaimer full width */
    .footer-disclaimer {
        margin-left: -35px;
        margin-right: -35px;
        width: calc(100% + 70px);
    }

    /* Nav lateral: fuera del margen */
    .section-nav {
        right: 5px;
        gap: 6px;
    }

    .nav-arrow { width: 28px; height: 28px; }
    .nav-arrow svg { width: 15px; height: 15px; }
    .nav-dot { width: 8px; height: 8px; }
    .nav-dots { gap: 6px; }

    /* Content centered ya no necesita su propio padding */
    .content-centered { padding: 0; }

    /* Portada mobile: botones más pequeños, con sub-margen extra */
    .portada-botones {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 0 15px;
    }

    .btn-img { max-width: 130px; }

    .btn-label {
        font-size: 8px;
        max-width: 160px;
    }

    /* TyC mobile */
    .tyc-text { font-size: 10px; }

    /* Footer mobile */
    .footer-logo { max-width: 160px; padding: 12px 0; }
    .footer-disclaimer { padding: 8px 15px; }
    .footer-disclaimer p { font-size: 10px; }

    /* Portada: footer pegado al fondo de la sección */
    .section-portada .section-footer {
        margin-top: auto;
    }

    /* Galería mobile */
    .galeria-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .galeria-bg-white { padding: 12px; border-radius: 12px; }
    .galeria-container { padding: 0; }

    .galeria-paginacion { gap: 6px; }
    .btn-pag { padding: 8px 14px; font-size: 12px; }
    .btn-pag span { display: none; }
    .pag-num { width: 32px; height: 32px; font-size: 12px; }

    /* Fechas mobile */
    .fechas-tabla { padding: 0; }

    .fecha-row { gap: 12px; }

    .fecha-dia {
        min-width: 120px;
        max-width: 120px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .fecha-dia span { font-size: 12px; }
    .fecha-lugares p { font-size: 13px; }

    /* Lightbox mobile */
    .lightbox-prev { left: 5px; }
    .lightbox-next { right: 5px; }
    .lightbox-content { max-width: 95vw; }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .galeria-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

/* ============================================== */
/* ANIMACIONES                                    */
/* ============================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
