/* =========================================================
   VISTA DETALLE · Overlay de subpáginas
========================================================= */

#vista-detalle-container {
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: var(--primary-blue);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease-out;
    overflow: hidden;
}

#vista-detalle-container.is-open {
    opacity: 1;
    pointer-events: auto;
}

#iframe-detalle {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease-out;
    background: var(--primary-blue);
}

#vista-detalle-container.is-loaded #iframe-detalle {
    opacity: 1;
}


/* Botón cerrar / volver */
#vista-detalle-close {
    position: fixed;
    top: calc(var(--header-height) + 20px);
    left: 20px;
    z-index: 950;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--primary-blue);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 6px 20px rgba(23, 62, 104, 0.3);
}

#vista-detalle-close.is-visible {
    display: inline-flex;
}

#vista-detalle-close:hover {
    background: var(--cta-blue);
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(23, 62, 104, 0.4);
}

#vista-detalle-close svg {
    width: 16px;
    height: 16px;
}

/* Loader */
#vista-detalle-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-blue);
    z-index: 5;
    transition: opacity 0.3s ease-out;
}

#vista-detalle-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scroll bloqueado cuando el detalle está abierto */
body.detail-open {
    overflow: hidden;
}