/* =====================================================================
   Navbar principal + barra inferior móvil
   Marcado: Pages/Shared/_Layout.cshtml y Pages/Shared/_LoginPartial.cshtml
   Clases con prefijo "mn-" (main nav). Se carga después de site.css.
   ===================================================================== */

:root {
    --mn-gold: var(--accent-gold, #d4af37);
    --mn-gold-soft: rgba(212, 175, 55, 0.14);
    --mn-gold-line: rgba(212, 175, 55, 0.38);
    --mn-bg: rgba(10, 12, 19, 0.82);
    --mn-text: #c9cfdb;
    --mn-muted: #8a91a3;
    --mn-line: rgba(255, 255, 255, 0.08);
}

/* ---------- Barra ---------- */
.mn-navbar {
    position: relative; z-index: 2000;
    height: 64px;
    padding: 0 !important; margin-bottom: 1.5rem;
    background: var(--mn-bg);
    backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    overflow: visible !important;
}
/* Línea dorada inferior con brillo que recorre la barra */
.mn-navbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, .25) 15%, rgba(212, 175, 55, .6) 50%, rgba(212, 175, 55, .25) 85%, transparent 100%);
    pointer-events: none;
}
.mn-navbar::before {
    content: ""; position: absolute; bottom: 0; left: -30%; width: 30%; height: 1px; z-index: 1;
    background: linear-gradient(90deg, transparent, #fff6cf, transparent);
    animation: mnShine 7s ease-in-out infinite; opacity: .8;
    pointer-events: none;
}
@keyframes mnShine { 0%, 15% { left: -30%; } 60%, 100% { left: 100%; } }

.mn-inner {
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 1.5rem;
    position: relative;
}

/* ---------- Marca ---------- */
.mn-brand {
    display: inline-flex; align-items: center; gap: .7rem; text-decoration: none;
    margin: 0 !important; padding: 0 !important; flex-shrink: 0;
}
.mn-brand-icon {
    position: relative; width: 38px; height: 38px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 25%, rgba(243, 215, 122, .35), rgba(212, 175, 55, .08) 70%);
    border: 1px solid var(--mn-gold-line); color: var(--mn-gold); font-size: 1.05rem;
    box-shadow: 0 0 18px rgba(212, 175, 55, .22), inset 0 1px 0 rgba(255, 255, 255, .12);
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s;
}
.mn-brand:hover .mn-brand-icon { transform: rotate(-8deg) scale(1.06); box-shadow: 0 0 26px rgba(212, 175, 55, .45), inset 0 1px 0 rgba(255, 255, 255, .15); }
.mn-brand-text { display: flex; flex-direction: column; line-height: 1; }
.mn-brand-title {
    font-family: 'Marcellus', serif; font-size: 1.15rem; letter-spacing: .14em; text-transform: uppercase; color: #fff;
}
.mn-brand-title b {
    font-weight: 400;
    background: linear-gradient(135deg, #f6e27a, #d4af37 60%, #b38f24);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mn-brand-sub { font-size: .58rem; letter-spacing: .32em; text-transform: uppercase; color: var(--mn-muted); margin-top: .3rem; }

/* ---------- Enlaces ---------- */
.mn-nav { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.mn-nav > li { position: relative; }

.mn-link {
    position: relative; display: inline-flex; align-items: center; gap: .5rem;
    height: 40px; padding: 0 .9rem; border-radius: 10px;
    color: var(--mn-text) !important; font-size: .9rem; font-weight: 500; text-decoration: none; white-space: nowrap;
    background: transparent; border: 0; transition: color .2s, background .2s;
}
.mn-link > i:first-child { font-size: .9rem; width: 1.1em; text-align: center; color: var(--mn-muted); transition: color .2s, transform .2s; }
.mn-link:hover { color: #fff !important; background: rgba(255, 255, 255, .06); }
.mn-link:hover > i:first-child { color: var(--mn-gold); transform: translateY(-1px); }
.mn-link:focus { box-shadow: none; outline: none; }
.mn-link:focus-visible { box-shadow: 0 0 0 2px var(--mn-gold-line); }

/* Indicador inferior para la sección activa */
.mn-link::after {
    content: ""; position: absolute; left: 50%; bottom: -12px; width: 0; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, #b38f24, #f6e27a, #b38f24);
    box-shadow: 0 0 10px rgba(212, 175, 55, .8);
    transform: translateX(-50%); transition: width .3s cubic-bezier(.22, 1, .36, 1);
}
.mn-link.active { color: #fff !important; background: var(--mn-gold-soft); }
.mn-link.active > i:first-child { color: var(--mn-gold); }
.mn-link.active::after { width: 60%; }

/* Caret propio (sustituye al de Bootstrap) */
.mn-link.dropdown-toggle::after { display: none; }
.mn-caret { font-size: .6rem; opacity: .55; margin-left: .05rem; transition: transform .25s ease, opacity .2s; }
.mn-link.show { color: #fff !important; background: rgba(255, 255, 255, .07); }
.mn-link.show .mn-caret { transform: rotate(180deg); opacity: 1; color: var(--mn-gold); }
/* En los dropdowns ::after se oculta (caret de Bootstrap), así que el indicador activo usa ::before */
.mn-link.dropdown-toggle.active::before {
    content: ""; position: absolute; left: 50%; bottom: -12px; width: 60%; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, #b38f24, #f6e27a, #b38f24); box-shadow: 0 0 10px rgba(212, 175, 55, .8);
    transform: translateX(-50%);
}

/* ---------- Desplegables ---------- */
.mn-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    min-width: 300px; padding: .5rem !important; margin: 0 !important;
    background: linear-gradient(180deg, rgba(22, 26, 38, .98), rgba(14, 16, 24, .98)) !important;
    border: 1px solid var(--mn-line) !important; border-radius: 16px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(212, 175, 55, .08), inset 0 1px 0 rgba(255, 255, 255, .05) !important;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 2500 !important;
}
.mn-dropdown.show { animation: mnDrop .22s cubic-bezier(.22, 1, .36, 1); }
@keyframes mnDrop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* Puente invisible que conecta el botón de la barra con el menú para que nunca se pierda el hover */
.mn-dropdown::before {
    content: "";
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
    background: transparent;
    display: block;
    pointer-events: auto;
}

.mn-nav .dropdown,
.mn-user .dropdown {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: -10px;
}

/* Apertura suave tanto por hover como por click en pantallas de escritorio */
@media (min-width: 768px) {
    .mn-nav .dropdown:hover > .mn-dropdown,
    .mn-user .dropdown:hover > .mn-dropdown {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    .mn-nav .dropdown:hover > .mn-link,
    .mn-user .dropdown:hover > .mn-user-pill {
        color: #fff !important;
        background: rgba(255, 255, 255, .07) !important;
    }
    .mn-nav .dropdown:hover > .mn-link .mn-caret,
    .mn-user .dropdown:hover > .mn-user-pill .mn-caret {
        transform: rotate(180deg);
        opacity: 1;
        color: var(--mn-gold);
    }
}


.mn-dropdown-label {
    font-size: .62rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
    color: var(--mn-muted); padding: .45rem .75rem .35rem;
}
.mn-dropdown hr { margin: .4rem .5rem; border-color: var(--mn-line); opacity: 1; }

.mn-item {
    display: flex !important; align-items: center; gap: .8rem;
    padding: .55rem .7rem !important; border-radius: 11px; white-space: normal;
    color: var(--mn-text) !important; background: transparent; border: 0; width: 100%; text-align: left;
    transition: background .18s, color .18s;
}
.mn-item:hover, .mn-item:focus { background: rgba(255, 255, 255, .055) !important; color: #fff !important; }
.mn-item:active { background: rgba(255, 255, 255, .08) !important; }
.mn-item.active { background: var(--mn-gold-soft) !important; color: #fff !important; box-shadow: inset 2px 0 0 var(--mn-gold); }

.mn-item-icon {
    --c: var(--mn-gold);
    flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center; font-size: .95rem;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s;
}
.mn-item:hover .mn-item-icon { transform: scale(1.08) rotate(-4deg); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 35%, transparent); }
.mn-item-icon.c-gold   { --c: #e2bf4f; }
.mn-item-icon.c-amber  { --c: #f59e0b; }
.mn-item-icon.c-red    { --c: #f05454; }
.mn-item-icon.c-cyan   { --c: #38bdf8; }
.mn-item-icon.c-violet { --c: #a78bfa; }
.mn-item-icon.c-green  { --c: #34d399; }
.mn-item-icon.c-slate  { --c: #94a3b8; }

.mn-item-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mn-item-title { font-size: .88rem; font-weight: 600; }
.mn-item-desc { font-size: .72rem; color: var(--mn-muted); margin-top: .1rem; }
.mn-item.danger .mn-item-title { color: #f87171; }

/* ---------- Zona de usuario ---------- */
.mn-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    position: relative;
    flex-shrink: 0;
    height: 100%;
}
.mn-user .navbar-nav,
.mn-user .mn-user-nav {
    flex-direction: row;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
}
.mn-user .nav-item.dropdown {
    position: relative;
}
.mn-user .mn-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
}

.mn-user-pill {
    display: inline-flex !important; align-items: center; gap: .6rem;
    padding: .25rem .8rem .25rem .25rem !important; border-radius: 999px;
    background: rgba(255, 255, 255, .04); border: 1px solid var(--mn-line);
    color: #e5e7eb !important; text-decoration: none; transition: all .2s ease;
    cursor: pointer;
}
.mn-user-pill::after { display: none !important; }
.mn-user-pill:hover, .mn-user-pill.show { border-color: var(--mn-gold-line); background: var(--mn-gold-soft); color: #fff !important; }
.mn-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .85rem; color: #1a1406; text-transform: uppercase;
    background: linear-gradient(135deg, #f6e27a, #d4af37 60%, #9c7a1c);
    box-shadow: 0 0 0 2px rgba(10, 12, 19, .9), 0 0 0 3px var(--mn-gold-line);
}
.mn-user-name { font-size: .85rem; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mn-user-pill .mn-caret { opacity: .5; }
.mn-user-pill.show .mn-caret { transform: rotate(180deg); color: var(--mn-gold); opacity: 1; }

.mn-user-head { display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem .7rem; }
.mn-user-head .mn-avatar { width: 40px; height: 40px; font-size: 1rem; }
.mn-user-head small { display: block; font-size: .68rem; color: var(--mn-muted); }
.mn-user-head .min-w-0 { min-width: 0; }
.mn-user-head strong { display: block; color: #fff; font-size: .85rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mn-btn-login {
    display: inline-flex; align-items: center; gap: .45rem; height: 38px; padding: 0 1.1rem; border-radius: 999px;
    font-weight: 700; font-size: .85rem; text-decoration: none; color: #1a1406 !important;
    background: linear-gradient(135deg, #f6e27a, #d4af37 55%, #b38f24);
    box-shadow: 0 4px 16px rgba(212, 175, 55, .3); transition: transform .2s, box-shadow .2s;
}
.mn-btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(212, 175, 55, .45); }

/* Pantallas medianas: compactar */
@media (max-width: 1199.98px) {
    .mn-inner { gap: 1rem; }
    .mn-link { padding: 0 .65rem; }
    .mn-brand-sub { display: none; }
}
@media (max-width: 991.98px) {
    .mn-link > span { display: none; }
    .mn-link { padding: 0 .75rem; }
    .mn-user-name { display: none; }
}

/* ---------- Barra inferior móvil ---------- */
.mobile-bottom-nav {
    position: fixed; left: .6rem; right: .6rem; bottom: calc(.6rem + env(safe-area-inset-bottom));
    height: 64px; z-index: 3000;
    display: flex; justify-content: space-around; align-items: stretch;
    background: rgba(12, 14, 22, .88); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--mn-line); border-radius: 20px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.mobile-nav-item {
    position: relative; flex: 1; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: var(--mn-muted); text-decoration: none; font-size: .64rem; font-weight: 600;
    transition: color .25s, transform .15s;
}
.mobile-nav-item i { font-size: 1.15rem; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.mobile-nav-item.active { color: var(--mn-gold); }
.mobile-nav-item.active i { transform: translateY(-2px); filter: drop-shadow(0 0 6px rgba(212, 175, 55, .6)); }
.mobile-nav-item.active::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 3px; border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, #b38f24, #f6e27a); box-shadow: 0 0 10px rgba(212, 175, 55, .8);
}
.mobile-nav-item:active { transform: scale(.92); }

.mobile-more-menu { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 2999; }
.mobile-more-menu .glass-panel { padding: .5rem; background: rgba(16, 19, 28, .97); border-radius: 18px; }
.mobile-more-menu .list-group-item { border-radius: 10px; padding: .75rem .9rem; }
.mobile-more-menu .navbar-nav { flex-direction: column; align-items: stretch !important; }

.border-glass { border-color: rgba(255, 255, 255, 0.1) !important; }
.text-gold { color: var(--accent-gold) !important; }

@media (max-width: 767.98px) {
    body { padding-bottom: 90px; }
    .mn-navbar { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .mn-navbar::before { animation: none; display: none; }
}

@media print {
    .mn-navbar, .mobile-bottom-nav, .mobile-more-menu { display: none !important; }
}
