/* ==========================================
   MOBILE CART POPUP STYLES
   ========================================== */

/* Floating Cart Button - Mobile Only */
.mobile-cart-button,
.mobile-cart-btn,
#mobile-cart-trigger {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #F05437;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 1000;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    align-items: center;
    justify-content: center;
}

.mobile-cart-button:hover,
.mobile-cart-btn:hover,
#mobile-cart-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.15);
}

.mobile-cart-button:active,
.mobile-cart-btn:active,
#mobile-cart-trigger:active {
    transform: scale(0.95);
}

.mobile-cart-button svg,
.mobile-cart-btn i,
.mobile-cart-btn svg {
    width: 24px;
    height: 24px;
    color: white;
    font-size: 24px;
    /* For font icons */
}

/* Cart Badge Counter */
.mobile-cart-badge,
.cart-badge,
#mobile-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 24px;
    height: 24px;
    background: #FF4444;
    color: white;
    border-radius: 12px;
    border: 2px solid white;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-cart-badge.hidden,
.cart-badge.hidden,
#mobile-cart-count.hidden {
    display: none;
}

/* Pulse animation for badge */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.mobile-cart-badge.pulse,
.cart-badge.pulse,
#mobile-cart-count.pulse {
    animation: pulse 0.4s ease-in-out;
}

/* Mobile Cart Backdrop */
.mobile-cart-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-cart-backdrop.active {
    opacity: 1;
}

/* Mobile Cart Popup Container */
.mobile-cart-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 100vh;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1101;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent content overflow */
}

.mobile-cart-popup.active {
    transform: translateY(0);
}

/* Popup Header */
.mobile-cart-popup .mobile-cart-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
    /* Don't allow header to shrink */
    flex-grow: 0;
    /* Don't allow header to grow */
    background: white;
    border-radius: 20px 20px 0 0;
    position: relative;
    min-height: 60px;
    max-height: 60px;
}

.mobile-cart-popup .mobile-cart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-cart-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    padding: 0;
}

.mobile-cart-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Popup Content */
.mobile-cart-content {
    flex: 1 1 auto;
    /* Allow it to grow and shrink */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    background: #f9fafb;
    min-height: 250px !important;
    height: auto !important;
    max-height: calc(80vh - 200px) !important;
    /* Leave space for header and footer */
    display: block !important;
    visibility: visible !important;
}

/* Ensure all children of mobile-cart-content are visible */
.mobile-cart-content>*,
.mobile-cart-content>*>*,
.mobile-cart-content>*>*>*,
.mobile-cart-content * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Specifically target the ticket-sidebar and its children */
.mobile-cart-content .ticket-sidebar,
.mobile-cart-content .ticket-sidebar *,
.mobile-cart-popup .ticket-sidebar,
.mobile-cart-popup .ticket-sidebar * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}


/* Ensure sidebar elements are visible in popup */
.mobile-cart-popup .ticket-sidebar,
.mobile-cart-popup .session-box,
.mobile-cart-popup .cart-filled,
.mobile-cart-popup #ticket-cart {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Explicitly show cart-filled */
.mobile-cart-popup #cart-filled,
.mobile-cart-popup .cart-filled,
.mobile-cart-content #cart-filled,
.mobile-cart-content .cart-filled {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    min-height: auto !important;
}

/* Ticket cart container */
.mobile-cart-popup #ticket-cart {
    width: 100% !important;
    margin-bottom: 15px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 0 !important;
    background: transparent !important;
    min-height: auto !important;
}

/* Also ensure it's visible in mobile-cart-content */
.mobile-cart-content #ticket-cart {
    width: 100% !important;
    margin-bottom: 15px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 0 !important;
    background: transparent !important;
    min-height: auto !important;
}

