/*
 * ustedes.css — Galería "Ustedes" — Impala Victoria (R1)
 */

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
    --fuente-display: 'Cormorant Garamond', Georgia, serif;
    --fuente-ui:      'Barlow Condensed', sans-serif;
    --fuente-cuerpo:  'Barlow', sans-serif;

    --h-fondo:        #0d2535;
    --h-fondo-alt:    #0a1e2c;
    --h-fondo-claro:  #112840;
    --h-dorado:       #c9a84c;
    --h-dorado-claro: #e0bf6e;
    --h-texto:        #ffffff;
    --h-texto-suave:  rgba(255,255,255,0.75);
    --h-texto-tenue:  rgba(255,255,255,0.4);
    --h-borde:        rgba(201,168,76,0.22);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body {
    background: var(--h-fondo);
    color: var(--h-texto);
    font-family: var(--fuente-cuerpo);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--h-dorado); }
ul { list-style: none; }
button, input { font-family: inherit; font-size: inherit; }

/* ============================================================
   NAVEGACIÓN
   ============================================================ */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10000;
    padding: 20px 0;
    transition: background 0.3s, padding 0.3s;
}
.nav.scrolled {
    background: var(--h-nav-bg, rgba(13,37,53,0.97));
    backdrop-filter: blur(8px);
    padding: 12px 0;
    border-bottom: 1px solid var(--h-borde);
}
.nav__inner {
    max-width: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}
.nav__logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}
.nav__logo img { height: 78px; width: auto; }
.nav__logo-texto { display: flex; flex-direction: column; line-height: 1.2; }
.nav__logo-nombre {
    font-family: var(--fuente-display);
    font-size: 2.08rem;
    font-weight: 400;
    font-style: italic;
    color: #fff;
    letter-spacing: 0.02em;
}
.nav__logo-subtitulo {
    font-family: var(--fuente-ui);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--h-dorado);
}
.nav__menu {
    display: flex;
    gap: 36px;
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    transform: translateY(-50%);
    justify-content: center;
    align-items: center;
}
.nav__menu a {
    font-family: var(--fuente-cuerpo);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    position: relative;
    padding-bottom: 4px;
    transition: color 0.2s;
}
.nav__menu a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 1px;
    background: var(--h-dorado);
    transition: width 0.3s;
}
.nav__menu a:hover,
.nav__menu a.activo { color: #fff; }
.nav__menu a:hover::after,
.nav__menu a.activo::after { width: 100%; }
.nav__hamburguesa {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    position: fixed;
    top: 24px;
    right: 20px;
    z-index: 10001;
}
.nav__hamburguesa span {
    display: block;
    width: 24px; height: 1.5px;
    background: #fff;
    transition: all 0.2s;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.contenedor {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ============================================================
   BANNER
   ============================================================ */
.imagen-separadora {
    position: relative;
    height: 340px;
    overflow: hidden;
    margin-top: 118px;
}
.imagen-separadora img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4);
}
.imagen-separadora__breadcrumb {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1280px;
    padding: 0 40px;
}
.imagen-separadora__breadcrumb span,
.imagen-separadora__breadcrumb a {
    font-family: var(--fuente-ui);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--h-texto-suave);
}
.imagen-separadora__breadcrumb a:hover { color: var(--h-dorado); }
.imagen-separadora__breadcrumb .separador { margin: 0 0.5rem; color: var(--h-dorado); }

/* ============================================================
   TIPOGRAFÍA AUXILIAR
   ============================================================ */
