/* Overlay for menu */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    cursor: pointer;
}

/* Menu slide from left - Override existing styles */
.overlaymenu {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: 80% !important;
    max-width: 500px !important;
    height: 100% !important;
    min-height: 100% !important;
    background: #f3f3f3 !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    transition: left 0.3s ease-in-out !important;
    padding-top: 10px;
}

.overlaymenu.active {
    left: 0 !important;
}

/* Close button on menu overlay */
.menu-overlay-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, background 0.2s;
}

.menu-overlay-close:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.menu-overlay-close::before,
.menu-overlay-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #333;
    top: 50%;
    left: 50%;
}

.menu-overlay-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.menu-overlay-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.menu-overlay-close.active {
    display: flex;
}

/* Overlay for cart */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    cursor: pointer;
}

/* Cart slide from right - Override existing styles */
.cart-popup {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 80% !important;
    max-width: 500px !important;
    height: 100% !important;
    background: #fff !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    transition: right 0.3s ease-in-out !important;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
}

.cart-popup.active {
    right: 0 !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .cart-popup {
        width: 85% !important;
        max-width: none !important;
    }

    .overlaymenu {
        width: 80% !important;
    }
}

@media (max-width: 480px) {
    .overlaymenu {
        width: 80% !important;
        max-width: 80% !important;
    }
}

/* Ensure cart content is visible */
.cart-popup .basket {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cart-popup .basket-container {
    margin-bottom: 20px;
}

.cart-popup .cart_pop_btn_close {
    margin-top: auto;
}

/* Smooth scrolling */
.overlaymenu,
.cart-popup {
    -webkit-overflow-scrolling: touch;
}

/* Prevent body scroll when menu/cart is open */
body.bd_hidd {
    overflow: hidden !important;
}


@media (max-width: 400px) {
    .cart-popup {
        width: 100% !important;
    }
}