/**
 * Atope Almacén — visible mobile menu trigger + catalog drawer.
 */

@media (max-width: 921px) {
    #ast-mobile-header {
        display: block !important;
    }

    #ast-mobile-header .ast-primary-header-bar {
        background: #fff !important;
        border-bottom: 1px solid #eee;
    }

    #ast-mobile-header .ast-builder-grid-row.ast-grid-center-col-layout {
        display: grid !important;
        grid-template-columns: minmax(44px, auto) 1fr minmax(44px, auto);
        align-items: center;
        width: 100%;
        gap: 0.25rem;
    }

    #ast-mobile-header .site-header-primary-section-left {
        grid-column: 1;
        min-width: 44px;
    }

    #ast-mobile-header .site-header-primary-section-center {
        grid-column: 2;
        justify-content: center;
    }

    #ast-mobile-header .site-header-primary-section-right {
        grid-column: 3;
        display: flex !important;
        justify-content: flex-end;
        align-items: center;
        visibility: visible !important;
        opacity: 1 !important;
        min-width: 44px;
    }

    #ast-mobile-header .main-header-menu-toggle,
    #ast-mobile-header .ast-mobile-menu-trigger-outline {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        visibility: visible !important;
        opacity: 1 !important;
        color: #111 !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0;
        min-width: 44px;
        min-height: 44px;
        padding: 0.45rem;
        box-shadow: none;
        outline: none;
        z-index: 100010;
    }

    #ast-mobile-header .main-header-menu-toggle:focus,
    #ast-mobile-header .main-header-menu-toggle:focus-visible {
        outline: none;
        box-shadow: none;
    }

    #ast-mobile-header .main-header-menu-toggle .ast-mobile-svg,
    #ast-mobile-header .main-header-menu-toggle .ast-mobile-svg path {
        fill: #111 !important;
        color: #111 !important;
    }

    #ast-mobile-header .ast-button-wrap {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Transparent homepage header — keep icon readable on white bar. */
    .ast-inherit-site-logo-transparent #ast-mobile-header .main-header-menu-toggle,
    .ast-theme-transparent-header #ast-mobile-header .main-header-menu-toggle {
        color: #111 !important;
        border: none !important;
        background: transparent !important;
    }

    /* Hide desktop header row on mobile; navigation lives in the drawer. */
    #ast-desktop-header .ast-builder-menu-1,
    #ast-desktop-header .atope-header-nav-group {
        display: none !important;
    }

    /* Mobile drawer — readable menu on white panel (matches site branding). */
    #ast-mobile-popup,
    #ast-mobile-popup .ast-mobile-popup-inner,
    #ast-mobile-popup .ast-mobile-popup-content,
    .ast-mobile-popup-drawer.content-align-center .ast-mobile-popup-inner {
        background: #fff !important;
        color: #111 !important;
    }

    .ast-mobile-popup-drawer .ast-mobile-popup-header {
        background: #fff !important;
    }

    .ast-mobile-popup-drawer .menu-toggle-close {
        color: #111 !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

    .ast-mobile-popup-drawer .menu-toggle-close:focus,
    .ast-mobile-popup-drawer .menu-toggle-close:focus-visible {
        outline: none !important;
        box-shadow: none !important;
    }

    #ast-mobile-popup-drawer .ast-mobile-popup-content {
        padding: 1rem 1.25rem 2rem;
    }

    #ast-hf-mobile-menu,
    #ast-hf-mobile-menu .menu-item {
        background: transparent !important;
    }

    #ast-hf-mobile-menu .menu-link,
    #ast-hf-mobile-menu .menu-link:hover,
    #ast-hf-mobile-menu .menu-link:focus,
    #ast-hf-mobile-menu .current-menu-item > .menu-link {
        color: #ffffff !important;
        padding: 0.75rem 0;
    }

    #ast-hf-mobile-menu .atope-mobile-catalog-root > .menu-link {
        font-weight: 700;
        font-size: 1rem;
    }

    #ast-hf-mobile-menu .menu-item-has-children {
        position: relative;
    }

    #ast-hf-mobile-menu .menu-item-has-children > .sub-menu {
        display: none;
        margin: 0 0 0.35rem;
        padding: 0 0 0 0.85rem;
        border-left: 2px solid #ddd;
    }

    #ast-hf-mobile-menu .menu-item-has-children.atope-submenu-open > .sub-menu {
        display: block;
    }

    #ast-hf-mobile-menu .atope-submenu-toggle {
        position: absolute;
        top: 0.35rem;
        right: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        margin: 0;
        padding: 0;
        border: 1px solid #ddd;
        background: #fff;
        color: #111;
        font-size: 1.1rem;
        line-height: 1;
        cursor: pointer;
    }

    #ast-hf-mobile-menu .atope-submenu-toggle[aria-expanded="true"] {
        background: #111;
        color: #fff;
        border-color: #111;
    }
}
