/* ==========================================================================
   M'Burger - Cart Page Styles
   Uses design tokens from variables.css
   ========================================================================== */

.mb-cart {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--mb-space-xl) var(--mb-space-md) var(--mb-space-4xl);
    font-family: var(--mb-font-body, 'Inter', -apple-system, sans-serif);
}

.mb-cart__header {
    display: flex;
    align-items: baseline;
    gap: var(--mb-space-md);
    margin-bottom: var(--mb-space-xl);
    padding-bottom: var(--mb-space-md);
    border-bottom: 2px solid var(--mb-cream-dark, #e8e0d4);
}

.mb-cart__title {
    font-family: var(--mb-font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: var(--mb-text-3xl, clamp(1.8rem, 3vw, 2.5rem));
    font-weight: var(--mb-weight-medium, 500);
    color: var(--mb-dark, #1a1614);
    margin: 0;
}

.mb-cart__count {
    font-size: var(--mb-text-base, 0.95rem);
    color: var(--mb-brown, #8b7355);
}

/* Empty cart */
.mb-cart__empty {
    text-align: center;
    padding: var(--mb-space-4xl) var(--mb-space-md);
    color: var(--mb-brown, #8b7355);
}

.mb-cart__empty svg {
    color: var(--mb-accent, #c8a090);
    margin-bottom: var(--mb-space-md);
}

.mb-cart__empty p {
    font-size: var(--mb-text-lg, 1.1rem);
    margin-bottom: var(--mb-space-lg);
}

/* Cart items */
.mb-cart__items {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--mb-cream-dark, #e8e0d4);
    border-radius: var(--mb-radius-lg, 12px);
    overflow: hidden;
    margin-bottom: var(--mb-space-lg);
}

.mb-cart__item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: var(--mb-space-md);
    align-items: center;
    padding: var(--mb-space-md);
    background: var(--mb-white, #ffffff);
}

.mb-cart__item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--mb-radius-md, 8px);
    overflow: hidden;
}

.mb-cart__item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mb-cart__item-name a {
    font-weight: var(--mb-weight-semibold, 600);
    color: var(--mb-dark, #1a1614);
    text-decoration: none;
    font-size: var(--mb-text-base, 1rem);
}

.mb-cart__item-name a:hover {
    color: var(--mb-brown, #8b7355);
}

.mb-cart__item-supplements {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.mb-cart__supplement {
    font-size: var(--mb-text-xs, 0.8rem);
    color: var(--mb-brown, #8b7355);
    background: var(--mb-cream, #faf8f5);
    padding: 2px 8px;
    border-radius: var(--mb-radius-sm, 4px);
}

.mb-cart__item-price {
    font-size: var(--mb-text-sm, 0.9rem);
    color: var(--mb-brown, #8b7355);
    margin-top: 4px;
}

.mb-cart__item-quantity .quantity input {
    width: 60px;
    text-align: center;
    padding: 8px;
    border: 1px solid var(--mb-cream-dark, #e8e0d4);
    border-radius: 6px;
    font-family: inherit;
    font-size: var(--mb-text-base, 0.95rem);
}

.mb-cart__item-subtotal {
    font-weight: var(--mb-weight-semibold, 600);
    color: var(--mb-dark, #1a1614);
    font-size: var(--mb-text-base, 1rem);
    white-space: nowrap;
}

.mb-cart__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--mb-cream, #faf8f5);
    color: var(--mb-brown, #8b7355);
    text-decoration: none;
    font-size: 18px;
    transition: all var(--mb-transition-normal, 0.2s);
}

.mb-cart__remove:hover {
    background: #d9534f;
    color: #fff;
}

/* Actions */
.mb-cart__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--mb-space-sm);
    margin-bottom: var(--mb-space-xl);
}

/* Sidebar totals */
.mb-cart__sidebar {
    margin-top: var(--mb-space-md);
}

.mb-cart__totals .cart_totals {
    background: var(--mb-white, #ffffff);
    border: 1px solid var(--mb-cream-dark, #e8e0d4);
    border-radius: var(--mb-radius-lg, 12px);
    padding: var(--mb-space-lg);
    max-width: 450px;
    margin-left: auto;
}

.mb-cart__totals .cart_totals h2 {
    font-family: var(--mb-font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: var(--mb-text-xl, 1.4rem);
    color: var(--mb-dark, #1a1614);
    margin: 0 0 var(--mb-space-md);
    padding-bottom: var(--mb-space-sm);
    border-bottom: 2px solid var(--mb-accent, #c8a090);
}

.mb-cart__totals .cart_totals table th {
    font-weight: var(--mb-weight-medium, 500);
    color: var(--mb-brown, #8b7355);
    padding: 12px 0;
}

.mb-cart__totals .cart_totals table td {
    text-align: right;
    padding: 12px 0;
    color: var(--mb-dark, #1a1614);
}

.mb-cart__totals .cart_totals .order-total th,
.mb-cart__totals .cart_totals .order-total td {
    font-size: var(--mb-text-lg, 1.2rem);
    font-weight: var(--mb-weight-bold, 700);
    border-top: 2px solid var(--mb-cream-dark, #e8e0d4);
    padding-top: var(--mb-space-md);
}

.mb-cart__totals .wc-proceed-to-checkout a.checkout-button {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--mb-accent-light, #ddc0b4), var(--mb-accent, #c8a090));
    color: var(--mb-text-dark, #2e2c2a);
    text-align: center;
    font-family: var(--mb-font-body, 'Inter', sans-serif);
    font-size: var(--mb-text-sm, 0.9rem);
    font-weight: var(--mb-weight-semibold, 600);
    text-transform: uppercase;
    letter-spacing: var(--mb-tracking-wider, 0.1em);
    border-radius: var(--mb-radius-full, 100px);
    text-decoration: none;
    transition: all var(--mb-transition-normal, 0.2s);
    margin-top: var(--mb-space-md);
}

.mb-cart__totals .wc-proceed-to-checkout a.checkout-button:hover {
    background: linear-gradient(135deg, var(--mb-accent, #c8a090), var(--mb-accent-dark, #a8806e));
}

/* Update cart button */
.mb-cart .mb-btn--secondary[name="update_cart"],
.mb-cart button[name="update_cart"] {
    color: var(--mb-dark, #1a1614);
    border-color: var(--mb-cream-dark, #e8e0d4);
}

.mb-cart .mb-btn--secondary[name="update_cart"]:hover,
.mb-cart button[name="update_cart"]:hover {
    background: var(--mb-dark, #1a1614);
    color: var(--mb-cream, #faf8f5);
    border-color: var(--mb-dark, #1a1614);
}

/* Responsive */
@media (max-width: 768px) {
    .mb-cart__item {
        grid-template-columns: 60px 1fr;
        gap: var(--mb-space-sm);
    }

    .mb-cart__item-quantity,
    .mb-cart__item-subtotal,
    .mb-cart__item-remove {
        grid-column: 2;
    }

    .mb-cart__actions {
        flex-direction: column;
    }

    .mb-cart__totals .cart_totals {
        max-width: 100%;
    }
}
