/* Variables de colores */
:root {
    --primary-blue: #003366;
    --primary-teal: #14b8a6;
    --secondary-teal: #0d9488;
    --light-bg: #f9fafb;
    --text-gray: #666;
    --white: #ffffff;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.propiedades-main {
    background-color: var(--white);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 400px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" x="0" y="0" fill="white" opacity="0.1"/></svg>');
    background-size: 50px 50px;
    opacity: 0.3;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 51, 102, 0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 0 24px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

.hero-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-teal) 0%, var(--secondary-teal) 100%);
}

/* Filtros Section */
.filtros-section {
    background-color: var(--white);
    padding: 48px 0;
    border-bottom: 1px solid #e5e7eb;
}

.filtros-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    align-items: end;
}

.filtro-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filtro-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filtro-icon {
    width: 18px;
    height: 18px;
    stroke: var(--primary-teal);
}

.filtro-select,
.ordenar-select {
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--primary-blue);
    background-color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.filtro-select:hover,
.ordenar-select:hover {
    border-color: var(--primary-teal);
}

.filtro-select:focus,
.ordenar-select:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.btn-aplicar-filtros {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--secondary-teal) 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}

.btn-aplicar-filtros:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.3);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Resultados Header */
.resultados-header {
    background-color: var(--light-bg);
    padding: 32px 0;
    border-bottom: 1px solid #e5e7eb;
}

.resultados-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.resultados-info {
    flex: 1;
}

.resultados-titulo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.resultados-count {
    font-size: 1rem;
    color: var(--text-gray);
}

.count-highlight {
    font-weight: 700;
    color: var(--primary-teal);
}

.ordenar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ordenar-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.ordenar-select {
    min-width: 220px;
}

/* Propiedades Grid */
.propiedades-section {
    padding: 64px 0;
}

.propiedades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 32px;
}

.propiedad-card {
    background-color: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.propiedad-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.badge-destacada {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--secondary-teal) 100%);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

.badge-icon {
    width: 14px;
    height: 14px;
}

.propiedad-imagen-wrapper {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.propiedad-imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.propiedad-card:hover .propiedad-imagen {
    transform: scale(1.1);
}

.imagen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.propiedad-card:hover .imagen-overlay {
    opacity: 1;
}

.btn-ver-galeria {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--white);
    color: var(--primary-blue);
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-ver-galeria:hover {
    background-color: var(--primary-teal);
    color: var(--white);
}

.btn-ver-galeria svg {
    width: 18px;
    height: 18px;
}

.tipo-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--primary-blue);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--primary-teal);
}

.propiedad-contenido {
    padding: 24px;
}

.propiedad-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-bg);
}

.propiedad-titulo {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 12px;
    line-height: 1.4;
    min-height: 60px;
}

.propiedad-ubicacion {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-size: 0.9375rem;
}

.ubicacion-icon {
    width: 18px;
    height: 18px;
    stroke: var(--primary-teal);
    flex-shrink: 0;
}

.propiedad-caracteristicas {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--light-bg);
}

.caracteristica {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.caracteristica-icon {
    width: 24px;
    height: 24px;
    stroke: var(--primary-teal);
}

.caracteristica-valor {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.caracteristica-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.caracteristica-divider {
    width: 1px;
    height: 40px;
    background-color: #e5e7eb;
}

.propiedad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.precio-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.precio-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.precio-valor {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-blue);
}

.acciones-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-favorito {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg);
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-favorito svg {
    width: 22px;
    height: 22px;
    stroke: var(--text-gray);
    transition: all 0.3s ease;
}

.btn-favorito:hover {
    background-color: var(--primary-teal);
    border-color: var(--primary-teal);
    transform: scale(1.05);
}

.btn-favorito:hover svg {
    stroke: var(--white);
    fill: var(--white);
}

.btn-ver-detalles {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    color: var(--white);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.2);
}

.btn-ver-detalles:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.3);
}

.btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.btn-ver-detalles:hover .btn-arrow {
    transform: translateX(4px);
}

