/* Estilos Globales para forzar el alto del viewport */
html {
    height: 100%;
}

body {
    height: 100%;
    height: 100dvh;
    min-height: -webkit-fill-available;
    margin: 0;
    overflow: hidden;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: 'Outfit', sans-serif;
}

/* Permitir scroll en páginas específicas (ej: Contacto) */
html.scroll-active {
    height: auto !important;
    overflow-y: auto !important;
}

body.scroll-active {
    overflow-y: auto !important;
    height: auto !important;
}

/* 
    ✨ ExpoSISTEMAS Design System 2026 
    Arquitectura Escalable y Minimalista
*/

:root {
    /* --- Palette --- */
    --color-cta: #FF6B00;          /* Naranja Brillante CTA */
    --color-cta-hover: #e06710;
    --color-accent: #4A90E2;       /* Azul Acento */
    --color-accent-rgb: 74, 144, 226;
    
    /* --- Surfaces & BG (Light Theme) --- */
    --color-bg: #FFFFFF;           /* Blanco puro */
    --color-surface: #F9FAFB;      /* Gris ultra suave */
    --color-border: rgba(0, 0, 0, 0.05);
    
    /* --- Typography --- */
    --color-text-primary: #111827;  /* Gris muy oscuro */
    --color-text-muted: #6B7280;    /* Gris medio */
    --color-text-dark: #000000;
    
    /* --- Layout Metrics (3 Breakpoints Escalables) --- */
    --sidebar-desktop: 20%;        /* ~280px+ */
    --sidebar-tablet: 22%;         /* ~170px (En 768px resolución base) */
    --sidebar-mobile: 35%;         /* ~130px (En 375px resolución base) */
    
    --item-desktop: 250px;
    --item-tablet: 110px;
    --item-mobile: 110px;           /* Aumentado a 110px según solicitud exacta */
    
    /* --- Effects --- */
    --shadow-premium: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --transition-standard: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Custom Scroll */
#main-sidebar::-webkit-scrollbar {
    width: 4px;
}

#main-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#main-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-surface);
    border-radius: 10px;
}

#main-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* --- Utilities --- */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Custom Scrollbar for Search Results */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

.cursor-zoom-in {
    cursor: zoom-in;
}

.cursor-zoom-out {
    cursor: zoom-out;
}

/* --- Botones CTA --- */
.btn-cta {
    background-color: var(--color-cta);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition-standard);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px 0 rgba(255, 107, 0, 0.39);
}

.btn-cta:hover {
    background-color: var(--color-cta-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.23);
}

.btn-cta-outline {
    background-color: transparent;
    color: var(--color-cta);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    border: 2px solid var(--color-cta);
    transition: var(--transition-standard);
    cursor: pointer;
}

.btn-cta-outline:hover {
    background-color: var(--color-cta);
    color: white;
}

.z-1000 { z-index: 1000 !important; }

/* Animaciones para el Menú Móvil */
#mobile-menu:not(.hidden) {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
#main-container {
    flex-grow: 1;
    min-height: 0;
    display: flex;
}
/* --- BREAKPOINTS: Desktop (lg) --- */
@media (min-width: 1025px) {
    #main-sidebar {
        width: var(--sidebar-desktop);
    }
    .sidebar-item {
        width: var(--item-desktop);
        height: var(--item-desktop);
    }
}

/* --- BREAKPOINTS: Tablet (md) --- */
@media (min-width: 768px) and (max-width: 1024px) {
    #main-sidebar {
        width: var(--sidebar-tablet);
    }
    .sidebar-item {
        width: var(--item-tablet);
        height: var(--item-tablet);
    }
    /* Reducir gap en tablet para ahorrar espacio */
    #main-sidebar {
        gap: 1rem !important;
    }
}

/* --- BREAKPOINTS: Mobile (sm/xs) --- */
@media (max-width: 767px) {
    #main-sidebar {
        width: var(--sidebar-mobile);
    }
    .sidebar-item {
        width: var(--item-mobile);
        height: var(--item-mobile);
    }
    /* El header en mobile es más pequeño */
    header nav {
        padding: 0.75rem 1rem;
    }
    .logo {
        font-size: 1rem;
    }
}

