/* Drawer móvil — overlay + panel lateral fijo */

.site-nav-shell {
    position: relative;
    z-index: 100;
    overflow: visible;
}

/* —— Toggle hamburguesa —— */
.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    border: 1px solid #e4e4e7;
    border-radius: 0.625rem;
    background: #fff;
    color: #18181b;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.mobile-nav-toggle:hover {
    background: #fafafa;
    border-color: #d4d4d8;
}

.mobile-nav-toggle:focus-visible {
    outline: 2px solid rgba(14, 143, 102, 0.4);
    outline-offset: 2px;
}

.mobile-nav-toggle svg {
    display: block;
}

/* —— Overlay —— */
.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    pointer-events: none;
}

.mobile-nav-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-backdrop[hidden] {
    display: none;
}

/* —— Drawer lateral —— */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    width: min(85vw, 360px);
    max-width: calc(100vw - 1rem);
    height: 100vh;
    height: 100dvh;
    background: #fff;
    box-shadow: -20px 0 60px rgba(15, 23, 42, 0.14);
    border-radius: 16px 0 0 16px;
    /* iPhone PWA / notch: la X y el home indicator no quedan bajo el sistema */
    padding:
        env(safe-area-inset-top, 0px)
        env(safe-area-inset-right, 0px)
        env(safe-area-inset-bottom, 0px)
        0;
    transform: translateX(100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-sizing: border-box;
}

.mobile-drawer.is-open {
    transform: translateX(0);
}

.mobile-drawer[hidden] {
    display: none;
}

.mobile-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: 0.85rem 1.1rem 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.mobile-drawer__brand {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #18181b;
}

.mobile-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    border: 1px solid #e4e4e7;
    border-radius: 0.625rem;
    background: #fff;
    color: #52525b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.mobile-drawer__close:hover,
.mobile-drawer__close:focus-visible {
    background: #f4f4f5;
    color: #18181b;
}

.mobile-drawer__close:focus-visible {
    outline: 2px solid rgba(14, 143, 102, 0.4);
    outline-offset: 2px;
}

.mobile-drawer__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 1rem 1.25rem;
    min-width: 0;
    box-sizing: border-box;
}

.mobile-drawer__nav,
.mobile-drawer__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.mobile-drawer__link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: #18181b;
    text-decoration: none;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.mobile-drawer__link:hover,
.mobile-drawer__link:focus-visible {
    background: #f4f4f5;
    color: #18181b;
}

.mobile-drawer__link--danger {
    color: #b91c1c;
}

.mobile-drawer__link--danger:hover,
.mobile-drawer__link--danger:focus-visible {
    background: #fef2f2;
    color: #991b1b;
}

.mobile-drawer__link--muted {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    justify-content: center;
}

.mobile-drawer__link--muted:hover,
.mobile-drawer__link--muted:focus-visible {
    background: #f8fafc;
    color: #334155;
}

.mobile-drawer__divider {
    height: 1px;
    margin: 0.875rem 0;
    background: #e4e4e7;
}

.mobile-drawer__lang-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.mobile-drawer__lang .lang-picker {
    width: 100%;
}

.mobile-drawer__lang .lang-picker__wrap {
    display: block;
    width: 100%;
}

.mobile-drawer__lang .lang-picker__trigger {
    width: 100%;
    min-height: 2.75rem;
    justify-content: flex-start;
    border-radius: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
}

.mobile-drawer__lang .lang-picker__label--full {
    max-width: none;
}

.mobile-drawer__lang .lang-picker__menu {
    z-index: 10050;
    left: 0;
    right: auto;
    width: 100%;
    max-height: 12rem;
    overflow-y: auto;
}

.mobile-drawer__btn-secondary,
.mobile-drawer__btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 2.5rem;
    height: auto;
    margin: 0;
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mobile-drawer__btn-secondary {
    color: #18181b;
    background: #fff;
    border: 1px solid #e4e4e7;
}

.mobile-drawer__btn-secondary:hover,
.mobile-drawer__btn-secondary:focus-visible {
    background: #f4f4f5;
    border-color: #d4d4d8;
    color: #18181b;
}

.mobile-drawer__btn-primary {
    color: #fff;
    background: #068C61;
    border: 1px solid #068C61;
    box-shadow: none;
}

.mobile-drawer__btn-primary:hover,
.mobile-drawer__btn-primary:focus-visible {
    background: #056947;
    border-color: #056947;
    color: #fff;
}

.mobile-drawer__logout-form {
    margin: 0;
}

.mobile-drawer__store-switch {
    margin-bottom: 0.25rem;
}

.mobile-drawer__store-select {
    width: 100%;
    min-height: 2.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.625rem;
    background: #fff;
    color: #18181b;
}

body.mobile-nav-open {
    overflow: hidden;
}

/* —— Mobile navbar bar —— */
@media (max-width: 1023px) {
    .desktop-nav,
    .desktop-actions {
        display: none !important;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        grid-area: actions;
        justify-self: end;
    }

    .public-nav {
        background: #fff !important;
        backdrop-filter: none !important;
        /* Bajo el status bar / Dynamic Island el menú debe quedar usable */
        padding-top: env(safe-area-inset-top, 0px);
    }

    html.ng-pwa-standalone body:not(.is-map-app-shell) .public-nav {
        padding-top: 0;
    }

    .public-nav-bar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "logo actions";
        row-gap: 0;
        min-height: 3.5rem;
        max-height: none;
    }

    .public-nav-inner {
        padding-top: 0.375rem;
        padding-bottom: 0.375rem;
    }

    .public-nav-logo {
        font-size: 1.0625rem;
    }

    .seller-private-nav {
        background: #fff !important;
        backdrop-filter: none !important;
    }

    .seller-private-nav__inner {
        min-height: 3.5rem;
        max-height: none;
        padding-top: env(safe-area-inset-top, 0px);
    }

    .seller-private-nav__right.desktop-actions {
        display: none !important;
    }

    .seller-private-nav__inner .mobile-nav-toggle {
        margin-left: auto;
    }
}

@media (min-width: 1024px) {
    .mobile-nav-toggle,
    .mobile-nav-backdrop,
    .mobile-drawer {
        display: none !important;
    }
}

@media (min-width: 1024px) and (max-width: 1023px) {
    .public-nav-bar {
        grid-template-columns: 1fr auto 1fr;
        grid-template-areas: "logo nav actions";
        column-gap: 1rem;
        row-gap: 0;
        min-height: 3.75rem;
    }

    .public-nav-center {
        justify-self: center;
        justify-content: center;
        overflow: visible;
        padding-bottom: 0;
        mask-image: none;
    }
}