/* Paginación */
.paginacion-section {
    padding: 48px 0 80px;
    background-color: var(--light-bg);
}

.paginacion-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.paginacion-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--white);
    color: var(--primary-blue);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.paginacion-btn svg {
    width: 20px;
    height: 20px;
}

.paginacion-btn:hover:not(.paginacion-disabled) {
    background-color: var(--primary-teal);
    color: var(--white);
    border-color: var(--primary-teal);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}

.paginacion-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.paginacion-numeros {
    display: flex;
    gap: 8px;
}

.paginacion-numero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: var(--white);
    color: var(--primary-blue);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.paginacion-numero:hover {
    background-color: var(--primary-teal);
    color: var(--white);
    border-color: var(--primary-teal);
    transform: translateY(-2px);
}

.paginacion-actual {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="white" opacity="0.1"/></svg>');
    background-size: 60px 60px;
}

.cta-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 48px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}

.cta-text {
    flex: 1;
    min-width: 300px;
}

.cta-titulo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 12px;
}

.cta-descripcion {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.cta-acciones {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-cta-primary,
.btn-cta-secondary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-cta-primary {
    background-color: var(--white);
    color: var(--primary-blue);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.btn-cta-primary:hover {
    background-color: var(--primary-teal);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
}

.btn-cta-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-cta-secondary:hover {
    background-color: var(--white);
    color: var(--primary-blue);
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 1200px) {
    .propiedades-grid {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .filtros-wrapper {
        grid-template-columns: 1fr;
    }

    .resultados-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .ordenar-wrapper {
        width: 100%;
    }

    .ordenar-select {
        flex: 1;
    }

    .propiedades-grid {
        grid-template-columns: 1fr;
    }

    .propiedad-titulo {
        font-size: 1.25rem;
        min-height: auto;
    }

    .precio-valor {
        font-size: 1.5rem;
    }

    .cta-content {
        flex-direction: column;
        text-align: center;
    }

    .cta-titulo {
        font-size: 2rem;
    }

    .cta-acciones {
        justify-content: center;
        width: 100%;
    }

    .btn-cta-primary,
    .btn-cta-secondary {
        flex: 1;
        justify-content: center;
    }

    .paginacion-wrapper {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .caracteristica-valor {
        font-size: 1rem;
    }

    .caracteristica-label {
        font-size: 0.625rem;
    }

    .propiedad-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .acciones-wrapper {
        width: 100%;
        justify-content: space-between;
    }

    .btn-ver-detalles {
        flex: 1;
        justify-content: center;
    }
}

/* ============================================================
   DOMUS — Gallery Modal System
   Versión: 2.0 — Enterprise Grade
   Modos: dark / light (adaptive via prefers-color-scheme)
   Componentes:
     1. Tokens & variables
     2. Grid modal (vista general)
     3. Lightbox (imagen expandida)
     4. Thumbnails strip
     5. Contador
     6. Zoom
     7. Controles de navegación
     8. Animaciones & keyframes
     9. Responsive
   ============================================================ */


/* ──────────────────────────────────────────────
   1. TOKENS & VARIABLES
   ────────────────────────────────────────────── */

:root {
    /* Gallery — dark defaults */
    --gal-bg-overlay: rgba(6, 6, 10, 0.96);
    --gal-bg-surface: #0e0f14;
    --gal-bg-surface-2: #161820;
    --gal-bg-thumb: #1c1e26;
    --gal-bg-thumb-hover: #252830;
    --gal-border: rgba(255, 255, 255, 0.07);
    --gal-border-active: rgba(255, 255, 255, 0.55);
    --gal-text-primary: #f2f2f5;
    --gal-text-muted: rgba(242, 242, 245, 0.45);
    --gal-accent: #c9a96e;
    /* dorado cálido — propiedad premium */
    --gal-accent-soft: rgba(201, 169, 110, 0.15);
    --gal-btn-bg: rgba(255, 255, 255, 0.10);
    --gal-btn-bg-hover: rgba(255, 255, 255, 0.18);
    --gal-shadow-card: 0 32px 64px -16px rgba(0, 0, 0, 0.7);
    --gal-shadow-thumb: 0 4px 16px rgba(0, 0, 0, 0.45);
    --gal-radius-modal: 20px;
    --gal-radius-img: 12px;
    --gal-radius-btn: 50%;
    --gal-transition: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    --gal-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --gal-thumb-h: 88px;
    --gal-bar-h: calc(var(--gal-thumb-h) + 32px);
    /* thumbnails + padding */
}

@media (prefers-color-scheme: light) {
    :root {
        --gal-bg-overlay: rgba(18, 18, 22, 0.82);
        --gal-bg-surface: #ffffff;
        --gal-bg-surface-2: #f4f4f6;
        --gal-bg-thumb: #ebebee;
        --gal-bg-thumb-hover: #dddde2;
        --gal-border: rgba(0, 0, 0, 0.08);
        --gal-border-active: rgba(0, 0, 0, 0.7);
        --gal-text-primary: #111116;
        --gal-text-muted: rgba(17, 17, 22, 0.4);
        --gal-accent: #a07840;
        --gal-accent-soft: rgba(160, 120, 64, 0.12);
        --gal-btn-bg: rgba(0, 0, 0, 0.07);
        --gal-btn-bg-hover: rgba(0, 0, 0, 0.14);
        --gal-shadow-card: 0 32px 64px -16px rgba(0, 0, 0, 0.18);
        --gal-shadow-thumb: 0 4px 16px rgba(0, 0, 0, 0.10);
    }
}


/* ──────────────────────────────────────────────
   2. GRID MODAL — Vista general estilo Airbnb
   ────────────────────────────────────────────── */

.gal-grid-modal {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: var(--gal-bg-overlay);
    display: flex;
    align-items: stretch;
    justify-content: center;
    animation: galFadeIn 0.32s ease both;
    font-family: var(--gal-font);
}

/* ── Panel interior ── */
.gal-grid-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1280px;
    background: var(--gal-bg-surface);
    overflow: hidden;
}

/* ── Header ── */
.gal-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--gal-border);
    flex-shrink: 0;
    gap: 1rem;
}

.gal-grid-header-left {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.gal-grid-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gal-text-primary);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.gal-grid-subtitle {
    font-size: 0.78rem;
    color: var(--gal-text-muted);
    margin-top: 1px;
}

.gal-accent-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gal-accent);
    flex-shrink: 0;
}