/* --- Componentes --- */
.sidebar-item {
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-premium);
    background: var(--color-surface);
    transition: var(--transition-standard);
    cursor: pointer;
    border: 1px solid var(--color-border);
    text-decoration: none;
}

.sidebar-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--color-accent);
}

.sidebar-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Para mostrar el producto completo sin recortes */
    padding: 1rem;      /* Margen interno para que el producto no toque los bordes */
    opacity: 0.75;
    transition: transform 0.8s ease;
}

.sidebar-item:hover img {
    transform: scale(1.1);
    opacity: 1;
}

.sidebar-item-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    background: transparent;
    padding: 0.6rem 1.2rem;
    border-top-left-radius: 1.25rem;
    transition: var(--transition-standard);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.sidebar-item-overlay span {
    color: var(--color-text-primary); /* Mejor contraste en modo oscuro */
    transition: color 0.3s ease;
}

.sidebar-item:hover .sidebar-item-overlay {
    background: rgba(var(--color-accent-rgb), 0.9);
}

.sidebar-item:hover .sidebar-item-overlay span {
    color: var(--color-text-primary);
}

.sidebar-item:active {
    transform: scale(0.95);
    background: #f0f0f0;
    transition: transform 0.1s ease;
}

/* Optimización para Touch */
@media (hover: none) {
    .sidebar-item:hover {
        transform: none;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    }
}

/* Antigravity Floating Elements Styling */
.floater {
    position: absolute;
    background: rgba(var(--color-accent-rgb), 0.05); /* Ultra leve, casi invisible para que no distraiga */
    border: 1px solid rgba(var(--color-accent-rgb), 0.1);
    backdrop-filter: blur(1.5px);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
}

.floater-mobile {
    opacity: 1 !important; /* Restauramos para evitar la doble multiplicación */
    background: rgba(var(--color-accent-rgb), 0.1) !important; /* Un poco más visibles que en desktop */
    border: 1px solid rgba(var(--color-accent-rgb), 0.2) !important;
    backdrop-filter: blur(1px) !important;
}

/* Smooth Body Transitions */
body * {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* --- SUB-GALERÍA TÉCNICA (NIVEL 2) --- */
#sub-gallery {
    width: 0;
    opacity: 0;
    visibility: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#sub-gallery.active {
    width: 384px; /* Aumentado un 20% desde 320px */
    opacity: 1;
    visibility: visible;
}

#sub-gallery-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrarlas horizontalmente */
    gap: 2rem;
}

/* Clase para resaltar el ítem activo en el sidebar */
.active-item-ring {
    outline: 2px solid rgba(74, 144, 226, 0.5);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.2);
}

.tech-item {
    width: 100%;
    max-width: 300px; /* Tamaño aumentado un 20% respecto a los ~250px originales */
    margin-bottom: 0.5rem;
}

.tech-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tech-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Breakpoint: Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    #sub-gallery.active {
        width: 336px; /* Aumentado un 20% desde 280px */
    }
}

/* Breakpoint: Mobile (< 768px) */
@media (max-width: 767px) {
    #sub-gallery {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
        transform: translateX(100%);
        background: white;
        opacity: 1; /* Forzar opacidad en mobile */
    }
    
    #sub-gallery.active {
        width: 100%;
        transform: translateX(0);
        visibility: visible;
    }

    /* Reducir padding en móviles según solicitud */
    #sub-gallery-content {
        padding: 1rem 0.5rem;
        gap: 1rem;
    }

    /* Asignar 170x170 exactos sólo al nivel 2 en móviles */
    .tech-item {
        width: 170px !important;
        height: 170px !important;
        max-width: 170px;
        margin-bottom: 0;
    }

    .gallery-close-mobile {
        position: sticky;
        top: 0;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(5px);
        padding: 1.5rem 1rem 1rem 1rem; /* Ligeramente reducido el padding top */
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: flex-end;
        z-index: 20;
    }

    .close-btn {
        background: #f5f5f7;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.8rem;
        font-weight: 600;
        color: #333;
    }
}

#antigravity-container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    height: 100%;
}

/* Scroll Desbloqueable */
#antigravity-container.allow-scroll {
    overflow-y: auto !important;
}

