/* ─── Cart Page ───────────────────────────────────────────── */
.jj-cart {
    padding: var(--space-2xl) 0 var(--space-section);
}

.jj-cart__empty {
    padding: var(--space-3xl) 0;
}

.jj-cart__layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-2xl);
    align-items: start;
    margin-top: var(--space-xl);
}

/* Cart Items */
.jj-cart__item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: var(--space-lg);
    align-items: center;
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--jj-rose-light);
}

.jj-cart__item-img {
    width: 80px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.jj-cart__item-name {
    font-size: var(--text-base);
    font-family: var(--font-heading);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.jj-cart__item-name a {
    color: var(--jj-charcoal);
    text-decoration: none;
}
.jj-cart__item-name a:hover {
    color: var(--jj-mauve-dark);
}

.jj-cart__item-price {
    font-size: var(--text-sm);
    color: var(--jj-charcoal-light);
    margin-top: var(--space-xs);
}

.jj-cart__item-subtotal {
    font-weight: 500;
    white-space: nowrap;
}

.jj-cart__item-remove a {
    color: var(--jj-charcoal-lighter);
    font-size: 1.4rem;
    text-decoration: none;
    transition: color var(--duration-fast);
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-circle);
}
.jj-cart__item-remove a:hover {
    color: var(--jj-error);
    background: var(--jj-error-light);
}

/* Quantity Selector */
.jj-qty {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--jj-rose-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.jj-qty__btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--jj-charcoal);
    transition: background var(--duration-fast);
    cursor: pointer;
    background: none;
    border: none;
}
.jj-qty__btn:hover {
    background: var(--jj-rose-lighter);
}

.jj-qty__input,
.jj-qty input[type="number"] {
    width: 44px;
    height: 44px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--jj-rose-light);
    border-right: 1px solid var(--jj-rose-light);
    font-size: var(--text-sm);
    font-weight: 500;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
}
.jj-qty input::-webkit-outer-spin-button,
.jj-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* Cart Actions */
.jj-cart__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) 0;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.jj-cart__coupon {
    display: flex;
    gap: var(--space-sm);
}

.jj-cart__coupon .jj-input {
    width: 200px;
    padding: 10px 16px;
}

/* Cart Totals */
.jj-cart__totals {
    position: sticky;
    top: calc(var(--header-height) + var(--space-xl));
}

.jj-cart__totals-card {
    background: var(--jj-white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.jj-cart__totals-card h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--jj-rose-light);
}

.jj-cart__total-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    font-size: var(--text-sm);
    color: var(--jj-charcoal-light);
}

.jj-cart__total-row--total {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--jj-charcoal);
    border-top: 1.5px solid var(--jj-rose);
    padding-top: var(--space-md);
    margin-top: var(--space-md);
}

.jj-cart__checkout {
    margin-top: var(--space-xl);
}

.jj-cart__continue {
    display: block;
    text-align: center;
    margin-top: var(--space-md);
    font-size: var(--text-sm);
    color: var(--jj-mauve-dark);
}

/* Shipping section in totals */
.jj-cart__shipping .woocommerce-shipping-methods {
    list-style: none;
    padding: 0;
}

.jj-cart__shipping .woocommerce-shipping-methods li {
    padding: var(--space-xs) 0;
    font-size: var(--text-sm);
}

/* Responsive */
@media (max-width: 1024px) {
    .jj-cart__layout {
        grid-template-columns: 1fr;
    }
    .jj-cart__totals {
        position: static;
    }
}

@media (max-width: 768px) {
    .jj-cart__item {
        grid-template-columns: 70px 1fr;
        grid-template-rows: auto auto;
        gap: var(--space-md);
    }
    .jj-cart__item-img {
        width: 70px;
        height: 88px;
        grid-row: 1 / 3;
    }
    .jj-cart__item-qty,
    .jj-cart__item-subtotal {
        grid-column: 2;
    }
    .jj-cart__item-remove {
        position: absolute;
        right: 0;
        top: var(--space-md);
    }
    .jj-cart__item {
        position: relative;
    }
    .jj-cart__coupon .jj-input {
        width: 140px;
    }
}