/* Ensure ticket items are visible */
.mobile-cart-popup .ticket-item {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure ALL children of ticket-cart are visible */
.mobile-cart-popup #ticket-cart>* {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mobile-cart-content #ticket-cart>* {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure cart-filled and all children are visible */
.mobile-cart-popup #cart-filled,
.mobile-cart-popup .cart-filled {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure ticket items are visible */
.mobile-cart-popup #ticket-cart,
.mobile-cart-popup .ticket-item,
.mobile-cart-popup .ticket-info,
.mobile-cart-popup .ticket-name,
.mobile-cart-popup .ticket-price-calculation {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Match Sidebar Padding within Content Area */
.mobile-cart-popup .ticket-sidebar {
    padding: 20px !important;
    box-shadow: none !important;
}

/* Ensure ticket-sidebar inside content is visible */
.mobile-cart-popup .mobile-cart-content .ticket-sidebar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 200px !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
}

/* Hide redundant sidebar header */
.mobile-cart-content .mobile-cart-header {
    display: none !important;
}

/* Hide cart-empty in mobile popup */
.mobile-cart-popup .cart-empty,
.mobile-cart-content .cart-empty,
.mobile-cart-popup #cart-empty,
.mobile-cart-content #cart-empty {
    display: none !important;
}

/* Style Session Box in Popup - HIDE IN MOBILE */
.mobile-cart-popup .session-box,
.mobile-cart-content .session-box {
    display: none !important;
    /* Hide session box in mobile popup */
}

/* Ticket Items List Styling */
.mobile-cart-content .ticket-item,
.mobile-cart-popup .ticket-item,
.mobile-cart-popup #ticket-cart .ticket-item {
    display: block !important;
    padding: 15px 0 !important;
    border-bottom: 1px solid #eee !important;
    /*background: white !important;*/
    visibility: visible !important;
    opacity: 1 !important;
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.mobile-cart-content .ticket-info,
.mobile-cart-popup .ticket-info,
.mobile-cart-popup #ticket-cart .ticket-info {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
}

.mobile-cart-content .ticket-name,
.mobile-cart-popup .ticket-name,
.mobile-cart-popup #ticket-cart .ticket-name {
    font-weight: 600 !important;
    font-size: 15px !important;
    color: #333 !important;
    margin-bottom: 5px !important;
    display: block !important;
    line-height: 1.4 !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

.mobile-cart-content .ticket-price-calculation,
.mobile-cart-popup .ticket-price-calculation,
.mobile-cart-popup #ticket-cart .ticket-price-calculation {
    font-size: 14px !important;
    color: #F05437 !important;
    font-weight: 600 !important;
    display: block !important;
    line-height: 1.4 !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

/* Sticky Footer Summary */
.mobile-cart-footer {
    flex-shrink: 0;
    /* Don't allow footer to shrink */
    flex-grow: 0;
    /* Don't allow footer to grow */
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
    max-height: 300px;
    /* Limit footer height */
    overflow-y: auto;
    /* Allow scrolling if content is too tall */
}

.mobile-cart-footer .cart-summary {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Specific Sidebar Classes */
.mobile-cart-footer .cart-count,
.mobile-cart-footer .cart-total {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 10px !important;
    font-size: 15px;
    color: #333;
}

.mobile-cart-footer .cart-total {
    margin-top: 15px !important;
    padding-top: 15px !important;
    border-top: 1px solid #eee !important;
    font-weight: 700 !important;
    font-size: 16px;
}

.mobile-cart-footer #cart-total {
    color: #F05437;
}

/* Promo Code Input Refinement */
.mobile-cart-footer .promo-input {
    width: 100% !important;
    margin: 15px 0 !important;
    padding: 12px 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: white !important;
    box-shadow: none !important;
}

.mobile-cart-footer .promo-message {
    font-size: 12px;
    margin-bottom: 10px;
}

/* Hide debug info in popup */
.mobile-cart-popup .debug-info {
    display: none !important;
}

/* ==========================================
   CHECKOUT MOBILE POPUP – PROFESSIONAL UI
   ========================================== */

/* Header */
.mobile-cart-popup .mobile-cart-header {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f1f1;
}

.mobile-cart-popup .mobile-cart-header h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #1a1a1a;
}

/* Order summary container */
.mobile-cart-popup .mobile-checkout-summary {
    padding: 20px !important;
    background: #ffffff;
}

/* Section title */
.mobile-cart-popup .mobile-checkout-summary h4,
.mobile-cart-popup .mobile-checkout-summary h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

/* Ticket rows */
.mobile-cart-popup .checkout-ticket-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f2f2f2;
    font-size: 14px;
}

.mobile-cart-popup .checkout-ticket-row:last-child {
    border-bottom: none;
}

/* Ticket name */
.mobile-cart-popup .checkout-ticket-row div:first-child {
    font-weight: 500;
    color: #333;
}

/* Ticket price */
.mobile-cart-popup .checkout-ticket-row div:last-child {
    font-weight: 600;
    color: #111;
}

/* Summary rows */
.mobile-cart-popup .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
}

.mobile-cart-popup .summary-row span {
    color: #666;
}

.mobile-cart-popup .summary-row strong {
    font-weight: 600;
    color: #111;
}

/* Total row highlight */
.mobile-cart-popup .summary-row:last-child {
    margin-top: 12px;
    padding-top: 15px;
    border-top: 1px solid #eaeaea;
    font-size: 16px;
}

.mobile-cart-popup .summary-row:last-child strong {
    color: #F05437;
    font-weight: 700;
    font-size: 18px;
}