/* --- CONTENIDO EXTENDIDO (NIVEL 3) --- */
#extended-content {
    background: #ffffff;
    padding: 10vh 0;
    position: relative;
    z-index: 10;
}

#extended-content h2 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 200;
    letter-spacing: -0.05em;
    color: #111;
    margin-bottom: 2rem;
    line-height: 1.1;
}

#extended-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-top: 5rem;
    margin-bottom: 1rem;
    display: block;
}

#extended-content p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #444;
    max-width: 850px;
    font-weight: 300;
}

.fade-in-section {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.allow-scroll .fade-in-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* Botón de cierre integrado */
.close-info-btn {
    position: sticky;
    top: 2rem;
    float: right;
    margin-right: 2rem;
    width: 44px;
    height: 44px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 50;
    margin-bottom: -44px;
}

/* Ajustes Footer Responsive */
@media (max-width: 640px) {
    .footer-responsive {
        justify-content: flex-end !important;
    }
    .copyright-text {
        display: none !important;
    }
    .mobile-right-link {
        font-size: 11px;
    }
}

#gallery-overlay.active {
    display: block;
}

/* Ocultar sidebar en móvil para Nivel 3 */
@media (max-width: 640px) {
    body.level-3-active #main-sidebar {
        display: none !important;
    }
    
    /* Asegurar que el contenido extendido tome todo el ancho */
    body.level-3-active #antigravity-container {
        width: 100% !important;
        flex: 1 0 100% !important;
    }
}
/* --- TOOLTIP DE PRECIOS PÚBLICOS --- */
.price-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 400px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
    text-align: left;
}

.medida-card:hover .price-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.price-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.98) transparent transparent transparent;
}

.price-tooltip-title {
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    margin-bottom: 12px;
    display: block;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.price-tooltip-section {
    margin-bottom: 12px;
}

.price-tooltip-section:last-child {
    margin-bottom: 0;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

.price-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.price-tooltip-label {
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.price-tooltip-value {
    font-size: 16px;
    color: var(--color-text-primary);
    font-weight: 700;
}

.price-tooltip-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.price-tooltip-total-label {
    font-size: 13px;
    color: var(--color-text-primary);
    font-weight: bold;
    text-transform: uppercase;
}

.price-tooltip-total-value {
    font-size: 24px;
    color: var(--color-text-primary);
    font-weight: 900;
}

.medida-card {
    position: relative;
    cursor: help;
}

/* --- Ajuste Mobile: Tooltip como Modal Centrado --- */
@media (max-width: 639px) {
    .price-tooltip {
        position: fixed;
        top: 50%;
        left: 50%;
        bottom: auto;
        transform: translate(-50%, -40%) scale(0.95);
        width: 90vw;
        max-width: 360px;
        z-index: 9999;
        pointer-events: none; /* Se activa por el hover de la card, pero evitamos que bloquee clics accidentales */
    }

    .medida-card.active .price-tooltip {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Ocultar la flecha en mobile */
    .price-tooltip::after {
        display: none;
    }

    /* Overlay oscuro al estar activo en mobile */
    .medida-card.active::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        z-index: 9998;
        pointer-events: none;
        animation: fadeIn 0.3s ease;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* --- SECCIÓN CATÁLOGO (MOSAICO 2026) --- */
.catalogo-grid {
    display: grid;
    /* Grid de columnas dinámicas con mínimo 200px */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* 'dense' rellena los huecos automáticamente */
    grid-auto-flow: dense;
    grid-auto-rows: 200px; /* Altura base ideal */
    gap: 10px; /* Gap estandarizado */
    width: 100%;
}

@media (max-width: 600px) {
    .catalogo-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
        gap: 8px;
    }
}

.catalogo-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: var(--color-surface);
    transition: transform 0.3s ease, box-shadow 0.6s ease;
    border: 1px solid var(--color-border);
}

.catalogo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    z-index: 2;
}

/* --- Proporciones Ideales del Mosaico --- */

/* 1:1 - Cuadrada */
.ratio-1-1 {
    grid-column: span 1;
    grid-row: span 1;
}

/* 16:9 - Horizontal */
.ratio-16-9 {
    grid-column: span 2;
    grid-row: span 1;
}

/* 9:16 - Vertical */
.ratio-9-16 {
    grid-column: span 1;
    grid-row: span 2;
}

/* 3:4 - Retrato */
.ratio-3-4 {
    grid-column: span 1;
    grid-row: span 2;
}

/* Extra: Destacada (Grande) - Equivalente a span-2-2 */
.ratio-big {
    grid-column: span 2;
    grid-row: span 2;
}

@media (max-width: 600px) {
    /* Forzamos que los elementos anchos ocupen todo el ancho en móvil */
    .ratio-16-9, .ratio-big {
        grid-column: span 2;
    }
}

.catalogo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.catalogo-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.08);
}

