/* ============================================================
   GEOMITAG — Scroll Inmersivo Full-Width
   scroll-portfolio.css
   Pura HTML5 + CSS3 · Sin frameworks
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold:       #d4af37;
    --gold-dim:   rgba(212, 175, 55, 0.35);
    --glass-bg:   rgba(10, 14, 20, 0.58);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-blur: 14px;
    --text-primary:   #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted:     #94a3b8;
    /* Altura total del header corporativo: barra azul (~36px) + barra blanca (~70px) */
    --header-height: 106px;
    --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: #050708;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;     /* Forzar que el body no haga scroll, solo el contenedor inmersivo */
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   HEADER CORPORATIVO FIJO
   ============================================================ */
.em40_header_area_main {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
}
.header-proyectos {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.15); /* Fondo casi transparente */
    backdrop-filter: blur(12px); /* Efecto cristal */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-family: Epilogue, sans-serif;
    transition: all 0.4s ease-in-out;
}

/* Estado scrolled del header */
.header-proyectos.scrolled {
    background: rgba(10, 14, 20, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* Modificadores para el header transparente */
.header-proyectos .builet-header-top,
.header-proyectos .builet_nav_area {
    background: transparent !important;
    border: none !important;
}

/* Forzar color blanco para iconos y textos */
.header-proyectos .top-address p, 
.header-proyectos .top-address p span, 
.header-proyectos .top-address p a,
.header-proyectos .social-icons li a i,
.header-proyectos .builet_menu > ul > li > a {
    color: #ffffff !important;
}

/* Forzar que el logo se vea bien en fondo oscuro (invertirlo a blanco si es necesario) */
.header-proyectos .theme_cr_logo img {
    filter: brightness(0) invert(1);
}


/* Contador de slide en esquina derecha del header */
#sp-slide-counter {
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    z-index: 10000;
    pointer-events: none;
}

#sp-nav-counter {
    font-size: 13px;
    font-weight: 700;
    font-family: 'Inter', monospace;
    font-variant-numeric: tabular-nums;
    color: var(--gold);
    background: rgba(10, 14, 20, 0.75);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 3px 10px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ============================================================
   DOTS DE NAVEGACIÓN LATERAL
   ============================================================ */
#sp-dots {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    padding: 0;
    position: relative;
}

.sp-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: border-color 0.3s;
}

.sp-dot.active {
    background: var(--gold);
    transform: scale(1.3);
}

.sp-dot.active::before { border-color: var(--gold-dim); }
.sp-dot:hover { background: rgba(255, 255, 255, 0.6); }

/* ============================================================
   CONTENEDOR PRINCIPAL — Scroll Snap
   ============================================================ */
#scroll-inmersivo {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Ocultar scrollbar nativa */
#scroll-inmersivo::-webkit-scrollbar { display: none; }

/* ============================================================
   CADA SECCIÓN / SLIDE
   ============================================================ */
.project-slide {
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}


/* ---- VIDEO DE FONDO ---- */
.slide-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    /* Forzar aceleración por hardware para mejorar nitidez */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Ligero escalado + translateZ para hardware acceleration */
    transform: translateZ(0) scale(1.02);
    transition: transform 1.2s var(--ease-out);
}

.project-slide.is-active .slide-bg-video {
    transform: translateZ(0) scale(1.0);
}

/* ---- OVERLAY OSCURO ---- */
.slide-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* Gradiente desde la izquierda: oscuro en el panel, transparente a la derecha */
    background: linear-gradient(
        100deg,
        rgba(3, 5, 8, 0.82) 0%,
        rgba(3, 5, 8, 0.50) 40%,
        rgba(3, 5, 8, 0.10) 70%,
        rgba(3, 5, 8, 0.00) 100%
    );
}

/* Variante: panel a la derecha */
.slide-overlay--right {
    background: linear-gradient(
        -100deg,
        rgba(3, 5, 8, 0.82) 0%,
        rgba(3, 5, 8, 0.50) 40%,
        rgba(3, 5, 8, 0.10) 70%,
        rgba(3, 5, 8, 0.00) 100%
    );
}

/* Ocultar la barra superior (top-bar) al hacer scroll en proyectos */
.em40_header_area_main.scrolled .builet-header-top {
    display: none !important;
}

/* ============================================================
   PANEL FLOTANTE — GLASSMORPHISM
   ============================================================ */
