/* 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__header-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.mobile-drawer__header-lang .lang-picker__trigger {
    width: auto;
    min-width: 4.25rem;
    min-height: 2.5rem;
    padding: 0.4rem 0.55rem;
    border-radius: 12px;
    justify-content: center;
}

.mobile-drawer__header-lang .lang-picker__label--full {
    display: none;
}

.mobile-drawer__header-lang .lang-picker__label--short {
    display: inline;
}

.mobile-drawer__header-lang .lang-picker__menu {
    right: 0;
    left: auto;
    width: min(15rem, calc(100vw - 2rem));
    z-index: 10050;
}

.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__section-label {
    margin: 0 0 0.6rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.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%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    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-icon {
    display: inline-grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    border-radius: 12px;
    background: #e9f7f1;
    color: #087a59;
}

.mobile-drawer__link-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.mobile-drawer__install {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    margin: 0.75rem 0 0.85rem;
    padding: 0.8rem;
    border: 1px solid #bee8d8;
    border-radius: 16px;
    background: linear-gradient(135deg, #f1fbf7 0%, #e8f7f1 100%);
    color: #102a23;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.mobile-drawer__install[hidden] {
    display: none !important;
}

.mobile-drawer__install-icon {
    display: inline-grid;
    place-items: center;
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 2.65rem;
    border-radius: 13px;
    background: #fff;
    color: #02a504;
    box-shadow: 0 4px 12px rgba(6, 140, 97, 0.1);
}

.mobile-drawer__install-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.mobile-drawer__install-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 0.15rem;
}

.mobile-drawer__install-copy strong {
    font-size: 0.9rem;
    line-height: 1.2;
}

.mobile-drawer__install-copy small {
    color: #527067;
    font-size: 0.72rem;
    line-height: 1.3;
}

.mobile-drawer__install-arrow {
    flex: 0 0 auto;
    color: #02a504;
}

.mobile-drawer__install-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0 0.7rem;
    flex: 0 0 auto;
    border-radius: 10px;
    background: #02a504;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.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: #02a504;
    border: 1px solid #02a504;
    box-shadow: none;
}

.mobile-drawer__btn-primary:hover,
.mobile-drawer__btn-primary:focus-visible {
    background: #02a504;
    border-color: #02a504;
    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;
    }

    .mobile-drawer {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100% !important;
        height: auto;
        max-height: min(86dvh, 46rem);
        padding: 0 0 env(safe-area-inset-bottom, 0px);
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -18px 60px rgba(15, 23, 42, 0.2);
        transform: translateY(calc(100% + 1rem));
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    html.ng-pwa-standalone .mobile-drawer {
        padding: 0 0 env(safe-area-inset-bottom, 0px);
    }

    .mobile-drawer::before {
        position: absolute;
        top: 0.5rem;
        left: 50%;
        width: 2.6rem;
        height: 0.25rem;
        border-radius: 999px;
        background: #d8e0dd;
        content: "";
        transform: translateX(-50%);
    }

    .mobile-drawer.is-open {
        transform: translateY(0);
    }

    .mobile-drawer__header {
        padding: 1.25rem 1rem 0.75rem;
    }

    .mobile-drawer__close {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 12px;
    }

    .mobile-drawer__body {
        padding: 0.9rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    .mobile-drawer__nav--primary {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
        width: 100%;
        min-width: 0;
    }

    .mobile-drawer__nav--primary .mobile-drawer__link {
        justify-content: flex-start;
        align-items: center;
        flex-direction: column;
        gap: 0.5rem;
        min-height: 5.15rem;
        padding: 0.65rem 0.3rem;
        border: 1px solid #e3ebe8;
        border-radius: 16px;
        background: #fbfdfc;
        font-size: 0.74rem;
        font-weight: 750;
        text-align: center;
        overflow: hidden;
    }

    .mobile-drawer__divider {
        margin: 0.85rem 0;
    }

    .mobile-drawer__actions {
        gap: 0.55rem;
    }

    .mobile-drawer__btn-secondary,
    .mobile-drawer__btn-primary {
        min-height: 2.85rem;
        border-radius: 13px;
    }

    .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;
    }
}