.volanta {
    display: block;
    font-family: var(--fuente-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--h-dorado);
    margin-bottom: 10px;
}
.separador-acento {
    display: block;
    width: 40px;
    height: 2px;
    background: var(--h-dorado);
    margin: 16px auto 0;
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
.animar-entrada {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.animar-entrada.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   SECCIÓN GALERÍA
   ============================================================ */
.ust-catalogo { padding: 60px 0 80px; }

.ust-encabezado {
    text-align: center;
    margin-bottom: 48px;
}
.ust-encabezado h2 {
    font-family: var(--fuente-display);
    font-size: clamp(2.2rem, 3.5vw, 3.8rem);
    font-weight: 600;
    font-style: italic;
    line-height: 1.2;
    color: var(--h-texto);
    max-width: 720px;
    margin: 0 auto;
}

/* ============================================================
   GRILLA DE FOTOS — filas alternadas: 3 apaisadas / 4 verticales,
   repitiendo según la cantidad de fotos habilitadas
   ============================================================ */
.ust-fila {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.ust-fila--h { height: 340px; }
.ust-fila--v { height: 480px; }

.ust-item {
    position: relative;
    flex: 1;
    overflow: hidden;
    cursor: pointer;
    background: var(--h-ustedes-grid, var(--h-fondo, #0d2535));
}
.ust-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.ust-item:hover img { transform: scale(1.04); }
.ust-item__overlay {
    position: absolute;
    inset: 0;
    background: rgba(7,15,22,0);
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ust-item:hover .ust-item__overlay {
    background: rgba(7,15,22,0.35);
}
.ust-item__overlay svg {
    opacity: 0;
    color: rgba(255,255,255,0.8);
    transition: opacity 0.3s;
}
.ust-item:hover .ust-item__overlay svg { opacity: 1; }

.ust-vacio {
    text-align: center;
    padding: 80px 0;
    color: var(--h-texto-tenue);
    font-family: var(--fuente-ui);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

/* ============================================================
   MODAL GALERÍA
   ============================================================ */
.ust-overlay {
    position: fixed;
    inset: 0;
    background: var(--h-pie-fondo-a90, rgba(7,15,22,0.92));
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 130px 20px 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.ust-overlay.abierto {
    opacity: 1;
    pointer-events: all;
}

/* Flecha (izquierda / derecha — fuera del marco) */
.ust-flecha {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    z-index: 1;
}
.ust-flecha:hover {
    background: var(--h-dorado);
    border-color: var(--h-dorado);
    color: var(--h-fondo);
}
.ust-flecha svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Marco de la foto */
.ust-marco {
    position: relative;
    width: min(560px, calc(100vw - 160px));
    height: min(680px, calc(100vh - 160px));
    background: var(--h-fondo-alt, #0a1e2c);
    border: 1px solid var(--h-borde);
    flex-shrink: 0;
    overflow: hidden;
}
.ust-marco__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.ust-marco__cerrar {
    position: absolute;
    top: 12px; right: 14px;
    background: rgba(0,0,0,0.45);
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
    padding: 2px 6px;
    border-radius: 3px;
    transition: color 0.2s, background 0.2s;
}
.ust-marco__cerrar:hover {
    color: #fff;
    background: rgba(0,0,0,0.7);
}
.ust-marco__contador {
    position: absolute;
    bottom: 12px; left: 50%;
    transform: translateX(-50%);
    font-family: var(--fuente-ui);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.45);
    background: rgba(0,0,0,0.4);
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ============================================================
   PIE
   ============================================================ */
.pie {
    background: var(--h-pie-fondo, #070f16);
    border-top: 1px solid var(--h-borde);
    padding: 70px 0 30px;
}
.pie .contenedor { max-width: 1280px; }
.pie__logo-top { text-align: center; margin-bottom: 36px; }
.pie__logo-top img { height: 78px; margin: 0 auto 12px; }
.pie__logo-nombre {
    font-family: var(--fuente-display);
    font-size: 2.08rem;
    font-weight: 400;
    font-style: italic;
    color: #fff;
    letter-spacing: 0.02em;
}
.pie__logo-sub {
    font-family: var(--fuente-ui);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--h-dorado);
    margin-top: 4px;
}
.pie__separador {
    width: 50px; height: 1px;
    background: var(--h-borde);
    margin: 0 auto 50px;
}
.pie__grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}
.pie__col-titulo {
    font-family: var(--fuente-ui);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--h-dorado);
    margin-bottom: 20px;
}
.pie__col-texto,
.pie__col p,
.pie__col a {
    font-family: var(--fuente-cuerpo);
    font-size: 15px;
    color: var(--h-texto-tenue);
    line-height: 2;
}
.pie__col a:hover { color: var(--h-dorado); }
.pie__col--nav nav { display: flex; flex-direction: column; gap: 6px; }
.pie__col--nav nav a { font-size: 15px; color: var(--h-texto-tenue); transition: color 0.2s; }
.pie__col--nav nav a:hover { color: var(--h-dorado); }
.pie__redes { display: flex; gap: 10px; margin-top: 16px; }
.pie__redes a {
    width: 34px; height: 34px;
    border: 1px solid var(--h-borde-sutil, rgba(255,255,255,0.15));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--h-texto-tenue);
    transition: all 0.2s;
}
.pie__redes a:hover { border-color: var(--h-dorado); color: var(--h-dorado); }
.pie__copyright {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 24px;
    text-align: center;
    font-family: var(--fuente-ui);
    font-size: 12px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.08em;
}

/* ============================================================
   BTN TOP
   ============================================================ */
.btn-top {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 900;
    width: 44px; height: 44px;
    background: var(--h-dorado);
    color: var(--h-fondo);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    pointer-events: none;
}
.btn-top.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.btn-top:hover { background: var(--h-dorado-claro); }
.btn-top svg { width: 18px; height: 18px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .nav__logo img { height: 56px; }
    .nav__logo-nombre { font-size: 1.5rem; }
    .nav__logo-subtitulo { font-size: 11px; }
    .nav__hamburguesa { display: flex; }
    .nav__menu {
        position: fixed !important;
        top: 0 !important; right: -225px !important;
        left: auto !important; bottom: 0 !important;
        width: 185px !important; height: 100vh !important;
        margin: 0 !important; padding: 110px 24px 40px !important;
        background: var(--h-nav-mobile-bg, rgba(13,37,53,0.98)) !important;
        display: flex !important; flex-direction: column !important;
        align-items: stretch !important; justify-content: flex-start !important;
        text-align: right !important; gap: 22px !important;
        z-index: 10000 !important; transition: none !important;
        border-left: 1px solid rgba(255,255,255,0.08) !important;
        backdrop-filter: blur(10px) !important;
        overflow-y: auto !important; transform: none !important;
        box-shadow: -10px 0 30px rgba(0,0,0,.35);
    }
    .nav__menu.abierto {
        right: 0 !important;
        transition: right .35s ease !important;
    }
    .nav__menu a {
        display: block; width: 100%;
        text-align: right; font-size: 15px;
        margin: 0; padding: 6px 0; color: #fff;
    }
    .nav__menu a:hover { color: var(--h-dorado); }
    .imagen-separadora { margin-top: 96px; }
}

@media (max-width: 960px) {
    .ust-fila--h { height: 240px; }
    .ust-fila--v { height: 340px; }
    .imagen-separadora { height: 260px; margin-top: 90px; }
    .ust-catalogo { padding: 40px 0 60px; }
    .ust-flecha { width: 40px; height: 40px; }
    .ust-overlay { padding-top: 100px; }
    .ust-marco {
        width: min(480px, calc(100vw - 120px));
        height: min(600px, calc(100vh - 140px));
    }
}

@media (max-width: 700px) {
    .contenedor { padding: 0 20px; }
    .imagen-separadora { height: 200px; }
    .imagen-separadora__breadcrumb { padding: 0 20px; }
    .ust-fila { flex-wrap: wrap; height: auto; gap: 4px; }
    .ust-fila--h .ust-item { flex: 0 0 calc(50% - 2px); height: 170px; }
    .ust-fila--v .ust-item { flex: 0 0 calc(50% - 2px); height: 230px; }
    /* Si la última foto de la fila queda sola (cantidad impar), ocupa el ancho completo en vez de dejar un hueco */
    .ust-fila .ust-item:last-child:nth-child(odd) { flex: 0 0 100%; }
    .ust-catalogo { padding: 32px 0 48px; }
    .pie__grid { grid-template-columns: 1fr; gap: 30px; }
    /* Modal mobile: foto arriba, flechas abajo en la misma fila */
    .ust-overlay {
        flex-wrap: wrap;
        align-content: center;
        gap: 10px;
        padding: 100px 16px 16px;
    }
    .ust-marco {
        order: 1;
        flex: 0 0 100%;
        width: 100%;
        height: min(400px, calc(100vh - 220px));
    }
    .ust-flecha--izq { order: 2; }
    .ust-flecha--der { order: 2; margin-left: auto; }
}
