/* ==========================================================================
   1. VARIABLES, RESET Y BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-fondo: #FBF7F1;
    --color-superficie: #FFFFFF;
    --color-texto: #3B332A;
    --color-texto-muted: #8A7F70;
    --color-texto-terciario: #A79C8C;
    --color-acento: #7C8A6E;
    --color-acento-hover: #63704F;
    --color-acento-suave: #EEF1E7;
    --color-acento-suave-borde: #D9E0CC;
    --color-borde: #E7DFD1;
    --color-error: #B5533C;
    --fuente-titulo: 'Parisienne', cursive;
    --fuente-cuerpo: 'Montserrat', sans-serif;
}

body {
    font-family: var(--fuente-cuerpo);
    font-weight: 400;
    background-color: var(--color-fondo);
    color: var(--color-texto);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: var(--fuente-titulo);
    font-weight: 400;
    color: var(--color-texto);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   2. CABECERA
   ========================================================================== */
.cabecera {
    position: relative;
    height: 72vh;
    min-height: 420px;
    max-height: 780px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    background-image: url('../assets/f6.jpg');
    background-size: cover;
    background-position: center;
    padding: 32px 20px;
}

.cabecera-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20, 16, 10, 0.85) 0%, rgba(20, 16, 10, 0.35) 45%, rgba(20, 16, 10, 0) 75%);
}

.cabecera-contenido {
    position: relative;
    z-index: 1;
    color: #FBF7F1;
    max-width: 600px;
    animation: aparecer 0.8s ease both;
}

