/* Hidden on desktop and non-mobile layouts. */
.mmcn-mobile-menu-item,
.mmcn-header-cart,
.mmcn-fallback-menu-item { display: none !important; }

@media (max-width: 767px) {
    .mmcn-mobile-menu-item { display: list-item !important; }
    .mmcn-mobile-menu-item > a.mmcn-menu-cart-link,
    a.mmcn-fallback-menu-item {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 9px;
        text-decoration: none;
        color: inherit;
    }
    .mmcn-mobile-menu-item > a.mmcn-menu-cart-link {
        font: inherit;
        font-weight: inherit;
        letter-spacing: inherit;
        line-height: inherit;
        padding-inline: 6px;
    }
    .mmcn-mobile-menu-item .mmcn-cart-svg,
    .mmcn-fallback-menu-item .mmcn-cart-svg { display: block; width: 22px; height: 22px; flex: 0 0 auto; }
    .mmcn-mobile-menu-item .mmcn-cart-count,
    .mmcn-fallback-menu-item .mmcn-cart-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 21px;
        height: 21px;
        padding: 0 5px;
        box-sizing: border-box;
        border-radius: 50px;
        background: #276449;
        color: #fff;
        font: 700 11px/1 system-ui, sans-serif;
        letter-spacing: 0;
    }
    .mmcn-mobile-menu-item [hidden],
    .mmcn-fallback-menu-item [hidden],
    .mmcn-header-cart [hidden] { display: none !important; }

    /* Relative positioning makes the icon an overlay, NOT another flex item.
       Crucial for Mate's logged-in mobile header, which has limited width. */
    a.mmcn-header-cart {
        position: absolute !important;
        display: inline-flex !important;
        float: none !important;
        flex: none !important;
        left: 0;
        top: 0;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
        align-items: center;
        justify-content: center;
        border: 0 !important;
        border-radius: 8px;
        background: transparent;
        color: #253d33;
        text-decoration: none !important;
        vertical-align: middle;
        line-height: 1;
        z-index: 10;
        transform: none !important;
    }
    .mmcn-header-cart .mmcn-cart-svg { display: block; width: 23px; height: 23px; }
    .mmcn-header-cart .mmcn-cart-count {
        position: absolute;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        top: 0;
        right: -2px;
        min-width: 17px;
        height: 17px;
        padding: 0 3px;
        border-radius: 99px;
        box-sizing: border-box;
        background: #256b4b;
        color: #fff;
        font: 700 10px/1 system-ui, sans-serif;
        letter-spacing: 0;
    }
    a.mmcn-header-cart:hover,
    a.mmcn-header-cart:focus-visible { color: #238a64; background: rgba(37, 107, 75, 0.08); }
    .mmcn-fallback-menu-item { margin: 12px 0 !important; }
}

/* Standalone Mate Food App already provides cart navigation. */
@media (display-mode: standalone) {
    .mmcn-mobile-menu-item,
    .mmcn-header-cart,
    .mmcn-fallback-menu-item { display: none !important; }
}
