/* Force hide the default Storefront mobile footer */
.storefront-handheld-footer-bar {
    display: none !important;
}
/* Hide the entire system on desktop and tablets */
@media (min-width: 769px) {
    #mbn-bottom-bar, #mbn-overlay, .mbn-bottom-sheet {
        display: none !important;
    }
}

/* Mobile Styling */
@media (max-width: 768px) {
    /* Main Bottom Bar */
    #mbn-bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--mbn-bg-color, #ffffff); /* Using Dynamic Variable */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 10px 0;
        z-index: 9998;
        padding-bottom: env(safe-area-inset-bottom, 10px); /* For iPhones */
    }

    .mbn-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        text-decoration: none;
        color: var(--mbn-icon-color, #555555); /* Using Dynamic Variable */
        font-size: 11px;
        line-height: 1.2;
        flex: 1;
        -webkit-tap-highlight-color: transparent;
        padding: 0 2px;
    }

    .mbn-nav-item i {
        font-size: 20px;
        margin-bottom: 4px;
        color: var(--mbn-icon-color, #555555); /* Changed to default icon color */
        font-weight: 900 !important; 
        font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", "FontAwesome" !important; 
        font-style: normal !important;
        transition: color 0.2s ease;
    }

    /* Dark Overlay */
    #mbn-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    #mbn-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* The Sliding Bottom Sheet (Premium Styling) */
    .mbn-bottom-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--mbn-bg-color, #ffffff); /* Using Dynamic Variable */
        border-radius: 24px 24px 0 0; 
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15); 
        z-index: 10000;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); 
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }

    .mbn-bottom-sheet::before {
        content: '';
        display: block;
        width: 40px;
        height: 5px;
        background-color: #e0e0e0;
        border-radius: 3px;
        margin: 12px auto 0;
    }

    .mbn-bottom-sheet.active {
        transform: translateY(0);
    }

    .mbn-sheet-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 24px 10px;
    }

    .mbn-sheet-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        color: #111111;
    }

    .mbn-close-sheet {
        background: #f0f0f1;
        border: none;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        color: var(--mbn-icon-color, #555555); /* Using Dynamic Variable */
        cursor: pointer;
        transition: background 0.2s;
    }

    .mbn-close-sheet:active {
        background: #e0e0e0;
    }

    .mbn-sheet-links {
        list-style: none;
        margin: 0;
        padding: 0 0 15px 0;
        max-height: 55vh;
        overflow-y: auto;
    }

    .mbn-sheet-links li {
        margin: 0 12px; 
    }

    .mbn-sheet-links a {
        display: flex;
        align-items: center;
        padding: 14px 16px;
        text-decoration: none;
        color: #333333;
        font-size: 16px;
        font-weight: 500;
        border-radius: 12px;
        transition: background-color 0.2s;
    }

    .mbn-sheet-links a:active {
        background-color: #f4f6f8;
    }

    .mbn-sub-icon {
        width: 24px; 
        text-align: center;
        margin-right: 14px;
        color: var(--mbn-brand-color, #2271b1); /* Using Dynamic Variable */
        font-size: 18px;
    }
}