/**
 * WC Delivery Location - Frontend & Mini-Cart Drawer Responsive Styles
 * Overrides Florial theme's rigid drawer calculations to ensure the cart popup
 * displays properly across all mobile devices without cutting off buttons or sliders.
 */

/* 1. Mini-Cart Drawer Popup: Ensure full mobile viewport support and scrollability */
.florial-topcart.popup .mini-cart .cart-popup,
.mini-cart .cart-popup.popup,
.mini-cart .cart-popup {
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
}

/* 2. Top header: don't shrink */
.florial-topcart.popup .mini-cart .cart-popup .box-cart-top,
.florial-topcart.popup .mini-cart .cart-popup .remove-cart,
.florial-topcart.popup .mini-cart .cart-popup .top-total-cart,
.mini-cart .cart-popup.popup .box-cart-top,
.mini-cart .cart-popup.popup .top-total-cart {
    flex-shrink: 0 !important;
}

/* 3. Product list: eliminate rigid calc(100% - 320px) height and giant blank gap */
.florial-topcart.popup .mini-cart .cart-popup .cart_list,
.mini-cart .cart-popup.popup .cart_list,
.mini-cart .cart-popup .cart_list {
    height: auto !important;
    flex: 0 1 auto !important;
    max-height: calc(100dvh - 240px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 12px !important;
}

/* 4. Footer elements: Total, Free Shipping Slider, and Action Buttons */
.florial-topcart.popup .mini-cart .cart-popup .total-cart,
.florial-topcart.popup .mini-cart .cart-popup .free-ship,
.florial-topcart.popup .mini-cart .cart-popup .buttons,
.mini-cart .cart-popup.popup .total-cart,
.mini-cart .cart-popup.popup .free-ship,
.mini-cart .cart-popup.popup .buttons,
.mini-cart .cart-popup .total-cart,
.mini-cart .cart-popup .free-ship,
.mini-cart .cart-popup .buttons {
    flex-shrink: 0 !important;
    width: 100% !important;
}

/* 5. Clean up theme's excessive 30px bottom margin on the slider */
.mini-cart .cart-popup .free-ship .total-percent,
.florial-topcart.popup .mini-cart .cart-popup .free-ship .total-percent {
    margin: 8px 0 12px !important;
}

.mini-cart .cart-popup .free-ship,
.florial-topcart.popup .mini-cart .cart-popup .free-ship {
    margin-top: 10px !important;
    padding-top: 12px !important;
}

.mini-cart .cart-popup .total-cart,
.florial-topcart.popup .mini-cart .cart-popup .total-cart {
    padding-top: 12px !important;
    margin-bottom: 0 !important;
}

.mini-cart .cart-popup .buttons,
.florial-topcart.popup .mini-cart .cart-popup .buttons {
    margin-top: 10px !important;
    margin-bottom: 5px !important;
}

/* 6. Mobile Specific Refinements (max-width: 480px) */
@media (max-width: 480px) {
    .florial-topcart.popup .mini-cart .cart-popup,
    .mini-cart .cart-popup.popup,
    .mini-cart .cart-popup {
        padding: 20px 15px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .florial-topcart.popup .mini-cart .cart-popup .top-total-cart,
    .mini-cart .cart-popup .top-total-cart {
        margin-bottom: 12px !important;
        font-size: 18px !important;
    }

    .florial-topcart.popup .mini-cart .cart-popup .cart_list,
    .mini-cart .cart-popup.popup .cart_list,
    .mini-cart .cart-popup .cart_list {
        height: auto !important;
        max-height: calc(100dvh - 220px) !important;
        margin-bottom: 8px !important;
    }

    .mini-cart .cart-popup .free-ship,
    .florial-topcart.popup .mini-cart .cart-popup .free-ship {
        font-size: 13px !important;
        line-height: 1.35 !important;
        margin-top: 8px !important;
        padding-top: 8px !important;
    }

    .mini-cart .cart-popup .free-ship .title-ship,
    .florial-topcart.popup .mini-cart .cart-popup .free-ship .title-ship {
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    .mini-cart .cart-popup .free-ship .total-percent,
    .florial-topcart.popup .mini-cart .cart-popup .free-ship .total-percent {
        margin: 6px 0 10px !important;
        height: 5px !important;
    }

    .mini-cart .cart-popup .buttons,
    .florial-topcart.popup .mini-cart .cart-popup .buttons {
        margin-top: 8px !important;
        margin-bottom: 5px !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }

    .mini-cart .cart-popup .buttons .button,
    .florial-topcart.popup .mini-cart .cart-popup .buttons .button {
        padding: 10px 8px !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
        min-height: 38px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .mini-cart .cart-popup .total-cart .total-price {
        font-size: 20px !important;
    }
}
