/* =====================================================================
   ESTILOS ACTUALES (los que estaban dentro de panel_principal.html)
   ===================================================================== */

/* --- VARIABLES DE COLOR --- */
:root {
    --color-principal: #0cbab6;
    --color-bg-botones: #ffffff;
    --color-texto-botones: #666666;
    --color-borde: #e0e0e0;
}

/* --- ESTILOS BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    overflow: hidden;
    background-color: #eee;
}

/* --- OVERLAY DIFUMINADO PARA BARRA LATERAL --- */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 990;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}
#sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* --- BARRA LATERAL (SIDEBAR) TIPO TARJETA --- */
.sidebar {
    position: absolute;
    top: 50%;
    left: -350px;
    transform: translateY(-50%);
    max-height: 95vh;
    width: 290px;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 12px;
    transition: all 0.4s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    left: 20px;
}

.sidebar .top {
    position: relative;
    padding: 35px 20px 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.sidebar .top .logo img {
    max-width: 140px;
    height: auto;
    display: block;
}

.sidebar-ubicacion {
    display: flex;
    align-items: center;
    text-align: center;
    color: #777;
    font-size: 11px;
    margin-top: 15px;
    line-height: 1.4;
}

.sidebar-ubicacion i {
    font-size: 16px;
    margin-right: 5px;
}

#btn-cerrar-sidebar {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
}

#btn-cerrar-sidebar:hover {
    color: var(--color-principal);
}

.sidebar ul {
    padding: 10px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar ul::-webkit-scrollbar {
    display: none;
}

.sidebar ul li {
    list-style-type: none;
    margin: 0.2rem 0;
}

.sidebar ul li a {
    color: var(--color-texto-botones);
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 180ms ease, color 180ms ease;
    padding: 12px 15px;
    font-size: 14px;
}

/* El enlace completo recibe el puntero; icono/texto no crean zonas separadas. */
.sidebar ul li a > i, .sidebar ul li a > span {
    pointer-events: none;
    color: inherit;
}

@media (hover: hover) and (pointer: fine) {
    .sidebar ul li a:hover {
        background-color: var(--color-principal);
        color: #fff;
    }
}

/* Feedback de presión touch sin dejar un hover persistente después del tap. */
@media (hover: none), (pointer: coarse) {
    .sidebar ul li a:active {
        background-color: var(--color-principal);
        color: #fff;
    }
}

.sidebar ul li a i {
    font-size: 20px;
    margin-right: 15px;
}

.sidebar-social {
    display: flex;
    justify-content: space-evenly;
    padding: 15px 20px;
    border-top: none; /* CORREGIDO: se quitó la línea divisoria de arriba */
}

.sidebar-social a {
    color: var(--color-texto-botones);
    font-size: 22px;
    text-decoration: none;
    transition: 0.3s;
}

.sidebar-social a:hover {
    color: var(--color-principal);
}

.sidebar-footer {
    text-align: center;
    font-size: 11px;
    color: #999;
    padding-bottom: 20px;
}

/* --- SELECTOR DE IDIOMA (TRADUCTOR) --- */
.lang-switcher-wrap {
    position: relative;
    padding: 15px 20px 15px 20px;
    border-top: none; /* CORREGIDO: se quitó la línea divisoria de arriba */
}

.lang-switcher {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: var(--color-texto-botones);
    border: 1px solid var(--color-borde);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
}

.lang-switcher:hover {
    border-color: var(--color-principal);
    color: var(--color-principal);
}

.lang-switcher i:first-child {
    font-size: 16px;
}

.lang-switcher span {
    flex-grow: 1;
    text-align: left;
}

.lang-chevron {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.lang-switcher-wrap.active .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: calc(100% - 5px);
    background: #fff;
    border: 1px solid var(--color-borde);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 10;
}

.lang-switcher-wrap.active .lang-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.lang-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--color-texto-botones);
    cursor: pointer;
    transition: 0.2s;
    text-align: left;
}

.lang-option:hover {
    background: #f4f4f4;
}

.lang-option span:nth-child(2) {
    flex-grow: 1;
}

