/* Mobile-Only Cart Modal - Shared across all pages */
@media (max-width: 768px) {
    /* Hide desktop cart on mobile */
    #cartModal {
        display: none !important;
    }
    
    /* Mobile Cart Modal */
    .mobile-cart-modal {
        display: none;
        position: fixed;
        z-index: 10000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
    }
    
    .mobile-cart-modal.active {
        display: flex;
        align-items: flex-end;
    }
    
    .mobile-cart-content {
        background: white;
        width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        display: flex;
        flex-direction: column;
        animation: slideUp 0.3s ease;
        margin-top: auto;
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    /* Header */
    .mobile-cart-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.5rem;
        padding-top: calc(env(safe-area-inset-top, 0px) + 1rem);
        border-bottom: 1px solid #e9ecef;
        flex-shrink: 0;
        min-height: 70px;
    }
    
    .mobile-cart-header h2 {
        margin: 0;
        font-size: 1.5rem;
        color: var(--text-dark);
    }
    
    .mobile-cart-close {
        background: none;
        border: none;
        font-size: 2rem;
        color: #333;
        cursor: pointer;
        line-height: 1;
        padding: 0;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.2s ease;
    }
    
    .mobile-cart-close:active {
        background: #f0f0f0;
    }
    
    /* Body - Scrollable */
    .mobile-cart-body {
        flex: 1;
        overflow-y: auto;
        padding: 1rem 1.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Cart Items */
    #mobileCartItems {
        margin-bottom: 1rem;
    }
    
    .mobile-cart-item {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 1rem 0;
        border-bottom: 1px solid #e9ecef;
    }
    
    .mobile-cart-item-info {
        flex: 1;
    }
    
    .mobile-cart-item-info h4 {
        margin: 0 0 0.5rem 0;
        font-size: 1rem;
        color: var(--text-dark);
    }
    
    .mobile-cart-item-info p {
        margin: 0.25rem 0;
        font-size: 0.9rem;
        color: #6c757d;
    }
    
    .mobile-cart-item-price {
        font-size: 1rem;
        font-weight: 600;
        color: var(--primary-color);
        margin-top: 0.5rem;
    }
    
    .mobile-remove-item {
        background: #dc3545;
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 5px;
        font-size: 0.85rem;
        cursor: pointer;
        margin-left: 1rem;
    }
    
    .mobile-cart-empty {
        text-align: center;
        padding: 2rem 1rem;
        color: #6c757d;
    }
    
    /* Cart Total */
    .mobile-cart-total {
        padding: 1rem 0;
        margin: 1rem 0;
        border-top: 2px solid #e9ecef;
        border-bottom: 2px solid #e9ecef;
    }
    
    .mobile-cart-total h3 {
        margin: 0;
        font-size: 1.25rem;
        text-align: right;
        color: var(--text-dark);
    }
    
    /* Checkout Form */
    #mobileCheckoutForm {
        margin-top: 1rem;
    }
    
    .mobile-checkout-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e9ecef;
    }
    
    .mobile-checkout-header h3 {
        font-size: 1.1rem;
        margin: 0;
        color: var(--text-dark);
    }
    
    .mobile-checkout-close {
        background: none;
        border: none;
        font-size: 1.8rem;
        color: #333;
        cursor: pointer;
        line-height: 1;
        padding: 0;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.2s ease;
    }
    
    .mobile-checkout-close:active {
        background: #f0f0f0;
    }
    
    .mobile-form-group {
        margin-bottom: 1rem;
    }
    
    .mobile-form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        font-size: 0.9rem;
        color: var(--text-dark);
    }
    
    .mobile-form-group select,
    .mobile-form-group textarea {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 5px;
        font-size: 0.9rem;
        font-family: inherit;
    }
    
    .mobile-form-group small {
        display: block;
        margin-top: 0.5rem;
        color: #6c757d;
        font-size: 0.8rem;
    }
    
    .mobile-form-group textarea {
        resize: vertical;
    }
    
    /* Footer - Sticky Button */
    .mobile-cart-footer {
        padding: 1rem 1.5rem;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 3rem);
        background: white;
        border-top: 1px solid #e9ecef;
        flex-shrink: 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-checkout-btn {
        width: 100%;
        padding: 1rem;
        background: var(--secondary-color);
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.3s ease;
    }
    
    .mobile-checkout-btn:active {
        background: var(--primary-dark);
    }
    
    /* Clear Cart Button */
    .mobile-clear-cart {
        text-align: right;
        margin-bottom: 1rem;
    }
    
    .mobile-clear-cart button {
        background: #dc3545;
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 5px;
        cursor: pointer;
        font-size: 0.9rem;
    }
}

/* Desktop - Hide mobile cart */
@media (min-width: 769px) {
    .mobile-cart-modal {
        display: none !important;
    }
}