/* Botón cerrar grid */
.gal-grid-close {
    width: 38px;
    height: 38px;
    border-radius: var(--gal-radius-btn);
    background: var(--gal-btn-bg);
    border: 1px solid var(--gal-border);
    color: var(--gal-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--gal-transition), transform var(--gal-transition);
}

.gal-grid-close:hover {
    background: var(--gal-btn-bg-hover);
    transform: rotate(90deg) scale(1.05);
}

.gal-grid-close svg {
    width: 16px;
    height: 16px;
}

/* ── Área de imágenes scrollable ── */
.gal-grid-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.75rem 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--gal-border) transparent;
}

.gal-grid-body::-webkit-scrollbar {
    width: 5px;
}

.gal-grid-body::-webkit-scrollbar-track {
    background: transparent;
}

.gal-grid-body::-webkit-scrollbar-thumb {
    background: var(--gal-border);
    border-radius: 99px;
}

/* ── Layout tipo Airbnb: hero + mosaico ── */
.gal-mosaic {
    display: grid;
    gap: 6px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 320px 220px;
}

/* Hero — primera imagen grande */
.gal-mosaic-hero {
    grid-column: 1;
    grid-row: 1 / span 2;
}

/* Las 4 secundarias a la derecha */
.gal-mosaic-grid {
    display: grid;
    grid-column: 2;
    grid-row: 1 / span 2;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
}

/* Si hay más de 5 imágenes → grid normal */
.gal-extra-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
    margin-top: 6px;
}