.lang-flag {
    font-size: 16px;
    line-height: 1;
}

.lang-check {
    font-size: 12px;
    color: var(--color-principal);
    opacity: 0;
}

.lang-option.active {
    background: #f4f4f4;
    font-weight: 600;
    color: #333;
}

.lang-option.active .lang-check {
    opacity: 1;
}

/* --- CONTENIDO PRINCIPAL --- */
.main-content {
    position: relative;
    background-color: #eee;
    height: 100vh;
}

#viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    overflow: hidden;
}

#contenido-edificio {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: block;
}

#zoom-wrapper {
    width: 100%; height: 100%; transition: transform 0.3s ease;
    transform-origin: center center; display: flex;
    align-items: center; justify-content: center; position: relative;
}

.media-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover !important; transition: opacity 0.5s ease;
    opacity: 0; pointer-events: none;
}
.media-layer.active { opacity: 1; pointer-events: auto; }
#img-aislada { background-color: #ffffff; object-fit: contain !important; }

/* --- ETIQUETAS FLOTANTES UNIDADES --- */
.unit-tag {
    position: absolute;
    background: white;
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
}

.unit-tag.active {
    opacity: 1;
    pointer-events: auto;
}

.unit-tag:hover {
    transform: translate(-50%, -55%);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    color: var(--color-principal);
}

.unit-tag .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 5px #2ecc71;
}

#btn-punto {
    position: absolute; top: 45%; left: 45%; width: 30px; height: 30px;
    background-color: var(--color-principal); border: 4px solid white;
    border-radius: 50%; cursor: pointer; z-index: 60; display: none; /* JS lo muestra con display:flex */
    align-items: center; justify-content: center;
    box-shadow: 0 0 0 5px rgba(12, 186, 182, 0.4), 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
#btn-punto:hover { transform: scale(1.15); }