.glass-panel {
    position: absolute !important;
    bottom: 5% !important; /* Lo ancla a la parte inferior, lejos del header */
    left: 5% !important;
    max-height: 65vh !important; /* Limita su altura para que no choque arriba */
    overflow-y: auto !important; /* Habilita scroll interno si el texto es muy largo */
    z-index: 10;
    max-width: 480px;
    width: 90%;
    padding: 32px 36px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    /* Animación de entrada */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

/* Panel a la derecha */
.glass-panel--right {
    left: auto;
    right: 5vw;
}

/* Panel visible cuando el slide está activo */
.project-slide.is-active .glass-panel {
    opacity: 1;
    transform: translateY(0);
}

/* Meta row: badge + ID */
.glass-panel-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.meta-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.4);
}

/* .meta-badge--amber se omite ya que hereda los estilos de .meta-badge */

.meta-badge--steel {
    background: rgba(100, 116, 139, 0.25);
    color: #94a3b8;
    border-color: rgba(100, 116, 139, 0.3);
}

.meta-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

/* Título principal */
.glass-panel-title {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.25;
    color: #FFFFFF !important;
    margin-bottom: 12px;
    /* Acento dorado izquierdo */
    padding-left: 14px;
    border-left: 3px solid var(--gold);
}

/* Descripción */
.glass-panel-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 20px;
}

/* ---- FICHA TÉCNICA ---- */
.glass-panel-specs {
    list-style: none;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding-top: 16px;
}

.glass-panel-specs li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 12px;
}

.spec-label {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 155px;
}

.spec-value {
    color: var(--text-secondary);
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

/* ---- BOTONES ---- */
.glass-panel-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-gallery {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--gold);
    background: transparent;
    color: var(--gold);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    letter-spacing: 0.02em;
}

.btn-gallery:hover {
    background: var(--gold);
    color: #050708;
}

.btn-gallery i { font-size: 14px; }

.btn-service {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    letter-spacing: 0.04em;
}

.btn-service:hover { color: var(--text-primary); }

/* ============================================================
   INDICADOR DE SCROLL INICIAL
   ============================================================ */
#sp-scroll-hint {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#sp-scroll-hint i {
    font-size: 18px;
    animation: sp-bounce 1.6s ease-in-out infinite;
}

#sp-scroll-hint.hidden { opacity: 0; }

@keyframes sp-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(7px); }
}

/* ============================================================
   LIGHTBOX / GALERÍA COMPLETA (modal simple)
   ============================================================ */
#sp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(3, 5, 8, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s var(--ease-out);
}

#sp-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.sp-lb-inner {
    width: 92vw;
    max-width: 1100px;
    aspect-ratio: 16 / 9;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.sp-lb-inner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sp-lb-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
    z-index: 10;
}

.sp-lb-close:hover { background: rgba(255,255,255,0.2); }

.sp-lb-prev, .sp-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(3, 5, 8, 0.5);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: none; /* Controlled by JS */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
    z-index: 10;
}

.sp-lb-prev:hover, .sp-lb-next:hover {
    background: var(--gold);
    color: #050708;
    border-color: var(--gold);
}

.sp-lb-prev { left: 16px; }
.sp-lb-next { right: 16px; }

.sp-lb-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(3, 5, 8, 0.7);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-family: 'Inter', monospace;
    font-variant-numeric: tabular-nums;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 10;
    display: none; /* Controlled by JS */
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .glass-panel {
        bottom: 4vh;
        left: 4vw;
        right: 4vw;
        max-width: 100%;
        padding: 22px 20px;
        width: auto;
    }

    .glass-panel--right {
        left: 4vw;
        right: 4vw;
    }

    .slide-overlay,
    .slide-overlay--right {
        background: linear-gradient(
            to top,
            rgba(3, 5, 8, 0.88) 0%,
            rgba(3, 5, 8, 0.40) 60%,
            rgba(3, 5, 8, 0.10) 100%
        );
    }

    .glass-panel-title { font-size: 1.15rem; }
    .glass-panel-specs { display: none; }
    .sp-nav-center { display: none; }
    #sp-dots { right: 10px; }
}

@media (max-width: 480px) {
    #sp-nav { padding: 0 16px; }
    .glass-panel { padding: 18px 16px; }
}
