﻿/* ════════════════════════════════════════
   NAVBAR - ETHERIC LICENSES
   ════════════════════════════════════════ */

.nb {
    background: #fff;
    border-bottom: 1px solid rgba(29,45,81,.08);
    position: sticky;
    top: 0;
    z-index: 999;
    overflow: visible;
}

/* ── MAIN NAV ── */
.nb-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    overflow: visible;
}

/* BRAND */
.nb-brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
    flex-shrink: 0;
    text-decoration: none;
}

.nb-logo {
    height: 44px;
    width: auto;
}

/* LINKS */
.nb-links {
    display: flex;
    list-style: none;
    gap: .15rem;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

    .nb-links a {
        font-size: 14px;
        padding: .5rem .85rem;
        border-radius: 8px;
        color: #4a5270;
        text-decoration: none;
        transition: all .2s ease;
        white-space: nowrap;
    }

        .nb-links a:hover {
            background: rgba(29,45,81,.06);
            color: var(--primary);
        }

/* ── SEARCH WRAPPER — ocupa todo el espacio central ── */
.nb-search-wrapper {
    flex: 1; /* crece para ocupar el espacio */
    max-width: 680px; /* tope máximo */
    min-width: 180px;
    position: relative;
}

.nb-search {
    display: flex;
    align-items: center;
    width: 100%;
    background: #f0f3fa;
    border: 1.5px solid #e2e6f0;
    border-radius: 50px;
    padding: 5px 5px 5px 6px;
    transition: all .25s ease;
}

    .nb-search:focus-within {
        background: #fff;
        border-color: #e2e6f0; /* ← mismo color, no cambia al hacer focus */
        box-shadow: none;
        transform: none;
    }
    .nb-search input:focus {
        outline: none;
        box-shadow: none;
    }

    .nb-search * {
        outline: none; /* ← nuclear option, cubre todos los hijos */
    }

    .nb-search input {
        flex: 1;
        height: 40px;
        border: none;
        outline: none;
        background: transparent;
        padding: 0 10px 0 42px;
        font-size: 14px;
        font-family: 'Poppins', sans-serif;
        color: #1d2d51;
        min-width: 0;
    }

        .nb-search input::placeholder {
            color: #9aa3be;
            font-size: 13.5px;
        }

    /* Icono lupa decorativo */
    .nb-search .search-icon {
        position: absolute;
        left: 16px;
        font-size: 18px;
        color: #9aa3be;
        pointer-events: none;
        line-height: 1;
    }

/* Botón buscar */
.search-btn {
    background: #1d2d51;
    border: none;
    outline: none; /* ← aquí */
    -webkit-appearance: none; /* ← y aquí */
    appearance: none; /* ← y aquí */
    color: white;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .15s ease;
}

    .search-btn:focus {
        outline: none;
    }

/* También al form para evitar outline al hacer focus-within */
        .nb-search:focus-within .search-btn {
            box-shadow: none;
        }

    .search-btn:hover {
        background: #2a3f73;
        transform: scale(1.06);
    }

    .search-btn .material-symbols-outlined {
        font-size: 18px;
    }

.nb-btn-cid {
    padding: .45rem 1.1rem;
    border-radius: 8px;
    border: 1.5px solid #c7cde0;
    font-size: 13px;
    font-weight: 600;
    color: #4a5270;
    text-decoration: none;
    background: #f0f3fa;
    transition: .2s;
    white-space: nowrap;
    flex-shrink: 0;
}

    .nb-btn-cid:hover {
        border-color: #1d2d51;
        color: #1d2d51;
        background: #e4e8f4;
    }

/* ── DROPDOWN ── */
.search-results {
    display: none;
    position: fixed;
    background: #ffffff;
    border: 1px solid rgba(29,45,81,.10);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(29,45,81,.16);
    z-index: 99999;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
}

    .search-results.visible {
        display: block;
    }

    .search-results::-webkit-scrollbar {
        width: 4px;
    }

    .search-results::-webkit-scrollbar-track {
        background: transparent;
    }

    .search-results::-webkit-scrollbar-thumb {
        background: #d0d5e8;
        border-radius: 99px;
    }

.search-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    cursor: pointer;
    transition: background .15s ease;
    border-bottom: 1px solid #f0f2f8;
}

    .search-item:last-child {
        border-bottom: none;
    }

    .search-item:hover {
        background: #f5f7fc;
    }

.search-item-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 5px;
    flex-shrink: 0;
    border: 1px solid #e4e8f2;
}

.search-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.search-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #1d2d51;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Poppins', sans-serif;
}

.search-item-price {
    font-size: 12.5px;
    font-weight: 700;
    color: #16a34a;
    font-family: 'Poppins', sans-serif;
}

/* ── RIGHT SIDE ── */
.nb-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

/* CART */
.nb-cart {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
    cursor: pointer;
    text-decoration: none;
    color: #1d2d51;
}

    .nb-cart:hover {
        background: rgba(29,45,81,.06);
    }

.nb-cart-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 999px;
    line-height: 1.2;
}

/* BOTONES */
.nb-btn-out {
    padding: .45rem 1.1rem;
    border-radius: 8px;
    border: 1.5px solid #1d2d51;
    font-size: 13px;
    font-weight: 600;
    color: #1d2d51;
    text-decoration: none;
    transition: .2s;
    white-space: nowrap;
}

    .nb-btn-out:hover {
        background: #1d2d51;
        color: #fff;
    }

.nb-btn-pri {
    padding: .45rem 1.1rem;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: .2s;
    white-space: nowrap;
}

    .nb-btn-pri:hover {
        background: var(--accent-hover);
    }

/* ── AVATAR ── */
.nb-avatar {
    position: relative;
}

.nb-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nb-drop {
    position: absolute;
    right: 0;
    top: 48px;
    width: 200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(29,45,81,.14);
    border: 1px solid var(--border);
    padding: .5rem 0;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: .2s;
    z-index: 1000;
}

    .nb-drop.open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

.nb-drop-head {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
}

    .nb-drop-head p {
        font-weight: 600;
        font-size: 13px;
        color: var(--primary);
        margin: 0;
    }

    .nb-drop-head span {
        font-size: 11px;
        color: var(--text-muted);
    }

.nb-drop a,
.nb-drop button {
    width: 100%;
    text-align: left;
    padding: .6rem 1rem;
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    display: block;
    text-decoration: none;
}

    .nb-drop a:hover,
    .nb-drop button:hover {
        background: var(--surface-muted);
    }

/* ── MOBILE ── */
.nb-ham {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

    .nb-ham span {
        width: 22px;
        height: 2px;
        background: #1d2d51;
        border-radius: 2px;
    }

.nb-mobile {
    display: none;
    flex-direction: column;
    padding: 1rem 1.5rem;
    background: #fff;
    border-top: 1px solid var(--border);
}

    .nb-mobile a {
        padding: .7rem 0;
        color: #1d2d51;
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        border-bottom: 1px solid #f0f2f8;
    }

.nb-mobile-btns {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
    .nb-links {
        display: none;
    }

    .nb-search-wrapper {
        display: none;
    }

    .nb-ham {
        display: flex;
    }

    .nb-mobile.show {
        display: flex;
    }
}

@media (max-width: 480px) {
    .nb-btn-out {
        display: none;
    }
}