/* --- BOTONES DE INTERFAZ --- */
.btn-visor {
    background: var(--color-bg-botones); color: var(--color-texto-botones);
    border: 1px solid var(--color-borde); padding: 10px 16px;
    font-size: 14px; font-weight: 500; border-radius: 10px;
    cursor: pointer; transition: all 0.3s ease; display: flex;
    align-items: center; gap: 8px; pointer-events: auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.btn-visor:hover { background: #f8f8f8; }
.btn-visor i { font-size: 16px; }
.btn-visor.primary { background: var(--color-principal); color: #fff; border: none; }
.btn-visor.primary:hover { background: #0aa5a2; }
.btn-visor.icon-only { padding: 0; width: 42px; height: 42px; justify-content: center; }

/* Ocultos al inicio (el JS los muestra con style.display) */
#uni-btn-atras, #ui-btn-verpisos, #uni-paso-deptos { display: none; }

#ui-interface {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 50; display: none;
}

.top-left-controls, .top-center-controls, .top-right-controls, .bottom-left-controls, .bottom-right-controls {
    position: absolute;
    z-index: 1002;
    pointer-events: auto;
}

.top-left-controls { top: 20px; left: 20px; display: flex; gap: 10px; }
/* Una sola barra visible, con los mismos botones y posición de la copia original. */
#controles-persistentes { z-index: 900; }
#controles-persistentes[hidden], #btn-ficha-tecnica[hidden] { display: none; }
#panel-inicio > .top-left-controls,
#uni-btn-menu, #uni-btn-atras,
#btn-cerrar-mapa, #btn-cerrar-tour { visibility: hidden; pointer-events: none; }
#btn-ficha-tecnica { position: absolute; top: 75px; left: 20px; z-index: 1002; }
.top-center-controls { top: 20px; left: 50%; transform: translateX(-50%); }
.top-right-controls { top: 20px; right: 20px; display: flex; gap: 10px; }
.bottom-right-controls { bottom: 20px; right: 20px; }

.search-bar {
    display: flex; align-items: center; background: white;
    border: 1px solid var(--color-borde); border-radius: 25px;
    padding: 10px 20px; width: 320px; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.search-bar i { color: #999; margin-right: 10px; }
.search-bar input { border: none; outline: none; width: 100%; font-size: 14px; color: #333; }

.day-night-switch {
    display: flex; background: white; border: 1px solid var(--color-borde);
    border-radius: 10px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.day-night-switch button {
    border: none; padding: 8px 15px; background: transparent;
    color: var(--color-texto-botones); font-size: 13px; cursor: pointer;
    display: flex; align-items: center; gap: 6px; transition: 0.3s;
}
.day-night-switch button.active {
    color: var(--color-principal); font-weight: 600; background: #f4f4f4;
}

.mid-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1002; pointer-events: auto; }
.mid-arrow.left { left: 20px; }
.mid-arrow.right { right: 20px; }

.bottom-left-controls { 
    bottom: 20px; left: 20px; 
    display: flex; flex-direction: column; 
    background: white; border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden; border: 1px solid var(--color-borde);
}
.bottom-left-controls .btn-visor {
    border: none; border-radius: 0; box-shadow: none; width: 42px; height: 42px;
}
.bottom-left-controls .btn-visor:first-child {
    border-bottom: 1px solid var(--color-borde);
}

.btn-whatsapp {
    background: var(--color-principal); 
    color: #ffffff; 
    border-radius: 50%;
    width: 50px !important;
    height: 50px !important;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-whatsapp:hover {
    transform: scale(1.1);
    background: #0aa5a2;
}

#panel-inicio { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 100; }
#panel-inicio video { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 0; }
#panel-inicio .content { position: relative; z-index: 1; text-align: center; color: white; display: flex; flex-direction: column; align-items: center; }
#img-LOGO { max-width: 300px; margin-bottom: 30px; position: relative; pointer-events: none; }
.botones-inicio button { background: var(--color-principal); color: white; border: none; padding: 15px 40px; font-size: 1.1rem; border-radius: 8px; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 15px; text-transform: uppercase; letter-spacing: 1px; font-weight: 500; }
.botones-inicio button:hover { background: #0aa5a2; transform: translateY(-2px); }

/* --- PANEL DE PISOS DERECHO --- */
.right-floor-panel { 
    position: absolute; 
    top: 50%; 
    right: 20px; 
    transform: translateY(-50%); 
    display: none; 
    flex-direction: column; 
    background: rgba(255, 255, 255, 0.95); 
    padding: 8px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); 
    pointer-events: auto; 
    z-index: 1002;
}

#panel-pisos { width: 70px; }
#panel-unidad-opciones { width: 150px; }

.right-floor-panel.active { display: flex; }

.floor-list { 
    display: flex; 
    flex-direction: column; 
    width: 100%;
    max-height: 400px; 
    overflow-y: auto; 
}
.floor-list::-webkit-scrollbar { display: none; }

.btn-floor { 
    background: transparent; 
    color: var(--color-texto-botones); 
    border: none; 
    padding: 8px 6px; 
    font-size: 12px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s; 
    border-radius: 6px; 
    width: 100%; 
    margin: 2px 0;
    display: flex; 
    align-items: center; 
    justify-content: center;
}

#btn-volver-aislado { margin-bottom: 8px; }

#panel-unidad-opciones .btn-floor {
    justify-content: flex-start;
    padding: 10px;
}

#panel-pisos .btn-floor i {
    margin: 0;
    margin-right: 4px;
    font-size: 14px;
}

#panel-unidad-opciones .btn-floor i {
    margin-right: 10px;
    font-size: 16px;
}

.btn-floor:hover, .btn-floor.active { color: #fff; background: var(--color-principal); }
.divider { width: 100%; height: 1px; background: var(--color-borde); margin: 6px 0; }

.floor-list-niveles { display: contents; }
.floor-list-niveles.oculto { display: none; }
#btn-volver-pisos.niveles-ocultos i { transform: rotate(180deg); }
#btn-volver-pisos i { transition: transform 0.3s ease; }

#panel-mapa, #panel-tour { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 500; display: none; background-color: #eee; }
#panel-mapa iframe, #panel-tour iframe { width: 100%; height: 100%; border: none; }
.btn-cerrar-mapa, .btn-cerrar-tour { position: absolute; top: 20px; left: 20px; z-index: 501; }

/* --- PANEL UNIDADES --- */
#panel-unidades {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 600; display: none; background-color: #f3fbfb; overflow: hidden;
}
#panel-unidades::before {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: url("FACHADA DIA.png") center / cover no-repeat;
    filter: blur(16px); transform: scale(1.06); opacity: 0.35; z-index: 0;
}
#panel-unidades::after {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(243,251,251,0.55) 0%, rgba(255,255,255,0.9) 100%); z-index: 0;
}
.uni-topbar {
    position: absolute; top: 20px; left: 20px; right: 20px; z-index: 2;
    display: flex; align-items: center; gap: 10px;
}
.uni-logo { position: absolute; left: 50%; transform: translateX(-50%); height: 44px; object-fit: contain; }
.uni-scroll {
    position: relative; z-index: 1; height: 100%; overflow-y: auto;
    padding: 100px 40px 50px 40px;
}
.uni-contenido { max-width: 1100px; margin: 0 auto; }
.uni-titulo { font-size: 26px; font-weight: 600; color: #22303a; }
.uni-subtitulo { font-size: 15px; color: #6b7780; margin-top: 4px; margin-bottom: 26px; }
.uni-chip {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
    background: #fff; border: 1px solid var(--color-borde); border-radius: 999px;
    padding: 8px 16px; font-size: 14px; color: #333; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.uni-chip:hover { color: var(--color-principal); }
.uni-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.uni-card {
    background: #fff; border-radius: 16px; overflow: hidden; cursor: pointer;
    box-shadow: 0 6px 22px rgba(0,0,0,0.10); transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex; flex-direction: column;
}
.uni-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.16); }
.uni-card-img { position: relative; height: 210px; background: #fff; }
.uni-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uni-card-img.contain img { object-fit: contain; padding: 10px; }
.uni-badge {
    position: absolute; top: 12px; left: 12px; background: #16a34a; color: #fff;
    font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
}
.uni-card-body { padding: 18px 20px 20px 20px; display: flex; flex-direction: column; gap: 6px; }
.uni-card-body h3 { font-size: 22px; font-weight: 600; color: #22303a; display: flex; justify-content: space-between; align-items: center; }
.uni-card-body h3 i { color: var(--color-principal); font-size: 16px; }
.uni-meta { font-size: 14px; color: #6b7780; }
.uni-precio { font-size: 16px; font-weight: 600; color: var(--color-principal); margin-top: 2px; }
.uni-btn-ingresar {
    margin-top: 10px; width: 100%; padding: 14px; border: none; border-radius: 999px; cursor: pointer;
    background: var(--color-principal); color: #fff; font-size: 16px; font-weight: 600;
    display: flex; justify-content: center; align-items: center; gap: 10px; transition: background 0.2s;
}
.uni-btn-ingresar:hover { background: #0aa5a2; }

/* --- GALERÍA TIPO VISOR --- */
#panel-galeria {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1010; display: none; background-color: #292929; overflow: hidden;
}
.btn-cerrar-galeria { position: absolute; top: 20px; left: 20px; z-index: 1011; }
#panel-galeria .galeria-grid { display: none; }

.gv-foto { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 0; background-color: #292929; }
.gv-foto img {
    width: 100%; height: 100%; object-fit: contain; object-position: center; display: block;
    transition: opacity 0.25s ease, transform 0.3s ease; transform-origin: center center;
}
.gv-sombra-top, .gv-sombra-bottom { position: absolute; left: 0; width: 100%; pointer-events: none; z-index: 1; }
.gv-sombra-top { top: 0; height: 160px; background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0)); }
.gv-sombra-bottom { bottom: 0; height: 200px; background: linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0)); }

.gv-etiqueta {
    position: absolute; top: 78px; left: 20px; z-index: 1011;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 16px; font-weight: 600;
    padding: 6px 12px; border-radius: 4px; letter-spacing: 0.3px;
}
.gv-nombre-foto {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 1011;
    background: rgba(255,255,255,0.92); color: #22303a; font-size: 15px; font-weight: 600;
    padding: 11px 22px; border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.gv-flecha {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 1011;
    width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--color-principal); color: #fff; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35); transition: background 0.2s, transform 0.2s;
}
.gv-flecha:hover { background: #0aa5a2; transform: translateY(-50%) scale(1.08); }
#gv-prev { left: 20px; }
#gv-next { right: 20px; }

.gv-lateral {
    position: absolute; top: 76px; right: 20px; z-index: 1011;
    display: flex; flex-direction: column; gap: 10px; width: 180px;
}
.gv-lateral button {
    display: flex; align-items: center; gap: 10px; padding: 13px 18px; border: none; cursor: pointer;
    border-radius: 999px; background: rgba(255,255,255,0.95); color: #333; font-size: 15px; font-weight: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25); transition: background 0.2s, color 0.2s;
}
.gv-lateral button:hover { color: var(--color-principal); }
.gv-lateral button.active { background: var(--color-principal); color: #fff; }
.gv-lateral button i { font-size: 18px; }

.gv-zoom { position: absolute; bottom: 20px; left: 20px; z-index: 1011; display: flex; flex-direction: column; gap: 10px; }
.gv-zoom button {
    width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer; font-size: 18px;
    background: var(--color-principal); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    display: flex; align-items: center; justify-content: center;
}
.gv-zoom button.claro { background: rgba(255,255,255,0.9); color: #555; }

.gv-miniaturas {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1011;
    display: flex; gap: 10px; align-items: center; padding: 8px 12px;
    background: rgba(0,0,0,0.35); border-radius: 12px; backdrop-filter: blur(6px);
}
.gv-miniaturas img {
    width: 92px; height: 60px; object-fit: cover; border-radius: 8px; cursor: pointer;
    border: 2px solid transparent; opacity: 0.75; transition: all 0.2s;
}
.gv-miniaturas img:hover { opacity: 1; }
.gv-miniaturas img.active { border-color: var(--color-principal); opacity: 1; }
.gv-contador { color: #fff; font-size: 14px; font-weight: 600; padding: 0 6px; }

@media (max-width: 760px) {
    .gv-lateral { width: 150px; top: 76px; }
    .gv-lateral button { padding: 10px 14px; font-size: 14px; }
    .gv-miniaturas img { width: 60px; height: 42px; }
    .gv-nombre-foto { display: none; }
}

/* En pantallas bajas, conservar las acciones fuera del área de la flecha. */
@media (max-height: 520px) {
    .gv-lateral {
        max-height: calc(50% - 111px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
    }
    .gv-lateral::-webkit-scrollbar { display: none; }
    .gv-lateral button { flex-shrink: 0; }
}
/* --- FICHA UNIDAD --- */
#ficha-unidad {
    position: absolute;
    top: 75px; 
    left: 20px;
    width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 1005;
    overflow: hidden;
    pointer-events: auto;
    display: none;
    max-height: calc(100% - 95px);
    overflow-y: auto; 
    transform: translateX(calc(-100% - 40px));
    opacity: 0;
    transition: transform 320ms cubic-bezier(.45,0,.55,1),
                opacity 320ms cubic-bezier(.45,0,.55,1);
}
#ficha-unidad.ficha-visible { transform: translateX(0); opacity: 1; }
#ficha-unidad.ficha-saliendo { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
    #ficha-unidad { transition: none; }
}
#ficha-unidad::-webkit-scrollbar { width: 6px; }
#ficha-unidad::-webkit-scrollbar-thumb { background: #ccc; border-radius: 6px; }
.btn-cerrar-ficha-x {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 50%;
    width: 24px; height: 24px;
    cursor: pointer;
    z-index: 20;
    color: #555;
    display: flex; align-items: center; justify-content: center;
}
.btn-cerrar-ficha-x:hover { background: #fff; color: var(--color-principal); }

.ficha-header {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
}
.ficha-header img { width: 100%; height: 100%; object-fit: cover; }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}
.carousel-btn:hover { background: var(--color-principal); }
.carousel-btn.left { left: 10px; }
.carousel-btn.right { right: 10px; }

.ficha-body {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 8px;
}
.ficha-title { grid-column: 1 / -1; grid-row: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.ficha-title h2 { font-size: 20px; color: #222; font-weight: 600; line-height: 1.3; }
.badge-disponible { background: #2ecc71; color: white; padding: 4px 9px; border-radius: 15px; font-size: 11.5px; font-weight: 600; line-height: 1.2; }
.ficha-precio { grid-column: 1 / -1; grid-row: 2; font-size: 18px; color: #333; margin-bottom: 14px; font-weight: 600; line-height: 1.3; }

.ficha-body > .ficha-lista { grid-column: 1 / -1; grid-row: 4; margin-top: 12px; }
.ficha-lista { list-style: none; margin-bottom: 14px; }
.ficha-lista li { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 400; color: #555; margin-bottom: 0; padding: 9px 0; border-bottom: 1px solid #f0f2f2; line-height: 1.4; }
.ficha-lista li i { color: var(--color-principal); font-size: 15px; width: 20px; flex-shrink: 0; }
.ficha-lista li .right-text { font-weight: 500; color: #333; margin-left: auto; text-align: right; }

.condiciones-comerciales {
    grid-column: 1 / -1;
    grid-row: 5;
    margin-top: 4px;
    padding-top: 4px;
    border-top: none; /* CORREGIDO: se quitó la línea divisoria de arriba */
}

li.ficha-extra { display: none; }
#ficha-unidad.ficha-completa li.ficha-extra { display: flex; }
#ficha-unidad.ficha-completa .ficha-categoria { padding: 14px 0 4px; border: none; }
.ficha-categoria h4 { font-size: 13.5px; font-weight: 500; color: #777; line-height: 1.4; }

.condiciones-comerciales.ficha-extra { display: none; }
#ficha-unidad.ficha-completa .condiciones-comerciales.ficha-extra { display: block; }
.condiciones-titulo {
    font-size: 13.5px;
    color: #777;
    text-transform: none;
    margin-bottom: 4px;
    font-weight: 500;
    letter-spacing: 0;
}

.ficha-botones { display: contents; }
.ficha-botones button {
    padding: 10px; border-radius: 8px; font-size: 13px; font-weight: 600; min-width: 0;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: 0.3s;
}
.ficha-botones .btn-full { grid-column: 1 / -1; grid-row: 3; }
.ficha-botones .btn-outline { grid-row: 6; font-size: 13px; }
#btn-ver-ficha { grid-column: 1; }
#btn-ficha-tour-menu, #btn-ficha-aviso-legal { grid-column: 2; }
.ficha-botones #btn-ficha-aviso-legal { display: none; }
#ficha-unidad.ficha-completa #btn-ficha-tour-menu { display: none; }
#ficha-unidad.ficha-completa #btn-ficha-aviso-legal { display: flex; cursor: default; opacity: .65; }
.btn-full { background: var(--color-principal); color: white; border: none; }
.btn-full:hover { background: #0aa5a2; }
.btn-outline { background: white; color: var(--color-principal); border: 1px solid var(--color-principal); }
.btn-outline:hover { background: #f0fcfc; }

/* =====================================================================
   ESTILOS ANTERIORES DE style.css (conservados sin borrar nada)
   Estan dentro de @media not all { } = quedan guardados pero INACTIVOS,
   porque usan los mismos nombres (.sidebar, .btn-visor, .main-content...)
   que el diseño actual y lo descuadraban. Para reactivarlos, quita el
   'media not all' y sus llaves.
   ===================================================================== */
@media not all {
/* --- ESTILOS BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    overflow: hidden;
    background-color: #000;
}

.user-img {
    width: 50px;
    border-radius: 100%;
    border: 1px solid #eee;
}

/* --- BARRA LATERAL (SIDEBAR) --- */
.sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    width: 80px; /* Ancho cerrado */
    background-color: #12171e;
    padding: .4rem .8rem;
    transition: all 0.5s ease;
    z-index: 1000;
}

.sidebar.active {
    width: 250px; /* Ancho abierto */
}

/* Botón de Menú */
.sidebar #btn {
    position: absolute;
    color: white;
    top: .4rem;
    left: 50%;
    font-size: 1.2rem;
    line-height: 50px;
    transform: translateX(-50%);
    cursor: pointer;
}

.sidebar.active #btn {
    left: 90%;
}

/* Top / Logo */
.sidebar .top .logo {
    color: white;
    display: flex;
    height: 50px;
    width: 100%;
    align-items: center;
    pointer-events: none;
    opacity: 0; /* Oculto al estar cerrado */
}

.sidebar.active .top .logo {
    opacity: 1; /* Visible al estar abierto */
}

.sidebar .top .logo i {
    font-size: 2rem;
    margin-right: 5px;
}

/* Usuario */
.sidebar .user {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.sidebar .user p {
    color: white;
    opacity: 0;
    margin-left: 1rem;
}

.sidebar.active .user p {
    opacity: 1;
}

.bold {
    font-weight: 600;
}

/* Lista de Navegación */
.sidebar ul li {
    position: relative;
    list-style-type: none;
    height: 50px;
    width: 90%;
    margin: 0.8rem auto;
    line-height: 50px;
}

.sidebar ul li a {
    color: white;
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: 0.8rem;
    transition: 0.3s;
}

.sidebar ul li a:hover {
    background-color: #fff;
    color: #12171e;
}

.sidebar ul li a i {
    min-width: 50px;
    text-align: center;
    height: 50px;
    border-radius: 12px;
    line-height: 50px;
}

/* Nombres de los enlaces */
.sidebar .nav-item {
    opacity: 0;
}

.sidebar.active .nav-item {
    opacity: 1;
}

/* --- TOOLTIPS --- */
.sidebar ul li .tooltip {
    position: absolute;
    left: 125px;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0.5rem 0.8rem rgba(0, 0, 0, 0.2);
    border-radius: .6rem;
    padding: .4rem 1.2rem;
    line-height: 1.8rem;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
}

.sidebar ul li:hover .tooltip {
    opacity: 1;
    background-color: #fff;
}

.sidebar.active ul li .tooltip {
    display: none;
}

/* --- CONTENIDO PRINCIPAL --- */
.main-content {
    position: relative;
    background-color: #eee;
    height: 100vh;
    top: 0;
    left: 80px; /* Ajuste para barra cerrada */
    transition: all 0.5s ease;
    width: calc(100% - 80px);
    padding: 0;
}

.sidebar.active ~ .main-content {
    left: 250px;
    width: calc(100% - 250px);
}

/* --- VISOR --- */
#viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    overflow: hidden;
}

#contenido-edificio {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#zoom-wrapper {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
    transform-origin: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Capas multimedia integradas con opacidad */
.media-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    transition: opacity 0.5s ease;
    opacity: 0;
    pointer-events: none; 
}

.media-layer.active { 
    opacity: 1; 
    pointer-events: auto; 
}

#timelapse-video {
    display: none;
}

/* --- PUNTO INTERACTIVO SOBRE LA FACHADA --- */
#btn-punto {
    position: absolute;
    top: 45%;  
    left: 40%;
    width: 35px;
    height: 35px;
    background-color: rgba(25, 25, 25, 0.8);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

#btn-punto:hover { transform: scale(1.15); }
#btn-punto i { color: white; font-size: 12px; }

/* --- BOTONES DE INTERFAZ --- */
.btn-visor {
    background: rgba(15, 15, 15, 0.75);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 40px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.btn-visor:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn-visor i { font-size: 18px; }
.btn-visor:active { transform: translateY(0); }

.btn-visor.small {
    padding: 8px 20px;
    font-size: 14px;
}

.btn-visor.icon-only {
    padding: 10px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    justify-content: center;
}

/* --- CONTROLES SUPERPUESTOS --- */
#ui-interface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    display: none;
}

.top-left-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 1002;
}

.top-right-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1002;
}

.bottom-left-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- PANEL DE INICIO (PORTADA TIMELAPSE) --- */
#panel-inicio {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#panel-inicio video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

#panel-inicio .content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#panel-inicio .content h1 {
    font-size: 2.5rem;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    letter-spacing: 2px;
    font-weight: 500;
}

.botones-inicio {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.botones-inicio button {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 10px 24px;
    font-size: 1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.botones-inicio button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translateY(-2px);
}

.botones-inicio button i {
    font-size: 1.1rem;
}

/* --- PANEL DERECHO DE PISOS --- */
.right-floor-panel {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: none;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    background: rgba(15, 15, 15, 0.6);
    padding: 15px 10px;
    border-radius: 50px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
}

.right-floor-panel.active { display: flex; }

.floor-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 400px;
    overflow-y: auto;
}

.floor-list::-webkit-scrollbar { display: none; }
.floor-list { -ms-overflow-style: none; scrollbar-width: none; }

.btn-floor {
    background: transparent;
    color: #ccc;
    border: none;
    padding: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-floor:hover, .btn-floor.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.divider {
    width: 80%;
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 5px 0;
}
}
/* A6-A8: distribuir controles sin cambiar el encuadre de las plantas. */
@media (max-width: 980px) {
    #ui-interface .top-center-controls {
        top: 74px;
        left: 20px;
        right: 20px;
        transform: none;
    }
    #ui-interface .search-bar { width: 100%; }
    #ficha-unidad:not(.ficha-completa) {
        top: 130px;
        max-height: calc(100% - 150px);
    }
}
@media (max-width: 760px) {
    #ficha-unidad { width: min(320px, calc(100% - 40px)); }
    #ficha-unidad.ficha-completa {
        top: 75px;
        max-height: calc(100% - 299px);
    }
    #panel-unidad-opciones {
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
        width: auto;
        transform: none;
    }
    #panel-unidad-opciones .floor-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        max-height: none;
    }
    #panel-unidad-opciones .divider { display: none; }
    #panel-unidad-opciones .btn-floor { min-height: 42px; }
    #panel-galeria .gv-zoom { bottom: 96px; }
}
@media (max-width: 600px) {
    #ui-interface .top-right-controls { top: 74px; }
    #ui-interface .top-center-controls { top: 128px; }
    #ficha-unidad:not(.ficha-completa) {
        top: 184px;
        max-height: calc(100% - 204px);
    }
}

/* =====================================================================
   NUEVO: BOTÓN DE PANTALLA COMPLETA FIJO (visible en cualquier apartado)
   Los botones originales #btn-fullscreen y #btn-fullscreen-inicio siguen
   en el código tal cual estaban; solo se ocultan porque este nuevo botón
   los reemplaza visualmente y nunca desaparece, estés donde estés.
   ===================================================================== */
#btn-fullscreen, #btn-fullscreen-inicio { display: none; }

.btn-fullscreen-global {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

/* =====================================================================
   NUEVO: BOTÓN DE "VER PISOS" FIJO (visible en cualquier apartado)
   El botón original #ui-btn-verpisos sigue en el código tal cual estaba
   y su lógica de mostrar/ocultar (modoBotonesFachada / modoBotonesPisos)
   no se tocó; solo se oculta con !important porque este nuevo botón lo
   reemplaza visualmente y nunca desaparece, estés donde estés.
   ===================================================================== */
#ui-btn-verpisos { display: none !important; }

.btn-verpisos-global {
    position: fixed;
    top: 20px;
    right: 72px;
    z-index: 2000;
}

/* El posicionamiento previo se conserva fuera de la vista del edificio. */
#ui-interface .top-right-controls { top: 76px; }

/* Edificio: Día/Noche · Pisos · Fullscreen en una sola fila. */
#ui-interface[style*="display: block"]:has(#ui-btn-dianoche[style*="display: flex"]) .top-right-controls {
    position: fixed;
    top: 20px;
    right: 124px;
    height: 42px;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

@media (max-width: 600px) {
    #ui-interface[style*="display: block"]:has(#ui-btn-dianoche[style*="display: flex"]) .top-right-controls { top: 76px; }
    body:has(#ui-interface[style*="display: block"] #ui-btn-dianoche[style*="display: flex"]):not(:has(#panel-mapa[style*="display: block"], #panel-tour[style*="display: block"], #panel-galeria[style*="display: block"], #panel-unidades[style*="display: block"])) :is(#btn-verpisos-global, #btn-fullscreen-global) { top: 76px; }
}
