/* =========================================
   GLOBAL SHELL & NAVIGATION
   Rastro Ripollet - v3.1 (Corrección Diseño)
   ========================================= */

/* =========================================
   1. CABECERA MÓVIL (Top)
   ========================================= */
.mobile-logo {
    height: 28px;
    width: auto;
    display: none;
}

/* =========================================
   2. NAVEGACIÓN (APP SIDEBAR)
   ========================================= */
.app-nav {
    position: fixed;
    z-index: 9999;
    background: #ffffff !important;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

/* --- MÓVIL Y ESC_VERTICAL (Barra Inferior) --- */
@media (max-width: 899px),
(orientation: portrait) {
    .app-nav {
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--mobile-nav-h);
        display: flex;
        align-items: center;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        padding: 0 10px;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        /* Curva premium 'out-expo' */
        will-change: transform;
        /* Preparar hardware */
    }

    .app-nav.nav-hidden {
        transform: translateY(102%);
        /* Esconder totalmente abajo */
    }

    .desktop-logo-container,
    .sidebar-bottom,
    .link-text {
        display: none !important;
    }

    .nav-list-container {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        height: 100%;
    }

    .nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        width: 60px;
        height: 100%;
    }

    .icon-box svg {
        display: block;
        width: 24px;
        height: 24px;
        stroke-width: 2px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-link.active {
        color: var(--text-main);
        font-weight: 700;
    }

    .nav-link.active .icon-box svg {
        transform: scale(1.3);
        stroke: var(--text-main);
        stroke-width: 2.2px;
        fill: var(--text-main);
    }

    .nav-link.active[href*="faqs"] .icon-box svg circle {
        fill: var(--text-main);
    }

    .nav-link.active[href*="faqs"] .icon-box svg path {
        stroke: #fff;
    }

    /* Logo central exclusivo para móvil */
    .nav-center-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 60px;
        height: 100%;
    }

    .nav-center-logo img {
        height: 47px;
        width: auto;
        object-fit: contain;
    }
}

/* --- ESCRITORIO (Sidebar Lateral) --- */
@media (min-width: 900px) and (orientation: landscape) {
    .app-nav {
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--nav-w-closed);
        background: #fff;
        display: flex;
        flex-direction: column;
        padding: 30px 0;
        border-right: 1px solid rgba(0, 0, 0, 0.05);
        overflow: hidden;
        white-space: nowrap;
    }

    .app-nav:hover {
        width: var(--nav-w-open);
    }

    .desktop-logo-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-bottom: 10px;
        width: 100%;
        min-height: 80px;
        position: relative;
    }

    .logo-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    /* Logo Corto (Visible por defecto) */
    .logo-icon-only {
        width: 40px;
        height: auto;
        display: block;
    }

    /* Logo Largo (Visible en Hover) */
    .desktop-logo {
        width: 210px;
        height: auto;
        display: none;
    }

    /* Subtítulo debajo del logo */
    .nav-subtitle {
        font-size: 12px;
        color: var(--text-muted);
        margin-top: 5px;
        display: none;
        white-space: normal;
        line-height: 1.2;
        text-align: center;
        padding: 0 10px;
        letter-spacing: 0.2px;
    }

    .app-nav:hover .desktop-logo,
    .app-nav:hover .nav-subtitle {
        display: block;
    }

    .app-nav:hover .logo-icon-only {
        display: none;
    }

    .nav-list-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
        flex-grow: 1;
    }

    .nav-link {
        display: flex;
        align-items: center;
        height: 50px;
        padding-left: calc((var(--nav-w-closed) - 28px) / 2);
        padding-right: 20px;
        color: #737373;
        transition: all 0.2s ease;
        text-decoration: none;
    }

    .nav-link.active {
        color: var(--text-main);
        font-weight: 700;
    }

    .nav-link.active .icon-box svg {
        transform: scale(1.2);
        stroke: var(--text-main);
        stroke-width: 2.2px;
        fill: var(--text-main);
    }

    .nav-link.active[href*="faqs"] .icon-box svg circle {
        fill: var(--text-main);
    }

    .nav-link.active[href*="faqs"] .icon-box svg path {
        stroke: #fff;
    }

    /* Ocultar logo central en escritorio */
    .nav-center-logo {
        display: none;
    }

    .nav-separator {
        height: 1px;
        background: rgba(0, 0, 0, 0.05);
        margin: 10px 20px;
        width: calc(100% - 40px);
        flex-shrink: 0;
    }

    .nav-link:not(#nav-account-link):hover {
        background: transparent;
        color: #404040;
    }

    .nav-link:not(#nav-account-link):hover .icon-box {
        transform: scale(1.15) rotate(12deg);
    }

    .icon-box {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        flex-shrink: 0;
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .icon-box svg {
        width: 24px;
        height: 24px;
        stroke-width: 2px;
    }

    .link-text {
        margin-left: 20px;
        font-size: 15px;
        font-weight: 500;
        display: none;
    }

    .app-nav:hover .link-text {
        display: block;
    }

    #nav-account-link {
        margin-top: auto;
    }

    .sidebar-bottom {
        margin-top: auto;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        margin-bottom: 20px;
    }

    .nav-socials {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .social-link {
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        padding-left: calc((var(--nav-w-closed) - 22px) / 2);
        color: #737373;
        transition: all 0.2s ease;
    }

    .social-link .icon-box {
        width: 22px;
        height: 22px;
    }

    .social-link .icon-box svg {
        width: 17px;
        height: 17px;
    }

    .social-link .link-text {
        font-size: 13.5px;
        opacity: 0.85;
    }
}

/* =========================================
   3. ESTILOS BASE PARA LOGOS CENTRALES
   ========================================= */
.mobile-only-logo {
    display: block;
    height: 50px !important;
    width: auto !important;
    object-fit: contain;
    margin-bottom: 12px !important;
}

.desktop-only-icon,
.desktop-only {
    display: none !important;
}

@media (min-width: 900px) and (orientation: landscape) {
    .mobile-only-logo {
        display: none !important;
    }

    .desktop-only-icon,
    .desktop-only {
        display: flex !important;
    }
}

/* =========================================
   4. PROTECCIÓN DE CONTENIDO
   ========================================= */
img {
    -webkit-user-select: none;
    -webkit-user-drag: none;
    user-select: none;
    /* pointer-events: none se evita para no romper galerías interactivas */
}

/* =========================================
   5. UNIFIED PAGE HEADERS (Premium Style)
   ========================================= */
.page-header {
    text-align: center;
    padding: 60px 20px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 42px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.page-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (max-width: 899px),
(orientation: portrait) {
    .page-header {
        padding: 40px 15px 30px;
    }

    .page-title {
        font-size: 32px;
    }

    .page-subtitle {
        font-size: 14.5px;
    }
}