.cabecera-fecha {
    font-family: var(--fuente-cuerpo);
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.cabecera-nombres {
    font-family: var(--fuente-titulo);
    font-size: clamp(44px, 10vw, 72px);
    line-height: 1.15;
    margin-bottom: 10px;
    color: #FBF7F1;
}

.cabecera-subtitulo {
    font-family: var(--fuente-cuerpo);
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   3. ZONA DE SUBIDA
   ========================================================================== */
.zona-subida {
    margin-top: -36px;
    position: relative;
    z-index: 2;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    animation: aparecer 0.6s ease both;
}

.dropzone {
    background: var(--color-superficie);
    border: 1.5px dashed var(--color-borde);
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(59, 51, 42, 0.08);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropzone.arrastrando {
    border-color: var(--color-acento);
    background: var(--color-acento-suave);
}

.icono-subida {
    margin-bottom: 10px;
}

.dropzone-texto-desktop {
    font-size: 0.85rem;
    color: var(--color-texto-muted);
    margin-bottom: 14px;
}

.btn-subir {
    font-family: var(--fuente-cuerpo);
    font-weight: 500;
    background: var(--color-acento);
    color: var(--color-superficie);
    border: none;
    padding: 13px 28px;
    border-radius: 9px;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-subir:hover {
    background: var(--color-acento-hover);
}

.btn-ancho {
    width: 100%;
}

.dropzone-ayuda {
    margin-top: 14px;
    font-size: 0.72rem;
    color: var(--color-texto-muted);
}

/* ==========================================================================
   4. CHIP DE NOMBRE
   ========================================================================== */
.chip-nombre {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
    padding: 8px 16px;
    background: var(--color-acento-suave);
    border: 1px solid var(--color-acento-suave-borde);
    border-radius: 20px;
    font-size: 0.78rem;
    color: var(--color-texto-muted);
    text-align: center;
}

.chip-nombre strong {
    color: var(--color-texto);
    font-weight: 600;
}

.chip-no-soy {
    font-family: var(--fuente-cuerpo);
    background: none;
    border: none;
    padding: 0;
    color: var(--color-acento);
    text-decoration: underline;
    font-size: 0.78rem;
    cursor: pointer;
}

.chip-no-soy:hover {
    color: var(--color-acento-hover);
}

/* ==========================================================================
   5. PROGRESO DE SUBIDA
   ========================================================================== */
.lista-progreso {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-progreso {
    background: var(--color-superficie);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(59, 51, 42, 0.06);
    animation: aparecer 0.4s ease both;
}

.item-progreso-fila {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.item-progreso-nombre {
    color: var(--color-texto);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-progreso-porcentaje {
    color: var(--color-texto-muted);
    font-size: 0.72rem;
    flex-shrink: 0;
}

.item-progreso-barra-fondo {
    background: #EEEAE0;
    border-radius: 2px;
    height: 5px;
    overflow: hidden;
}

.item-progreso-barra {
    background: var(--color-acento);
    height: 100%;
    width: 0%;
    transition: width 0.2s ease;
}

.item-progreso.error .item-progreso-barra {
    background: var(--color-error);
}

.item-progreso.error .item-progreso-porcentaje {
    color: var(--color-error);
}

.item-progreso.completo .item-progreso-barra {
    background: var(--color-acento);
}

/* ==========================================================================
   6. BANNER DE AGRADECIMIENTO
   ========================================================================== */
.banner-gracias {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-acento-suave);
    border: 1px solid var(--color-acento-suave-borde);
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--color-texto);
    animation: aparecer 0.4s ease both;
}

.banner-gracias[hidden] {
    display: none;
}

/* ==========================================================================
   7. GALERÍA
   ========================================================================== */
.seccion-galeria {
    margin-top: 44px;
}

.seccion-galeria h2 {
    text-align: center;
    font-size: 2.1rem;
    margin-bottom: 20px;
}

.galeria-vacio {
    text-align: center;
    color: var(--color-texto-muted);
    font-size: 0.9rem;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 600px) {
    .galeria-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1000px) {
    .galeria-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.tarjeta-media {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: 7px;
    overflow: hidden;
    background: var(--color-acento-suave);
    box-shadow: 0 2px 10px rgba(59, 51, 42, 0.08);
}

.tarjeta-media.nueva {
    animation: aparecer 0.5s ease both;
}

.tarjeta-media img,
.tarjeta-media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.tarjeta-media .icono-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(20, 16, 10, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.tarjeta-media .icono-play svg {
    margin-left: 2px;
}

.tarjeta-overlay-nombre {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 8px 6px;
    background: linear-gradient(to top, rgba(20, 16, 10, 0.7) 0%, rgba(20, 16, 10, 0) 100%);
    color: #FBF7F1;
    font-size: 0.68rem;
    font-family: var(--fuente-cuerpo);
    pointer-events: none;
}

.tarjeta-borrar {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(20, 16, 10, 0.45);
    color: #FBF7F1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.9;
}

.tarjeta-borrar:hover {
    background: var(--color-error);
}

/* ==========================================================================
   8. DESCARGAR TODAS
   ========================================================================== */
.zona-descargar {
    margin-top: 28px;
    text-align: center;
}

.btn-outline-salvia {
    font-family: var(--fuente-cuerpo);
    font-weight: 500;
    background: transparent;
    border: 1.5px solid var(--color-acento);
    color: var(--color-acento);
    padding: 11px 24px;
    border-radius: 9px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-outline-salvia:hover {
    background: var(--color-acento);
    color: var(--color-superficie);
}

.texto-descargar {
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--color-texto-terciario);
}

/* ==========================================================================
   9. MODAL NOMBRE INVITADO
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 10, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-tarjeta {
    background: var(--color-superficie);
    border-radius: 16px;
    padding: 32px 26px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 32px rgba(20, 16, 10, 0.25);
    animation: aparecer 0.3s ease both;
}

.modal-tarjeta h3 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.modal-tarjeta p {
    font-size: 0.85rem;
    color: var(--color-texto-muted);
    margin-bottom: 18px;
}

.modal-tarjeta input {
    width: 100%;
    font-family: var(--fuente-cuerpo);
    padding: 10px 4px;
    border: none;
    border-bottom: 1.5px solid var(--color-borde);
    border-radius: 0;
    font-size: 1rem;
    margin-bottom: 16px;
    background: transparent;
    color: var(--color-texto);
    text-align: center;
    transition: border-color 0.2s ease;
}

.modal-tarjeta input:focus {
    outline: none;
    border-bottom-color: var(--color-acento);
}

.modal-tarjeta p.modal-error {
    color: var(--color-error);
    font-size: 0.75rem;
    margin-top: -10px;
    margin-bottom: 14px;
}

/* ==========================================================================
   10. LIGHTBOX
   ========================================================================== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 8, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.lightbox-overlay[hidden] {
    display: none;
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
}

.lightbox-cerrar {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #FBF7F1;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #FBF7F1;
    font-size: 2.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 10px;
    opacity: 0.8;
}

.lightbox-flecha:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 6px;
}

.lightbox-next {
    right: 6px;
}

.lightbox-flecha[hidden] {
    display: none;
}

/* ==========================================================================
   11. PIE DE PÁGINA
   ========================================================================== */
.pie-fotos {
    text-align: center;
    padding: 36px 20px;
    font-family: var(--fuente-titulo);
    font-size: 1.6rem;
    color: var(--color-texto);
}

/* ==========================================================================
   12. RESPONSIVE
   ========================================================================== */
@media (max-width: 699px) {
    .dropzone-texto-desktop {
        display: none;
    }

    .lightbox-flecha {
        font-size: 2.2rem;
    }
}
