/* * ========================================================== */
/* * NAVBAR UNIFICADA DEL CLIENTE */
/* * */
/* * ! FUENTE VISUAL ÚNICA. */
/* * ! La apariencia canónica es la de index.html; estas reglas */
/* * ! se movieron aquí desde "Pantalla principal.css" y */
/* * ! "tema-global.css" para que ninguna vista dependa de un */
/* * ! CSS exclusivo de su página. */
/* * ========================================================== */

/* * ========================================================== */
/* * SHELL: FONDO, BORDE Y POSICIÓN */
/* * ========================================================== */
.custom-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background:
        linear-gradient(180deg,
            var(--navbar-background-start, rgba(0, 0, 0, 0.85)),
            var(--navbar-background-end, rgba(0, 0, 0, 0.35)));
    border-bottom:
        1px solid var(--navbar-border, rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.navbar-usuario-unificada {
    min-height: 72px;
    /* ! Tipografía fijada aquí: algunas páginas cambian la fuente */
    /* ! del body y la navbar debe leerse igual que en index. */
    font-family:
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}

/* * ========================================================== */
/* * LOGO WORLDOFDIGITAL */
/* * ========================================================== */
.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
    transition: transform 0.3s ease;
}

.brand-world {
    color: var(--brand-world, #ffffff);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.brand-of {
    color: var(--brand-of, #888888);
    font-size: 1.5rem;
    font-weight: 500;
}

.brand-digital {
    color: var(--brand-digital, #00aaff);
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.45);
    transition:
        color 0.3s ease,
        text-shadow 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo:hover .brand-digital {
    color: var(--brand-digital-hover, #33ccff);
    text-shadow: 0 0 25px rgba(0, 170, 255, 0.8);
}

.navbar-usuario-unificada .navbar-usuario-fila {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.navbar-usuario-unificada .logo {
    min-width: 0;
    flex: 0 1 auto;
    margin-right: 0;
    white-space: nowrap;
}

.navbar-usuario-acciones {
    display: flex;
    min-width: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.navbar-user-slot {
    display: flex;
    min-width: 0;
    align-items: center;
}

.btn-navbar-contextual,
.navbar-auth-link {
    display: inline-flex;
    min-height: 42px;
    padding: 0 13px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.btn-navbar-contextual:hover,
.navbar-auth-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.085);
    border-color: rgba(255, 255, 255, 0.2);
}

/* * ========================================================== */
/* * AVISO COMPARTIDO DE SESIÓN REQUERIDA */
/* * ========================================================== */
.navbar-auth-link.navbar-auth-link--sesion-requerida {
    color: #ffffff;
    background: rgba(15, 240, 252, 0.13);
    border-color: rgba(15, 240, 252, 0.72);
    box-shadow:
        0 0 0 3px rgba(15, 240, 252, 0.12),
        0 0 22px rgba(15, 240, 252, 0.28);
    animation: navbar-sesion-pulso 1.15s ease-in-out 2;
}

.navbar-sesion-aviso {
    --navbar-aviso-flecha-x: 50%;
    position: fixed;
    z-index: 1085;
    display: flex;
    width: min(320px, calc(100vw - 24px));
    min-height: 48px;
    padding: 11px 14px;
    align-items: center;
    gap: 10px;
    color: #f7fbff;
    background:
        linear-gradient(145deg,
            rgba(14, 29, 42, 0.98),
            rgba(9, 18, 29, 0.98));
    border: 1px solid rgba(15, 240, 252, 0.42);
    border-radius: 13px;
    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.42),
        0 0 20px rgba(15, 240, 252, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.35;
}

.navbar-sesion-aviso::before {
    position: absolute;
    top: -6px;
    left: var(--navbar-aviso-flecha-x);
    width: 11px;
    height: 11px;
    content: "";
    background: rgba(14, 29, 42, 0.98);
    border-top: 1px solid rgba(15, 240, 252, 0.42);
    border-left: 1px solid rgba(15, 240, 252, 0.42);
    transform: translateX(-50%) rotate(45deg);
}

.navbar-sesion-aviso.navbar-sesion-aviso--arriba::before {
    top: auto;
    bottom: -6px;
    border-top: 0;
    border-left: 0;
    border-right: 1px solid rgba(15, 240, 252, 0.42);
    border-bottom: 1px solid rgba(15, 240, 252, 0.42);
}

.navbar-sesion-aviso.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.navbar-sesion-aviso > i {
    flex: 0 0 auto;
    color: var(--accent-global, #0ff0fc);
    font-size: 1rem;
}

@keyframes navbar-sesion-pulso {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.045);
    }
}

.navbar-usuario-unificada .dropdown-user > .dropdown-toggle {
    min-height: 42px;
}

/* * ========================================================== */
/* * TRIGGER DEL MENÚ DE USUARIO (F4.2) */
/* * */
/* * ! Antes usaba .btn-outline-light: borde blanco permanente + */
/* * ! halo blanco de foco de Bootstrap, ajeno al lenguaje del   */
/* * ! proyecto. Se sustituye por una superficie propia, en el   */
/* * ! mismo espíritu que .btn-navbar-contextual / .navbar-auth- */
/* * ! link de esta navbar, con acento cian discreto (#0ff0fc,   */
/* * ! el mismo --accent-global del proyecto) en vez de blanco.  */
/* * ! El avatar y el nombre siguen siendo lo protagonista.      */
/* * ========================================================== */
.navbar-user-trigger {
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.navbar-user-trigger:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(15, 240, 252, 0.28);
    box-shadow: 0 0 14px rgba(15, 240, 252, 0.12);
}

/* ! Foco propio: Bootstrap ya no aporta ninguno al retirar */
/* ! .btn-outline-light, así que este es el único indicador */
/* ! accesible de foco por teclado del trigger. */
.navbar-user-trigger:focus-visible {
    outline: 2px solid rgba(15, 240, 252, 0.55);
    outline-offset: 2px;
    background: rgba(255, 255, 255, 0.045);
}

/* ? Dropdown abierto: Bootstrap ya marca aria-expanded="true" en */
/* ? este mismo botón al mostrar el menú; se reutiliza sin JS nuevo. */
.navbar-user-trigger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(15, 240, 252, 0.32);
    box-shadow: 0 0 12px rgba(15, 240, 252, 0.14);
}

/* * ========================================================== */
/* * BOTÓN DEL CARRITO (index.html y detalle-juego.html) */
/* * ========================================================== */
.btn-cart-navbar {
    display: inline-flex;
    min-height: 42px;
    padding: 8px 16px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.15rem;
    transition: all 0.3s ease;
}

#contadorCarrito.vacio {
    display: none !important;
}

.carrito-badge {
    position: absolute;
    top: -6px;
    right: -8px;

    font-size: 0.75rem;
    font-weight: bold;

    padding:
        5px 8px;

    border:
        2px solid #111827;

    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.5);
}

.navbar-menu-link {
    display: flex;
    width: 100%;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.navbar-menu-link:hover {
    color: inherit;
}

.navbar-item-activo {
    background: rgba(255, 255, 255, 0.055);
}

/* * ========================================================== */
/* * RESPONSIVE DEL LOGO (MIGRADO DESDE LOS CSS DE PÁGINA) */
/* * ========================================================== */
@media (max-width: 768px) {
    .logo {
        font-size: 1.6rem;
    }

    .brand-of {
        font-size: 1.2rem;
    }
}

/* * ========================================================== */
/* * UNA SOLA LÍNEA EN MÓVIL */
/* * ========================================================== */
@media (max-width: 575.98px) {
    .navbar-usuario-unificada {
        min-height: 62px;
    }

    .navbar-usuario-unificada .navbar-usuario-fila {
        padding-right: 10px !important;
        padding-left: 10px !important;
        gap: 7px;
    }

    .navbar-usuario-unificada .logo {
        font-size: 1.13rem !important;
        letter-spacing: -0.035em !important;
        gap: 2px !important;
    }

    .navbar-usuario-unificada .brand-of {
        display: none;
    }

    .navbar-usuario-acciones {
        gap: 6px;
    }

    .btn-navbar-contextual,
    .navbar-auth-link {
        width: 38px;
        min-width: 38px;
        min-height: 38px;
        padding: 0;
        border-radius: 11px;
    }

    .btn-navbar-contextual span,
    .navbar-auth-link span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .navbar-usuario-unificada .btn-cart-navbar {
        width: 38px;
        min-width: 38px;
        height: 38px;
        padding: 0;
    }

    /* ! Todas las vistas de cliente usan .navbar-user-slot, */
    /* ! por eso ya no se duplica el selector #contenedorUsuario. */
    .navbar-user-slot .dropdown-toggle {
        width: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 3px !important;
        justify-content: center;
    }

    .navbar-user-slot .dropdown-toggle::after {
        display: none;
    }

    .navbar-user-slot .avatar-sm {
        width: 32px !important;
        height: 32px !important;
        margin-right: 0 !important;
    }

    .navbar-user-slot .dropdown-menu {
        position: absolute;
        right: 0;
        left: auto;
    }
}

@media (max-width: 350px) {
    .navbar-usuario-unificada .logo {
        font-size: 1.02rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .navbar-auth-link.navbar-auth-link--sesion-requerida {
        animation: none;
    }

    .navbar-sesion-aviso {
        transform: none;
        transition: none;
    }
}
/* ! El acceso sin sesión usa .navbar-auth-link en todas las vistas. */
/* ! .btn-auth-navbar quedó sin uso al unificar el render del slot. */

/* * ========================================================== */
/* * ULTRA WIDE — CONTENIDO INTERNO DE NAVBAR */
/* * ! Consolidado en .wod-shell (layout-usuario.css), ya */
/* * ! aplicada a .navbar-usuario-fila. El fondo */
/* * ! (.custom-navbar) sigue full-width. */
/* * ========================================================== */
