/* Cart Drawer Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Cart Drawer Panel */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: #111111 !important;
    color: #f7da45 !important;
    border-left: 1px solid #222222;
    z-index: 10002;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    visibility: hidden;
    pointer-events: none;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.cart-drawer.active {
    right: 0;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 480px) {
    .cart-drawer {
        max-width: 100%;
        right: -100%;
    }
}

/* Cart Header */
.cart-header {
    padding: 24px;
    border-bottom: 1px solid #222222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #111111 !important;
}

.cart-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #f7da45 !important;
}

.cart-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #f7da45 !important;
    padding: 4px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cart-close-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Cart Items Container */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: #111111 !important;
}

/* Cart Item Card */
.cart-item {
    display: flex;
    gap: 16px;
    border-bottom: 1px solid #222222;
    padding-bottom: 20px;
}

.cart-item-img {
    width: 75px;
    height: 100px;
    aspect-ratio: 3 / 4 !important;
    border-radius: 10px;
    background-color: #181818;
    border: 1px solid #222222;
    object-fit: cover !important;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}

.cart-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: #f7da45 !important;
    margin-bottom: 4px;
}

.cart-item-meta {
    font-size: 0.8rem;
    color: rgba(247, 218, 69, 0.7);
    margin-bottom: 8px;
}

.cart-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #333333;
    background-color: #181818;
    border-radius: 20px;
    overflow: hidden;
}

.qty-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #f7da45 !important;
    transition: background-color 0.2s ease;
}

.qty-btn:hover {
    background-color: #222222;
}

.qty-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f7da45 !important;
    padding: 0 4px;
}

.cart-item-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f7da45 !important;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ff453a;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0;
    margin-top: 4px;
    align-self: flex-start;
    transition: opacity 0.2s ease;
}

.cart-item-remove:hover {
    opacity: 0.8;
}

/* Empty Cart State */
.cart-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 240px;
    color: #f7da45 !important;
    gap: 14px;
    text-align: center;
    background-color: #111111 !important;
}

.cart-empty p {
    font-size: 0.95rem;
    color: rgba(247, 218, 69, 0.75);
    margin: 0;
}

/* Cart Footer */
.cart-footer {
    padding: 24px;
    border-top: 1px solid #222222;
    background-color: #111111 !important;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: #f7da45;
    margin-bottom: 12px;
}

.cart-summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f7da45;
    margin-bottom: 20px;
}

.checkout-action-btn {
    width: 100%;
    background-color: #00b512 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: none;
    padding: 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1.15rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.checkout-action-btn:hover {
    background-color: #009e0f !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.checkout-action-btn:active {
    transform: scale(0.98);
}

/* Header Cart Badge */
.cart-icon-wrapper {
    position: relative;
    cursor: pointer;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #f7da45;
    color: #000000;
    font-size: 0.75rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-badge.active {
    opacity: 1;
    transform: scale(1);
}

/* Order Bump Container */
.order-bump-container {
    border: 1px dashed #f7da45;
    background-color: #181818;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.order-bump-container:hover {
    background-color: #222222;
}

.order-bump-checkbox {
    accent-color: #f7da45;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.order-bump-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.order-bump-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f7da45;
}

.order-bump-price {
    font-size: 0.8rem;
    color: rgba(247, 218, 69, 0.8);
    margin-top: 2px;
}

/* ═══════════════════════════════════════
   MOBILE OPTIMIZATION — cart.css
   ═══════════════════════════════════════ */

/* Safe area for iPhones with notch/Dynamic Island */
.cart-footer {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

@media (max-width: 480px) {

    /* Bigger touch targets */
    .qty-btn {
        padding: 8px 14px;
        min-height: 44px;
    }

    .cart-item-remove {
        font-size: 0.85rem;
        padding: 4px 0;
        min-height: 32px;
    }

    .checkout-action-btn {
        padding: 18px;
        font-size: 1.05rem;
        border-radius: 8px;
    }

    .cart-header {
        padding: 16px;
    }

    .cart-items {
        padding: 16px;
        gap: 16px;
    }

    .cart-footer {
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .order-bump-container {
        padding: 14px;
    }

    /* Easier tap on item image area */
    .cart-item-img {
        width: 66px;
        height: 88px;
        aspect-ratio: 3 / 4 !important;
    }
}