/* ── Celda de imagen ── */
.gal-img-cell {
    position: relative;
    overflow: hidden;
    border-radius: var(--gal-radius-img);
    cursor: pointer;
    background: var(--gal-bg-surface-2);
}

.gal-img-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.3s ease;
    will-change: transform;
}

.gal-img-cell::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    border-radius: inherit;
}

.gal-img-cell:hover img {
    transform: scale(1.06);
}

.gal-img-cell:hover::after {
    background: rgba(0, 0, 0, 0.12);
}

/* Badge "última" — muestra cuántas más hay */
.gal-more-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(2px);
    border-radius: inherit;
    z-index: 2;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}

.gal-more-badge span:first-child {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.gal-more-badge span:last-child {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* ──────────────────────────────────────────────
   3. LIGHTBOX — Imagen expandida
   ────────────────────────────────────────────── */

.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99995;
    background: #060608;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    animation: galFadeIn 0.22s ease both;
    font-family: var(--gal-font);
    overflow: hidden;
}

/* ── Barra superior ── */
.gal-lb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

/* Botón cerrar lightbox */
.gal-lb-close {
    width: 40px;
    height: 40px;
    border-radius: var(--gal-radius-btn);
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--gal-transition), transform var(--gal-transition);
    flex-shrink: 0;
}

.gal-lb-close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg) scale(1.05);
}

.gal-lb-close svg {
    width: 16px;
    height: 16px;
}

/* ── Stage: área central de la imagen ── */
.gal-lb-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 0;
    padding: 0 72px;
}

/* Imagen principal */
.gal-lb-img-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gal-lb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.22s ease;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

.gal-lb-img.is-zoomed {
    cursor: zoom-out;
    transform: scale(2.2);
}

.gal-lb-img.is-animating {
    transition: opacity 0.18s ease, transform 0.18s ease;
    opacity: 0;
    transform: translateX(var(--slide-dir, 0)) scale(0.96);
}

/* ── Botones prev / next (sobre el stage) ── */
.gal-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 48px;
    height: 48px;
    border-radius: var(--gal-radius-btn);
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--gal-transition),
        transform var(--gal-transition),
        opacity var(--gal-transition);
    opacity: 0;
}

.gal-lightbox:hover .gal-lb-nav {
    opacity: 1;
}

.gal-lb-nav:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-50%) scale(1.08);
}

.gal-lb-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.gal-lb-nav svg {
    width: 20px;
    height: 20px;
}

.gal-lb-prev {
    left: 14px;
}

.gal-lb-next {
    right: 14px;
}

/* ── Barra inferior: counter + thumbnails ── */
.gal-lb-bottom {
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.875rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    z-index: 10;
}

/* Línea de progreso */
.gal-lb-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--gal-accent);
    transition: width 0.3s ease;
    border-radius: 0 99px 99px 0;
}


/* ──────────────────────────────────────────────
   4. CONTADOR
   ────────────────────────────────────────────── */

.gal-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.gal-counter-current {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    min-width: 2ch;
    text-align: right;
}

.gal-counter-sep {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.30);
}

.gal-counter-total {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    min-width: 2ch;
}

.gal-counter-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-left: 0.25rem;
}


/* ──────────────────────────────────────────────
   5. THUMBNAILS STRIP
   ────────────────────────────────────────────── */

.gal-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.gal-thumbs::-webkit-scrollbar {
    display: none;
}

.gal-thumb {
    flex-shrink: 0;
    width: calc(var(--gal-thumb-h) * 1.4);
    height: var(--gal-thumb-h);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    background: var(--gal-bg-thumb);
    transition: border-color var(--gal-transition),
        opacity var(--gal-transition),
        transform var(--gal-transition);
    opacity: 0.55;
}

.gal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.gal-thumb:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.gal-thumb.is-active {
    border-color: var(--gal-accent);
    opacity: 1;
    transform: translateY(-3px);
}

.gal-thumb.is-active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
    box-shadow: 0 0 0 2px var(--gal-accent) inset;
    pointer-events: none;
}


