.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    /* Default to off-screen */
    width: 100%;
    max-width: 450px;
    height: 100%;
    background: var(--color-bg);
    border-left: 1px solid var(--color-border);
    z-index: 2001;
    transition: right 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 1.5rem var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.cart-header h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    font-weight: 200;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.cart-item {
    display: flex;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid #f9f9f9;
    padding-bottom: var(--spacing-sm);
}

.cart-item img {
    width: 70px;
    height: 52px;
    /* 4:3 ratio */
    object-fit: cover;
    margin-right: 1rem;
    background: #f4f4f4;
}

.cart-item-info {
    flex: 1;
}

.cart-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.cart-variant {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
    display: block;
}

.cart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid #f0f0f0;
    padding: 2px 8px;
}

.qty-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-text-light);
}

.remove-btn {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    background: none;
    color: #ff4444;
    margin-top: 8px;
    padding: 0;
}

.cart-footer {
    padding: var(--spacing-md);
    background: #F9F9F9;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

@media (max-width: 450px) {
    .cart-sidebar {
        max-width: 100%;
    }
}

.cart-empty {
    text-align: center;
    padding: 4rem 1rem;
}

.cart-empty-text {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.cart-item-price {
    font-weight: 600;
    font-size: 0.9rem;
}

.qty-btn.minus {
    padding-bottom: 2px;
}

.qty-btn.plus {
    padding-top: 2px;
}

.qty-display {
    font-size: 0.8rem;
}

#checkoutBtn {
    width: 100%;
    text-align: center;
}

/* Descuento Combo */
.cart-combo-discount {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    color: #7FC3A3;
    /* Verde Agua de la paleta */
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.cart-combo-discount .discount-amount {
    font-weight: 600;
}

/* Stock Error in Cart */
.cart-item-error {
    display: none;
    color: #e87a6a;
    /* Coral/Terracota */
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 5px;
    text-align: left;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.cart-item-error.show {
    display: block;
}

.qty-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: #ccc;
    pointer-events: none; /* Ensure no click events if disabled class is present */
}