/* ====== SIDEBAR LAYOUT ====== */
body.has-sidebar {
    overflow-x: hidden;
}

.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar — fija, siempre visible en desktop */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sidebar-text);
    letter-spacing: 1.5px;
    text-decoration: none;
    padding: 0 1.5rem;
    margin-bottom: 0.35rem;
    font-family: 'Playfair Display', Georgia, serif;
}

.sidebar-sub {
    font-size: 0.72rem;
    color: var(--sidebar-muted);
    padding: 0 1.5rem;
    margin-bottom: 2.5rem;
    opacity: 0.5;
}

.sidebar-nav {
    list-style: none;
    flex: 1;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
    padding: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.5rem;
    color: var(--sidebar-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    color: var(--sidebar-text);
    background: rgba(255,255,255,0.04);
    border-left-color: rgba(255,255,255,0.15);
}

.sidebar-nav li a.active {
    color: var(--accent-light);
    background: var(--sidebar-active-bg);
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-nav li a .nav-icon {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 1rem 1.5rem;
}

.sidebar-cta {
    padding: 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-cta .btn {
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    padding: 0.7rem 1rem;
    display: block;
}

/* Main content (offset by sidebar width) */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    min-width: 0;
}

/* Page header for sub-pages — con foto de fondo */
.page-header {
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    padding: 5rem 0 3.5rem;
    border-bottom: 1px solid var(--border);
}
.page-header .section-label { margin-bottom: 0.5rem; color: rgba(255,255,255,0.6); }
.page-header .section-title { margin-bottom: 0.5rem; color: #FFFFFF; }
.page-header p { color: rgba(255,255,255,0.8); font-size: 1rem; max-width: 600px; }

/* Hamburger button (hidden on desktop, visible on mobile) */
.hamburger {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 300;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    width: 46px;
    height: 46px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.4rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ====== MOBILE ====== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        margin-left: 0;
    }

    .page-header {
        padding: 5rem 0 2rem;
    }
}

/* ====== TABLET ====== */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
        min-width: 220px;
    }
    .main-content {
        margin-left: 220px;
    }
    .sidebar-nav li a {
        padding: 0.7rem 1.25rem;
        font-size: 0.85rem;
    }
}