/* Promo input */
.mobile-cart-popup .promo-input {
    margin-top: 15px !important;
    padding: 12px 14px !important;
    border-radius: 8px !important;
    border: 1px solid #ddd !important;
    font-size: 14px !important;
}

/* Proceed button (if shown in popup) */
.mobile-cart-popup .checkout-btn {
    margin-top: 18px !important;
    padding: 14px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    background: linear-gradient(135deg, #F05437, #ff7a5c) !important;
    box-shadow: 0 6px 18px rgba(240, 84, 55, 0.25);
    transition: all 0.2s ease;
}

.mobile-cart-popup .checkout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(240, 84, 55, 0.35);
}

/* ==========================================
   FORCE SUMMARY VALUES TO RIGHT SIDE
   ========================================== */

.mobile-cart-popup .checkout-summary .summary-row,
.mobile-cart-popup .checkout-summary .cart-count,
.mobile-cart-popup .checkout-summary .cart-total {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100%;
}

/* Make label normal weight */
.mobile-cart-popup .checkout-summary .summary-row span,
.mobile-cart-popup .checkout-summary .cart-count {
    font-weight: 500;
    color: #555;
}

/* Make values bold and aligned right */
.mobile-cart-popup .checkout-summary .summary-row strong,
.mobile-cart-popup .checkout-summary .cart-count span,
.mobile-cart-popup .checkout-summary .cart-total strong {
    margin-left: auto;
    font-weight: 600;
    text-align: right;
}

/* Improve spacing */
.mobile-cart-popup .checkout-summary .summary-row {
    padding: 10px 0;
}

/* Highlight total row */
.mobile-cart-popup .checkout-summary .summary-row:last-child {
    border-top: 1px solid #eee;
    padding-top: 14px;
    margin-top: 8px;
    font-size: 16px;
}

.mobile-cart-popup .checkout-summary .summary-row:last-child strong {
    color: #F05437;
    font-weight: 700;
    font-size: 18px;
}

.stripe-wrapper {
    margin-top: 15px;
}

.stripe-input {
    padding: 14px 16px;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 14px;
    transition: border 0.2s ease;
}

.stripe-input:focus-within {
    border-color: #e94e1b;
}

.stripe-row {
    display: flex;
    gap: 15px;
}

.stripe-row .half {
    flex: 1;
}

.stripe-error {
    color: #fa755a;
    font-size: 14px;
    margin-top: 5px;
}

/* Mobile */
@media (max-width: 768px) {
    .stripe-row {
        flex-direction: column;
        gap: 14px;
    }
}



/* Hide cart sidebar on mobile by default */
@media (max-width: 768px) {

    /* Only show if visible class is added */
    .mobile-cart-button.visible,
    .mobile-cart-btn.visible,
    #mobile-cart-trigger.visible {
        display: flex;
    }

    /* Hide the sidebar by default on mobile */
    .cart-sidebar,
    #cart-sidebar,
    .ticket-cart-sidebar,
    .ticket-sidebar {
        display: none !important;
    }

    /* Show sidebar content when inside popup */
    .mobile-cart-popup .ticket-sidebar,
    .mobile-cart-popup .cart-filled,
    .mobile-cart-popup .cart-summary {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Hide debug info in popup */
    .mobile-cart-popup .debug-info {
        display: none !important;
    }

    /* Style the checkout button inside popup footer */
    /* Style the checkout button inside popup footer */
    .mobile-cart-footer .checkout-btn,
    .mobile-cart-footer #proceed-to-payment,
    .mobile-cart-popup .checkout-btn,
    .mobile-cart-popup #proceed-to-payment,
    #mobile-cart-footer .checkout-btn,
    #mobile-cart-footer #proceed-to-payment {
        display: flex !important;
        background-color: #F05437 !important;
        color: white !important;
        width: 100% !important;
        padding: 14px !important;
        border-radius: 10px !important;
        border: none !important;
        font-weight: 700 !important;
        margin-top: 15px !important;
        cursor: pointer !important;
        text-align: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 50px !important;
        font-size: 16px !important;
        pointer-events: auto !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
    }

    /* Prevent body scroll when popup is open */
    body.mobile-cart-open {
        overflow: hidden;
    }

    /* Hide checkout right summary column */
    .tix-checkout-wrapper .col-md-4 {
        display: none !important;
    }
}

/* Desktop - hide mobile cart elements */
@media (min-width: 769px) {

    .mobile-cart-button,
    #mobile-cart-trigger,
    .mobile-cart-backdrop,
    .mobile-cart-popup,
    .remove-item {
        display: none !important;
    }
}

/* Smooth scrolling for popup content */
.mobile-cart-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-cart-content::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.mobile-cart-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.mobile-cart-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Handle for dragging popup (optional visual indicator) */
.mobile-cart-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 8px auto 12px;
}