/* ════════════════════════════════════════════════════════════
   NAV — barra principal (fija), categorías (desktop) y menú lateral (móvil)
   Paleta: variables --clr-* definidas en base.html
════════════════════════════════════════════════════════════ */
.nv-wrap { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px)  { .nv-wrap { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .nv-wrap { padding: 0 2rem; } }

/* ── Barra principal ── */
.nv-top {
    position: sticky; top: 0; z-index: 50;
    background: #fff;
    border-bottom: 1px solid var(--clr-border);
}
.nv-row { display: flex; align-items: center; gap: .5rem; height: 60px; }
@media (min-width: 1024px) { .nv-row { gap: 1.75rem; height: 76px; } }

.nv-logo { display: flex; align-items: center; flex-shrink: 0; }
.nv-logo img { height: 30px; width: auto; object-fit: contain; }
@media (min-width: 1024px) { .nv-logo img { height: 36px; } }

/* Botones de icono (móvil) */
.nv-ico {
    flex-shrink: 0; width: 42px; height: 42px; border: 0; border-radius: .8rem; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: var(--clr-text); font-size: 1.05rem;
    transition: background .15s;
}
.nv-ico:hover, .nv-ico[aria-expanded="true"] { background: #F7F1EB; }
.nv-burger { margin-left: -.5rem; }
@media (min-width: 1024px) { .nv-burger, .nv-search-toggle { display: none; } }

/* ── Buscador ── */
.nv-search {
    position: relative; flex: 1; max-width: 640px; margin: 0 auto;
    display: flex; align-items: center;
}
.nv-search-ico { position: absolute; left: 1.1rem; font-size: .9rem; color: #A79D94; pointer-events: none; }
.nv-search input {
    width: 100%; height: 48px; padding: 0 6.5rem 0 2.8rem;
    border: 1.5px solid transparent; border-radius: 999px; outline: none;
    background: #F7F1EB; font-size: .9rem; font-weight: 500; color: var(--clr-text);
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.nv-search input::placeholder { color: #A79D94; }
.nv-search input:hover { background: #F2EAE2; }
.nv-search input:focus { background: #fff; border-color: var(--clr-orange); box-shadow: 0 0 0 4px rgba(229,99,40,.12); }
.nv-search input::-webkit-search-cancel-button { display: none; }
.nv-search-btn {
    position: absolute; right: 5px; top: 5px; bottom: 5px;
    padding: 0 1.25rem; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--clr-orange); color: #fff; font-size: .84rem; font-weight: 700;
    transition: background .15s;
}
.nv-search-btn:hover { background: var(--clr-orange-2); }
.nv-search-btn i { display: none; }
@media (max-width: 1023px) {
    .nv-search {
        position: absolute; left: 0; right: 0; top: 100%; max-width: none;
        padding: .75rem 1rem; background: #fff; border-bottom: 1px solid var(--clr-border);
        box-shadow: 0 14px 30px rgba(28,28,28,.08);
        opacity: 0; visibility: hidden; transform: translateY(-6px);
        transition: opacity .18s, transform .18s, visibility 0s .18s;
    }
    .nv-top.is-search .nv-search { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .18s, visibility 0s; }
    .nv-search-ico { left: 2.1rem; }
    .nv-search input { padding-right: 3.5rem; }
    .nv-search-btn { right: calc(1rem + 5px); top: calc(.75rem + 5px); bottom: calc(.75rem + 5px); width: 38px; padding: 0; }
    .nv-search-btn span { display: none; }
    .nv-search-btn i { display: inline; font-size: .85rem; }
}

/* ── Acciones (cuenta y carrito) ── */
.nv-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; flex-shrink: 0; }
@media (min-width: 1024px) { .nv-actions { gap: .6rem; } }
.nv-pill {
    display: inline-flex; align-items: center; gap: .55rem; height: 44px; padding: 0 1rem;
    border: 1px solid var(--clr-border); border-radius: 999px; cursor: pointer;
    background: #fff; color: var(--clr-text); text-decoration: none;
    font-size: .84rem; font-weight: 600; white-space: nowrap;
    transition: border-color .15s, background .15s;
}
.nv-pill:hover, .nv-pill[aria-expanded="true"] { border-color: var(--clr-text); }
.nv-pill > i { font-size: .85rem; }
.nv-pill .nv-caret { font-size: .55rem; color: var(--clr-muted); transition: transform .2s; }
.nv-pill[aria-expanded="true"] .nv-caret { transform: rotate(180deg); }
.nv-pill-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.nv-avatar {
    width: 30px; height: 30px; margin-left: -.6rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--clr-orange); color: #fff; font-size: .7rem; letter-spacing: 0;
}
@media (max-width: 1023px) { .nv-user, .nv-login { display: none !important; } }

.nv-cart {
    position: relative; flex-shrink: 0; width: 44px; height: 44px; border-radius: .9rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: #1C1C1C; color: #fff; font-size: 1rem; text-decoration: none;
    transition: background .15s, transform .15s;
}
.nv-cart:hover { background: var(--clr-orange); color: #fff; }
.nv-cart:active { transform: scale(.95); }
@media (max-width: 1023px) { .nv-cart { width: 42px; height: 42px; border-radius: .8rem; } }
.nv-count {
    position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    border: 2px solid #fff; border-radius: 999px; background: var(--clr-orange); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .64rem; font-weight: 800; line-height: 1;
    transition: transform .2s;
}
.nv-count.is-cero { transform: scale(0); }

/* Menú de usuario */
.nv-user { position: relative; }
.nv-menu {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; min-width: 230px; padding: .4rem;
    border: 1px solid var(--clr-border); border-radius: 1rem; background: #fff;
    box-shadow: 0 18px 44px rgba(28,28,28,.14);
}
.nv-menu[hidden] { display: none; }
.nv-menu-head { padding: .6rem .75rem .7rem; margin-bottom: .3rem; border-bottom: 1px solid #F3ECE5; }
.nv-menu-head strong { display: block; font-size: .88rem; color: var(--clr-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-menu-head span { font-size: .74rem; color: var(--clr-muted); }
.nv-menu a, .nv-menu button {
    display: flex; align-items: center; gap: .7rem; width: 100%; padding: .6rem .75rem;
    border: 0; border-radius: .65rem; background: none; cursor: pointer; text-align: left; text-decoration: none;
    font-size: .84rem; font-weight: 500; color: var(--clr-text);
}
.nv-menu a:hover, .nv-menu button:hover { background: #F7F1EB; }
.nv-menu i { width: 16px; text-align: center; font-size: .82rem; color: var(--clr-muted); }
.nv-menu .nv-menu-salir { margin-top: .3rem; border-top: 1px solid #F3ECE5; padding-top: .3rem; }
.nv-menu .nv-menu-salir button { color: #DC2626; }
.nv-menu .nv-menu-salir button i { color: #DC2626; }

/* ── Categorías (desktop) ── */
.nv-cats { position: relative; z-index: 40; display: none; background: #fff; border-bottom: 1px solid var(--clr-border); }
@media (min-width: 1024px) { .nv-cats { display: block; } }
.nv-cats-row { display: flex; align-items: center; gap: .25rem; height: 50px; }
.nv-cat {
    position: relative; display: inline-flex; align-items: center; gap: .5rem; height: 50px; padding: 0 .9rem;
    font-size: .86rem; font-weight: 600; color: #4B4540; text-decoration: none; white-space: nowrap;
    transition: color .15s;
}
.nv-cats-row > .nv-cat:first-child { margin-left: -.9rem; }
.nv-cat > i:first-child { font-size: .8rem; color: #B9AEA4; transition: color .15s; }
.nv-cat::after {
    content: ''; position: absolute; left: .9rem; right: .9rem; bottom: -1px; height: 2px; border-radius: 2px;
    background: var(--clr-orange); transform: scaleX(0); transition: transform .2s;
}
.nv-cat:hover, .nv-cat.is-active { color: var(--clr-text); }
.nv-cat:hover > i:first-child, .nv-cat.is-active > i:first-child { color: var(--clr-orange); }
.nv-cat.is-active::after, .nv-drop:hover > .nv-cat::after { transform: scaleX(1); }
.nv-cat .nv-caret { font-size: .52rem; color: #B9AEA4; transition: transform .2s; }
.nv-drop:hover .nv-caret, .nv-drop:focus-within .nv-caret { transform: rotate(180deg); }

.nv-drop { position: relative; }
.nv-drop-menu {
    position: absolute; left: -.25rem; top: 100%; z-index: 60; min-width: 440px; padding: .6rem;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem;
    border: 1px solid var(--clr-border); border-radius: 1.1rem; background: #fff;
    box-shadow: 0 22px 50px rgba(28,28,28,.14);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .16s, transform .16s, visibility .16s;
}
.nv-drop:hover .nv-drop-menu, .nv-drop:focus-within .nv-drop-menu { opacity: 1; visibility: visible; transform: none; }
.nv-drop-menu a {
    display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: .75rem;
    font-size: .85rem; font-weight: 500; color: var(--clr-text); text-decoration: none;
    transition: background .12s;
}
.nv-drop-menu a:hover { background: #F7F1EB; }
.nv-drop-menu a i {
    width: 32px; height: 32px; flex-shrink: 0; border-radius: .6rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--clr-orange-tint); color: var(--clr-orange); font-size: .8rem;
}
.nv-drop-menu .nv-drop-all {
    grid-column: 1 / -1; justify-content: space-between; margin-top: .3rem;
    padding: .75rem .9rem; background: #F7F1EB; font-weight: 700;
}
.nv-drop-menu .nv-drop-all i { width: auto; height: auto; background: none; font-size: .7rem; }
.nv-drop-menu .nv-drop-all:hover { background: #F0E6DC; }

.nv-cats-end { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.nv-cats-end a { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; color: var(--clr-muted); text-decoration: none; transition: color .15s; }
.nv-cats-end a:hover { color: var(--clr-text); }
.nv-cats-end a i { font-size: .95rem; }
.nv-cats-end .fa-whatsapp { color: #25D366; }

/* ── Menú lateral (móvil) ── */
.nv-veil {
    position: fixed; inset: 0; z-index: 70; background: rgba(20,20,20,.5);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.nv-drawer {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 80; width: min(86vw, 360px);
    display: flex; flex-direction: column; background: #fff;
    transform: translateX(-100%); visibility: hidden;
    transition: transform .3s cubic-bezier(.22, 1, .36, 1), visibility 0s .3s;
}
body.nv-open { overflow: hidden; }
body.nv-open .nv-veil { opacity: 1; visibility: visible; }
body.nv-open .nv-drawer { transform: none; visibility: visible; box-shadow: 20px 0 60px rgba(0,0,0,.2); transition: transform .3s cubic-bezier(.22, 1, .36, 1), visibility 0s; }
.nv-dr-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem .75rem .75rem 1.25rem; border-bottom: 1px solid #F3ECE5; }
.nv-dr-head img { height: 28px; width: auto; }
.nv-dr-body { flex: 1; overflow-y: auto; padding: 1rem; }

.nv-dr-user { display: flex; align-items: center; gap: .8rem; padding: .9rem; margin-bottom: 1rem; border-radius: 1rem; background: #F7F1EB; text-decoration: none; color: var(--clr-text); }
.nv-dr-user .nv-avatar { width: 40px; height: 40px; margin: 0; font-size: .82rem; flex-shrink: 0; }
.nv-dr-user-txt { min-width: 0; }
.nv-dr-user-txt strong { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-dr-user-txt small { font-size: .76rem; color: var(--clr-muted); }
.nv-dr-user > i { margin-left: auto; font-size: .7rem; color: #B9AEA4; }
.nv-dr-auth { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.nv-dr-auth a { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: .85rem; font-size: .86rem; font-weight: 700; text-decoration: none; }
.nv-dr-auth a:first-child { background: #1C1C1C; color: #fff; }
.nv-dr-auth a:last-child { border: 1px solid var(--clr-border); color: var(--clr-text); }

.nv-dr-t { margin: 0 0 .4rem .4rem; font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #A79D94; }
.nv-dr-link, .nv-dr-group > summary {
    display: flex; align-items: center; gap: .8rem; padding: .6rem .5rem; border-radius: .8rem;
    font-size: .95rem; font-weight: 600; color: var(--clr-text); text-decoration: none; cursor: pointer;
    list-style: none; transition: background .12s;
}
.nv-dr-group > summary::-webkit-details-marker { display: none; }
.nv-dr-link:hover, .nv-dr-group > summary:hover, .nv-dr-link.is-active { background: #F7F1EB; }
.nv-dr-ico {
    width: 36px; height: 36px; flex-shrink: 0; border-radius: .7rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--clr-orange-tint); color: var(--clr-orange); font-size: .85rem;
}
.nv-dr-link > .fa-chevron-right, .nv-dr-group > summary > .fa-chevron-down { margin-left: auto; font-size: .62rem; color: #B9AEA4; transition: transform .2s; }
.nv-dr-group[open] > summary > .fa-chevron-down { transform: rotate(180deg); }
.nv-dr-sub { display: grid; gap: .1rem; padding: .2rem 0 .5rem 3.4rem; }
.nv-dr-sub a { padding: .5rem .6rem; border-radius: .6rem; font-size: .88rem; color: #4B4540; text-decoration: none; }
.nv-dr-sub a:hover { background: #F7F1EB; color: var(--clr-text); }
.nv-dr-sub a:last-child { font-weight: 700; color: var(--clr-orange); }
.nv-dr-sep { height: 1px; margin: 1rem .4rem; background: #F3ECE5; }

.nv-dr-foot { padding: 1rem; border-top: 1px solid #F3ECE5; display: grid; gap: .4rem; }
.nv-dr-foot a, .nv-dr-foot button {
    display: flex; align-items: center; gap: .7rem; width: 100%; padding: .65rem .5rem; border: 0; border-radius: .7rem;
    background: none; cursor: pointer; text-align: left; text-decoration: none;
    font-size: .88rem; font-weight: 600; color: var(--clr-text);
}
.nv-dr-foot a:hover, .nv-dr-foot button:hover { background: #F7F1EB; }
.nv-dr-foot .fa-whatsapp { color: #25D366; font-size: 1.05rem; }
.nv-dr-foot .nv-dr-salir { color: #DC2626; }

@media (prefers-reduced-motion: reduce) {
    .nv-drawer, .nv-veil, .nv-drop-menu, .nv-search { transition: none; }
}