/* Overlay sutil */
.catalogo-overlay {
    position: absolute;
    inset: 0;
    /* Degradado más oscuro en la base para legibilidad */
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 40%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
}

/* En dispositivos táctiles (Touch), mostramos el texto con una opacidad base o lo hacemos siempre visible */
@media (hover: none) {
    .catalogo-overlay {
        opacity: 1; /* Sólido en dispositivos táctiles */
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .catalogo-overlay {
        padding: 0.75rem;
    }
}

.catalogo-item:hover .catalogo-overlay {
    opacity: 1;
    transform: translateY(0);
}

.catalogo-overlay h4 {
    color: #fff !important;
    font-size: clamp(0.95rem, 1.6vw, 1.25rem);
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8); /* Sombra reforzada */
    position: relative;
    z-index: 5;
}

.catalogo-overlay p {
    color: #fff !important; /* Forzado total a blanco puro */
    font-size: clamp(0.75rem, 1.1vw, 0.9rem);
    margin: 0.35rem 0 0 0 !important;
    line-height: 1.3;
    max-width: 100% !important;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8); /* Ayuda a que resalte sobre la imagen */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 5;
}

@media (max-width: 640px) {
    .catalogo-overlay p {
        display: none; /* Ocultamos descripción en móviles muy pequeños para dar prioridad al título */
    }
}

/* --- LIGHTBOX (MODAL FULLSCREEN) --- */
.catalogo-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.catalogo-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: zoomIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-img {
    max-width: 95%;
    max-height: 60vh;
    border-radius: 1.5rem;
    box-shadow: 0 40px 80px rgba(0,0,0,0.1);
    object-fit: contain;
}

.lightbox-info {
    margin-top: 1.5rem;
    text-align: center;
    max-width: 700px;
    padding: 0 1rem;
}

.lightbox-info h4 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.lightbox-info p {
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.lightbox-btn {
    margin-top: 1.5rem;
    display: inline-block;
    padding: 1rem 2rem;
}

.lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px; /* Tamaño optimizado para touch */
    height: 44px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 1000; /* Aseguramos que siempre esté arriba */
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), background 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@media (max-width: 640px) {
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.8); /* Algo de transparencia en móvil */
    }
}

/* --- NAVEGACIÓN CAPTALÍTICA (FLECHAS) --- */
.catalogo-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 1010;
    backdrop-filter: blur(5px);
}

.catalogo-nav:hover {
    background: #000;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.catalogo-prev { left: 2rem; }
.catalogo-next { right: 2rem; }

/* Ajustes para móviles */
@media (max-width: 768px) {
    .catalogo-nav {
        width: 45px;
        height: 45px;
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
    }
    
    .catalogo-prev { left: 1rem; }
    .catalogo-next { right: 1rem; }
}

/* --- SUB-GALLERY (NIVEL 2) --- */
.sub-gallery-cat-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-text-primary);
    padding-bottom: 4px;
    margin-bottom: 8px; /* Margen mínimo */
    border-bottom: 3px solid var(--color-accent);
    display: inline-block;
    letter-spacing: -0.02em;
}

.tech-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tech-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--color-accent);
}

.tech-image {
    transition: transform 0.5s ease;
}

.tech-item:hover .tech-image {
    transform: scale(1.05);
}

.close-btn {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.close-btn:hover {
    opacity: 1;
}

.lightbox-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--color-accent);
}

/* --- ERROR PAGES (404, 500, etc.) --- */
.error-page-container {
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    z-index: 10;
}

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
