/* =========================================================
   NAVBAR — visitante (no autenticado)
========================================================= */
body.frontend-layout {
    padding-top: 108px;
}

.navbar {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(320px, 90%, 980px);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 12px 16px 12px 20px;

    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    border-radius: 999px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(41, 61, 71, 0.06);

    z-index: 1000;
}

/* =========================
   LOGO
========================= */
.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(41, 61, 71, 0.18);
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

/* =========================
   LINKS
========================= */
.nav-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-center a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    padding: 8px 12px;
    border-radius: 999px;
    transition: color .25s, background .25s;
    white-space: nowrap;
}

.nav-center a:hover {
    color: var(--violet);
    background: var(--violet-glow);
}

.nav-center a.active {
    color: var(--violet);
    background: var(--violet-glow);
    font-weight: 700;
}

.icon { display: none; }

/* Estos enlaces solo existen para el menú móvil (login/registro ya están en nav-right en escritorio) */
.nav-mobile-only { display: none; }

/* =========================
   BOTONES DERECHA
========================= */
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-right .login {
    padding: 9px 18px;
    border: 1.5px solid var(--violet);
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--violet);
    white-space: nowrap;
    transition: all .25s;
}

.nav-right .register {
    padding: 9px 18px;
    background: var(--coral);
    color: #182534;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--shadow-color);
    transition: all .25s;
}

.nav-right .login:hover {
    background: var(--violet);
    color: #fff;
}

.nav-right .register:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(51, 94, 153, 0.32);
}

/* =========================
   HAMBURGUESA (oculta en escritorio)
========================= */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: var(--surface);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--violet);
    transition: transform .3s, opacity .3s;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 35, 58, 0.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    z-index: 998;
}

.nav-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

body.nav-open {
    overflow: hidden;
}

/* =========================================================
   📱 TABLET / MÓVIL
========================================================= */
@media (max-width: 860px) {
    body.frontend-layout {
        padding-top: 90px;
    }

    .navbar {
        top: 14px;
        width: calc(100% - 24px);
        padding: 10px 12px 10px 16px;
    }

    .brand-text {
        display: none;
    }

    .nav-right {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* Panel deslizante */
    .nav-center {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: min(320px, 84vw);
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
        padding: 100px 20px 40px;
        box-shadow: -18px 0 44px rgba(15, 35, 58, 0.18);
        transition: right .35s var(--ease-soft);
        z-index: 999;
        overflow-y: auto;
    }

    .nav-center.active {
        right: 0;
    }

    .nav-center a {
        width: 100%;
        padding: 14px 16px;
        border-radius: var(--radius);
        font-size: 1rem;
        justify-content: flex-start;
    }

    .icon {
        display: inline-block;
        font-size: 1.1rem;
    }

    .nav-mobile-only {
        display: flex;
    }

    .nav-center a.active {
        background: var(--violet);
        color: #fff;
    }
}

@media (max-width: 420px) {
    .navbar {
        border-radius: 26px;
    }

    .nav-center {
        width: 88vw;
        padding: 92px 16px 32px;
    }
}
