/* ============================================================
   MENU.CSS — Sidebar fijo desktop + hamburguesa móvil
   Patricia Alonso · patriciaalonso.es
   ============================================================ */

/* ============================================================
   SIDEBAR — DESKTOP (siempre visible)
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 160px;
    height: 100vh;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 30px;
    gap: 0;

    /* Efecto cristal bosque mágico */
    background: linear-gradient(
        180deg,
        rgba(10, 5, 25, 0.85) 0%,
        rgba(30, 10, 60, 0.75) 40%,
        rgba(10, 30, 40, 0.80) 100%
    );
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-right: 1px solid rgba(145, 70, 255, 0.2);
    box-shadow:
        inset -1px 0 0 rgba(123, 95, 224, 0.08),
        4px 0 24px rgba(0, 0, 0, 0.4);
}

/* Efecto brillo superior */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #9146FF, #7B5FE0, transparent);
    opacity: 0.6;
}

/* ============================================================
   LOGO DENTRO DEL SIDEBAR
   ============================================================ */
.sidebar .logo-pz {
    position: static;
    width: 70px;
    margin-bottom: 24px;
    display: block;
}

.sidebar .logo-pz img {
    width: 70px;
    height: auto;
    filter: drop-shadow(0 0 8px rgba(123, 95, 224, 0.5));
    transition: filter 0.3s ease;
}

.sidebar .logo-pz:hover img {
    filter: drop-shadow(0 0 14px rgba(123, 95, 224, 0.9));
}

/* ============================================================
   SEPARADOR
   ============================================================ */
.sidebar-sep {
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(145, 70, 255, 0.4), transparent);
    margin: 6px 0 10px;
}

/* ============================================================
   NAVEGACIÓN
   ============================================================ */
.sidebar nav {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar nav::-webkit-scrollbar { display: none; }

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.sidebar nav li {
    width: 100%;
}

/* ============================================================
   ENLACES DEL SIDEBAR
   ============================================================ */
.sidebar nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    letter-spacing: 0.03em;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar nav a .nav-icon {
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.sidebar nav a:hover {
    color: #7B5FE0;
    background: rgba(123, 95, 224, 0.08);
}

.sidebar nav a:hover .nav-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 0 6px #7B5FE0);
}

/* Indicador activo */
.sidebar nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 2px;
    background: #7B5FE0;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar nav a:hover::before { opacity: 1; }

/* ============================================================
   ENLACE ADMIN
   ============================================================ */
.sidebar nav a.admin-link {
    color: #7B5FE0;
    margin-top: 4px;
}

.sidebar-admin-sep {
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(123, 95, 224, 0.3), transparent);
    margin: 8px auto;
}

/* ============================================================
   HAMBURGUESA — oculto en desktop
   ============================================================ */
.menu-btn {
    display: none;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 14px 0 0 16px;
    cursor: pointer;
    z-index: 500;
    padding: 8px 18px;
    background: rgba(123, 95, 224, 0.15);
    border: 1px solid rgba(123, 95, 224, 0.4);
    border-radius: 20px;
    box-shadow: 0 0 8px rgba(123, 95, 224, 0.3);
    backdrop-filter: blur(8px);
}

.menu-btn-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 13px;
    flex-shrink: 0;
}

.menu-btn-icon span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.menu-btn-label {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    color: #fff;
    letter-spacing: 0.03em;
}

/* ============================================================
   TOPBAR MÓVIL — agrupa el botón Menú y el de Iniciar sesión
   en la misma línea (en desktop no cambia nada: el menú está
   oculto y el login se comporta igual que siempre)
   ============================================================ */
@media (max-width: 768px) {
    .topbar-movil {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .topbar-movil .menu-btn {
        flex-shrink: 0;
    }

    .topbar-movil .login-superpuesto {
        width: auto;
        flex: 1 1 auto;
        padding: 10px 16px 10px 0;
    }
}

/* ============================================================
   SIDE-MENU MÓVIL — oculto en desktop
   ============================================================ */
.side-menu {
    display: none;
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 280px;
    height: 100%;
    padding-top: 60px;
    padding-bottom: 20px;
    background: rgba(0, 5, 20, 0.97);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(123, 95, 224, 0.3);
    transition: left 0.3s ease;
    z-index: 9000;
    overflow-y: auto;
}

.side-menu.open { left: 0; }

.side-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-menu li { margin: 2px 0; }

.side-menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    padding: 12px 20px;
    display: block;
    transition: color 0.2s, background 0.2s;
}

.side-menu a:hover {
    color: #7B5FE0;
    background: rgba(123, 95, 224, 0.08);
}

/* Separador antes del enlace Admin */
.side-menu-separador {
    height: 1px;
    background: rgba(123, 95, 224, 0.3);
    margin: 10px 16px;
}

/* Enlace "Admin" destacado dentro del menú móvil */
.side-menu-admin-link {
    color: #7B5FE0;
}

/* ============================================================
   OVERLAY MÓVIL
   ============================================================ */
.overlay {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 8999;
}

.overlay.show { display: block !important; }

/* ============================================================
   CONTENIDO — desplazado para dejar espacio al sidebar
   ============================================================ */
body.has-sidebar {
    padding-left: 160px;
}

/* ============================================================
   BANNER — z-index bajo
   ============================================================ */
.banner-portada {
    position: relative;
    z-index: 1;
}

.section-title,
.section-title::before,
.section-title::after {
    display: none !important;
}

/* ============================================================
   RESPONSIVE MÓVIL
   ============================================================ */
@media (max-width: 768px) {
    /* Ocultar sidebar en móvil */
    .sidebar { display: none; }

    /* Mostrar hamburguesa en móvil */
    .menu-btn { display: flex; }

    /* Mostrar side-menu en móvil */
    .side-menu { display: block; }

    /* Quitar padding del body */
    body.has-sidebar { padding-left: 0; }
}