/* ==============================================
   Mobile Floating Cart - Bottom Bar & Bottom Sheet
   Only applies on screens <= 768px
   ============================================== */

@media (max-width: 768px) {

    /* ----------------------------------------
       1. Trigger bar: full-width fixed bottom
       ---------------------------------------- */
    .tbvs-floating-cart-trigger {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9998;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        padding: 12px 16px;
        background: #fff;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.12);
        border-radius: 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Show trigger only when cart has items */
    .tbvs-floating-cart-trigger.has-items {
        transform: translateY(0);
    }

    /* ----------------------------------------
       2. Toggle button: compact, left side
       ---------------------------------------- */
    .tbvs-floating-cart-toggle {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
        box-shadow: none;
        flex-shrink: 0;
    }

    .tbvs-floating-cart-toggle:hover {
        transform: none;
        box-shadow: none;
    }

    .tbvs-cart-icon svg {
        width: 22px;
        height: 22px;
    }

    /* Badge repositioned for bar layout */
    .tbvs-cart-badge {
        top: -6px;
        right: -6px;
        min-width: 20px;
        height: 20px;
        font-size: 10px;
        border-radius: 10px;
    }

    /* ----------------------------------------
       3. Mini total: center area with label
       ---------------------------------------- */
    .tbvs-cart-mini-total {
        flex: 1;
        display: flex;
        align-items: flex-start;
        flex-wrap: wrap;
        background: none;
        box-shadow: none;
        padding: 0 15px;
        border-radius: 0;
        gap: 4px;
    }

    .tbvs-cart-mini-total::before {
        content: 'До сплати';
        font-size: 12px;
        color: #888;
        font-weight: 400;
        line-height: 1.2;
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;   
    }

    .tbvs-mini-total-price {
        font-size: 18px;
        font-weight: 700;
        color: #222;
    }

    .tbvs-mini-total-currency {
        font-size: 14px;
        font-weight: 600;
        color: #444;
    }

    /* ----------------------------------------
       4. Mobile cart open button in trigger bar
       ---------------------------------------- */
    .tbvs-mobile-cart-open-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 12px 24px;
        background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
        color: #fff;
        border: none;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
        flex-shrink: 0;
        transition: background 0.2s ease;
    }

    .tbvs-mobile-cart-open-btn:active {
        background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    }

    /* ----------------------------------------
       5. Cart panel: bottom sheet (slide up)
       ---------------------------------------- */
    .tbvs-floating-cart-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: auto;
        max-height: 75vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .tbvs-floating-cart-panel.open {
        right: 0;
        transform: translateY(0);
    }

    /* ----------------------------------------
       6. Panel header: rounded top + drag handle
       ---------------------------------------- */
    .tbvs-floating-cart-header {
        padding: 16px 20px;
        border-radius: 16px 16px 0 0;
        position: relative;
    }

    .tbvs-floating-cart-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
    }

    .tbvs-floating-cart-header h4 {
        font-size: 16px;
    }

    /* ----------------------------------------
       7. Panel body: scrollable, limited height
       ---------------------------------------- */
    .tbvs-floating-cart-body {
        max-height: calc(75vh - 150px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ----------------------------------------
       8. Panel footer: compact
       ---------------------------------------- */
    .tbvs-floating-cart-footer {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .tbvs-cart-subtotal {
        margin-bottom: 12px;
    }

    .tbvs-floating-checkout-btn {
        padding: 14px 20px;
        border-radius: 12px;
        font-size: 15px;
    }

    /* ----------------------------------------
       9. Overlay: adjusted for bottom sheet
       ---------------------------------------- */
    .tbvs-floating-cart-overlay.open {
        z-index: 9997;
    }

    /* ----------------------------------------
       10. Safe area padding for bottom bar
       ---------------------------------------- */
    .tbvs-floating-cart-trigger {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    /* Cart items adjustments */
    .tbvs-cart-item {
        padding: 12px 16px;
        gap: 12px;
    }

    .tbvs-cart-item-image {
        width: 52px;
        height: 52px;
    }

    .tbvs-cart-item-name {
        font-size: 13px;
    }

    .tbvs-simple-map-container .tbvs-simple-place-image{
        max-width: 80px;
        width: 80px;
        display: flex;
        flex: 0 0 80px;  
        padding-top: 25px;
    }
    .tbvs-simple-map-container .tbvs-simple-place-image img{
        max-width: 80px;
        width: 80px;
        height: 80px;
        display: inline-flex;
    }
    .tbvs-simple-map-container .tbvs-simple-place-info{
        max-width: calc(100% - 105px);
        width: calc(100% - 105px)!important;
        padding-top: 25px;
    }
    .tbvs-seatmap-container .tbvs-simple-map-container .tbvs-simple-place{
        flex-wrap: wrap;
    }
    .tbvs-seatmap-container .tbvs-mobile-buy-controls{
        flex: 0 0 100%;
        max-width: 100%;
    }
    .tbvs-seatmap-container .tbvs-sidebar{
        display: none;
    }

    .tbvs-reservation-timer{
        max-width: 300px;
        right: 15px;
        left: auto;
    }
    .tbvs-seatmap-container .tbvs-simple-map-container .tbvs-simple-place .tbvs-simple-place-status{
        top: 10px;
        bottom: auto;
    }
    .tbvs-mobile-qty-controls{
        background: transparent;
    }
}