/* ──────────────────────────────────────────────
   6. ZOOM — indicador flotante
   ────────────────────────────────────────────── */

.gal-zoom-hint {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 99px;
    padding: 0.35rem 0.85rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.04em;
    pointer-events: none;
    transition: opacity var(--gal-transition);
}

.gal-zoom-hint svg {
    width: 13px;
    height: 13px;
    opacity: 0.7;
}

.gal-lb-img.is-zoomed~.gal-zoom-hint,
.is-zoomed-state .gal-zoom-hint {
    opacity: 0;
}


/* ──────────────────────────────────────────────
   7. CONTROLES TECLADO — hint visual
   ────────────────────────────────────────────── */

.gal-lb-topbar-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.04em;
    transition: opacity 0.3s ease;
}

.gal-key {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 0.65rem;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* Estado empty */
.gal-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
    text-align: center;
}

.gal-empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--gal-text-muted);
    opacity: 0.4;
}

.gal-empty-state p {
    color: var(--gal-text-muted);
    font-size: 0.9rem;
}


/* ──────────────────────────────────────────────
   8. KEYFRAMES & ANIMACIONES
   ────────────────────────────────────────────── */

@keyframes galFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes galSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

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

@keyframes galImgIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes galThumbPop {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }

    60% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.gal-grid-panel {
    animation: galSlideUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gal-lb-img {
    animation: galImgIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gal-thumb {
    animation: galThumbPop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Stagger para thumbs */
.gal-thumb:nth-child(1) {
    animation-delay: 0ms;
}

.gal-thumb:nth-child(2) {
    animation-delay: 30ms;
}

.gal-thumb:nth-child(3) {
    animation-delay: 60ms;
}

.gal-thumb:nth-child(4) {
    animation-delay: 90ms;
}

.gal-thumb:nth-child(5) {
    animation-delay: 120ms;
}

.gal-thumb:nth-child(6) {
    animation-delay: 150ms;
}

.gal-thumb:nth-child(7) {
    animation-delay: 180ms;
}

.gal-thumb:nth-child(8) {
    animation-delay: 210ms;
}

.gal-thumb:nth-child(9) {
    animation-delay: 240ms;
}

.gal-thumb:nth-child(10) {
    animation-delay: 270ms;
}


/* ──────────────────────────────────────────────
   9. RESPONSIVE
   ────────────────────────────────────────────── */

@media (max-width: 900px) {
    .gal-mosaic {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .gal-mosaic-hero {
        grid-column: 1;
        grid-row: 1;
        height: 260px;
    }

    .gal-mosaic-grid {
        grid-column: 1;
        grid-row: 2;
        height: 180px;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: 1fr;
    }
}

@media (max-width: 640px) {
    .gal-grid-header {
        padding: 1rem;
    }

    .gal-grid-body {
        padding: 1rem;
    }

    .gal-lb-topbar {
        padding: 0.75rem 1rem;
    }

    .gal-lb-stage {
        padding: 0 52px;
    }

    .gal-lb-nav {
        width: 38px;
        height: 38px;
    }

    .gal-lb-prev {
        left: 6px;
    }

    .gal-lb-next {
        right: 6px;
    }

    .gal-lb-bottom {
        padding: 0.75rem 1rem;
    }

    :root {
        --gal-thumb-h: 68px;
    }

    .gal-lb-topbar-center {
        display: none;
    }

    .gal-mosaic-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        height: 240px;
    }

    /* Ocultar 5ta imagen en móvil pequeño */
    .gal-mosaic-grid .gal-img-cell:nth-child(5) {
        display: none;
    }
}

@media (max-width: 400px) {
    .gal-lb-stage {
        padding: 0 42px;
    }

    .gal-key {
        display: none;
    }
}

/* Reducir movimiento para accesibilidad */
@media (prefers-reduced-motion: reduce) {

    .gal-grid-panel,
    .gal-lb-img,
    .gal-thumb,
    .gal-grid-modal,
    .gal-lightbox {
        animation: none !important;
        transition: none !important;
    }
}