/**
 * CART MOBILE IMPROVEMENTS
 * ========================
 * Enhanced mobile design for shopping cart section
 * MOBILE ONLY - No desktop changes
 */

/* Apply all improvements ONLY on mobile (max-width: 768px) */
@media (max-width: 768px) {

    /* ============================================
       CART ROOT CONTAINER - Better Spacing
       ============================================ */

    #cart-root {
        padding: 16px 12px;
        margin-top: 20px;
    }

    /* ============================================
       CART CONTAINER - Modern Card Design
       ============================================ */

    .cart-container {
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        background: #ffffff;
    }

    /* ============================================
       CART HEADER - Improved Layout & Styling
       ============================================ */

    .cart-header {
        padding: 20px 16px;
        background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
        border-bottom: 2px solid #e5e7eb;
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
    }

    .cart-header h2 {
        font-size: 22px;
        font-weight: 800;
        color: #111827;
        margin: 0;
        text-align: center;
        background: linear-gradient(135deg, #7c3aed, #a855f7);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* ============================================
       CLEAR CART BUTTON - Enhanced Design
       ============================================ */

    .cart-clear {
        width: 100%;
        padding: 12px 20px;
        background: linear-gradient(135deg, #ef4444, #dc2626);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .cart-clear:active {
        transform: scale(0.97);
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    }

    .cart-clear i {
        font-size: 16px;
    }

    /* ============================================
       CART ITEMS CONTAINER - Better Spacing
       ============================================ */

    .cart-items {
        padding: 12px;
        background: #fafafa;
    }

    /* ============================================
       CART ITEM CARD - Modern Design
       ============================================ */

    .cart-item {
        background: white;
        border-radius: 16px;
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
        border: 1px solid #f0f0f0;
        position: relative;
        grid-template-columns: 70px 1fr;
        gap: 14px;
        transition: all 0.3s ease;
    }

    .cart-item:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

    .cart-item:last-child {
        margin-bottom: 0;
    }

    /* ============================================
       CART ITEM IMAGE - Enhanced Style
       ============================================ */

    .cart-item-image {
        width: 70px;
        height: 70px;
        border-radius: 12px;
        overflow: hidden;
        background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
        border: 2px solid #e5e7eb;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .cart-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .cart-item-placeholder {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #9ca3af;
        font-size: 28px;
    }

    /* ============================================
       CART ITEM INFO - Better Typography
       ============================================ */

    .cart-item-info {
        grid-column: 2;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .cart-item-title {
        font-size: 16px;
        font-weight: 700;
        color: #111827;
        margin: 0;
        line-height: 1.4;
        letter-spacing: -0.2px;
    }

    .cart-item-meta {
        font-size: 13px;
        color: #7c3aed;
        font-weight: 600;
        margin: 0;
        background: #f3e8ff;
        padding: 4px 10px;
        border-radius: 8px;
        display: inline-block;
        width: fit-content;
    }

    /* ============================================
       QUANTITY CONTROLS - Modern Design
       ============================================ */

    .cart-item-qty {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        background: linear-gradient(135deg, #f9fafb, #f3f4f6);
        padding: 10px;
        border-radius: 14px;
        margin-top: 8px;
        border: 1px solid #e5e7eb;
    }

    .qty-btn {
        width: 40px;
        height: 40px;
        border: none;
        background: linear-gradient(135deg, #ffffff, #f9fafb);
        color: #374151;
        font-size: 20px;
        font-weight: 700;
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 1px solid #e5e7eb;
    }

    .qty-btn:active {
        transform: scale(0.92);
        background: linear-gradient(135deg, #7c3aed, #a855f7);
        color: white;
        border-color: #7c3aed;
        box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
    }

    .qty-input {
        width: 60px;
        height: 40px;
        text-align: center;
        border: 2px solid #e5e7eb;
        border-radius: 10px;
        font-size: 16px;
        font-weight: 700;
        color: #111827;
        background: white;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
    }

    .qty-input:focus {
        outline: none;
        border-color: #7c3aed;
        box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15),
                    inset 0 2px 4px rgba(0, 0, 0, 0.04);
    }

    /* ============================================
       PRICE SECTION - Better Layout
       ============================================ */

    .cart-item-price {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 8px;
        padding: 12px;
        background: linear-gradient(135deg, #f3e8ff, #faf5ff);
        border-radius: 12px;
        border: 1px solid #e9d5ff;
    }

    .item-unit-price {
        font-size: 20px;
        font-weight: 800;
        background: linear-gradient(135deg, #7c3aed, #a855f7);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        letter-spacing: -0.5px;
    }

    .item-subtotal {
        font-size: 14px;
        color: #6b21a8;
        font-weight: 700;
        background: white;
        padding: 6px 12px;
        border-radius: 8px;
        border: 1px solid #e9d5ff;
    }

    .item-subtotal::before {
        content: 'Subtotal: ';
        font-weight: 600;
        color: #9333ea;
    }

    /* ============================================
       REMOVE BUTTON - Enhanced Design
       ============================================ */

    .cart-item-remove {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        border: none;
        background: linear-gradient(135deg, #fee2e2, #fecaca);
        color: #dc2626;
        font-size: 16px;
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
        border: 1px solid #fecaca;
    }

    .cart-item-remove:active {
        transform: scale(0.92);
        background: linear-gradient(135deg, #dc2626, #b91c1c);
        color: white;
        border-color: #dc2626;
        box-shadow: 0 2px 12px rgba(220, 38, 38, 0.3);
    }

    .cart-item-remove i {
        font-size: 15px;
    }

    /* ============================================
       CART FOOTER - Modern Summary Design
       ============================================ */

    .cart-footer {
        padding: 20px 16px;
        border-top: 2px solid #e5e7eb;
        background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* ============================================
       TOTAL SECTION - Enhanced Display
       ============================================ */

    .cart-total {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 16px;
        background: linear-gradient(135deg, #f3e8ff, #faf5ff);
        border-radius: 14px;
        border: 2px solid #e9d5ff;
        box-shadow: 0 2px 12px rgba(124, 58, 237, 0.1);
    }

    .total-label {
        font-size: 16px;
        color: #6b21a8;
        font-weight: 700;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }

    .total-amount {
        font-size: 28px;
        font-weight: 900;
        background: linear-gradient(135deg, #7c3aed, #a855f7, #c084fc);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        line-height: 1;
        letter-spacing: -1px;
    }

    /* ============================================
       CHECKOUT BUTTON - Premium Design
       ============================================ */

    .btn-checkout {
        width: 100%;
        padding: 18px 24px;
        background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
        color: white;
        border: none;
        border-radius: 14px;
        font-size: 17px;
        font-weight: 800;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4),
                    0 2px 8px rgba(124, 58, 237, 0.2);
        position: relative;
        overflow: hidden;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }

    .btn-checkout::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .btn-checkout:active::before {
        left: 100%;
    }

    .btn-checkout:active {
        transform: scale(0.97);
        box-shadow: 0 3px 12px rgba(124, 58, 237, 0.5);
    }

    .btn-checkout i {
        font-size: 18px;
        transition: transform 0.3s ease;
    }

    .btn-checkout:active i {
        transform: translateX(4px);
    }

    /* ============================================
       EMPTY CART STATE - Better Design
       ============================================ */

    .cart-empty {
        text-align: center;
        padding: 60px 24px;
        display: flex;
        flex-direction: column;
        align-items: center;
        background: linear-gradient(135deg, #f9fafb, #ffffff);
        border-radius: 16px;
        margin: 12px;
    }

    .cart-empty i {
        font-size: 80px !important;
        color: #d1d5db !important;
        margin-bottom: 20px !important;
        opacity: 0.7;
    }

    .cart-empty h2 {
        color: #374151 !important;
        font-size: 22px !important;
        font-weight: 800 !important;
        margin-bottom: 12px !important;
    }

    .cart-empty p {
        color: #6b7280 !important;
        font-size: 15px !important;
        margin-bottom: 28px !important;
    }

    .cart-empty .btn-primary {
        padding: 14px 32px !important;
        background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
        color: white !important;
        text-decoration: none !important;
        border-radius: 12px !important;
        font-weight: 700 !important;
        font-size: 16px !important;
        box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3) !important;
        transition: all 0.3s ease !important;
    }

    .cart-empty .btn-primary:active {
        transform: scale(0.97) !important;
    }
}
