/* Cart page (templates/cart.html). Scoped to .cart-* ; colours follow design.md */

.cart-page { color: #333; }

.cart-hero { background: #FFF8DC; border-bottom: 1px solid #f5e7a3; padding: 40px 0 32px; }
.cart-hero h1 { color: #511616; font-weight: 700; font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin: 0 0 .4rem; }
.cart-hero p { margin: 0; color: #333; }

.cart-main { padding: 40px 0 72px; }

/* items */
.cart-items { margin: 0 0 1.25rem; padding: 0; display: grid; gap: 1rem; }
.cart-item {
    display: grid; grid-template-columns: 112px 1fr; gap: 1.1rem;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 1rem;
}
.cart-item-media {
    width: 112px; height: 112px; border-radius: 12px; overflow: hidden;
    background: #f8f9fa; border: 1px solid #eef0f2; display: flex; align-items: center; justify-content: center;
}
.cart-item-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item-noimg { color: #c4c7cc; font-size: 1.8rem; }

.cart-item-body { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.cart-item-title { font-size: 1.05rem; font-weight: 600; color: #511616; margin: 0 0 .15rem; overflow-wrap: anywhere; }
.cart-item-meta { margin: 0 0 .25rem; font-size: .82rem; color: #6b7280; }
.cart-item-price { margin: 0; font-weight: 600; color: #0a0a0a; }
.cart-item-price span { font-weight: 400; font-size: .82rem; color: #6b7280; }

.cart-item-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }

.qty-stepper {
    display: inline-flex; align-items: center; border: 1px solid #d1d5db; border-radius: 999px; overflow: hidden; background: #fff;
}
.qty-btn {
    width: 38px; height: 38px; border: 0; background: transparent; color: #0a0a0a; cursor: pointer;
    display: grid; place-items: center; transition: background-color .2s;
}
.qty-btn:hover { background: #FFF6D6; }
.qty-btn:focus-visible { outline: 2px solid #FACC15; outline-offset: -2px; }
.qty-input {
    width: 48px; height: 38px; border: 0; text-align: center; font-weight: 600; background: transparent;
    -moz-appearance: textfield; appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: 0; background: #FFFDF3; }

.cart-item-subtotal { margin: 0 0 0 auto; text-align: right; line-height: 1.2; }
.cart-item-subtotal-label { display: block; font-size: .78rem; color: #6b7280; }
.cart-item-subtotal strong { font-size: 1.05rem; color: #0a0a0a; }

.cart-remove-form { margin: 0; }
.cart-remove {
    border: 0; background: transparent; color: #6b7280; font-size: .88rem; padding: .4rem .25rem; cursor: pointer;
    transition: color .2s;
}
.cart-remove:hover { color: #b91c1c; text-decoration: underline; }
.cart-remove:focus-visible { outline: 2px solid #FACC15; outline-offset: 2px; }

.cart-continue { display: inline-flex; align-items: center; gap: .5rem; color: #0a0a0a; font-weight: 600; text-decoration: none; }
.cart-continue:hover { color: #511616; text-decoration: underline; }

/* summary */
.cart-summary {
    background: #FFFDF3; border: 1px solid #f5e7a3; border-radius: 16px; padding: 1.5rem;
    position: sticky; top: 96px;
}
.cart-summary h2 { font-size: 1.15rem; font-weight: 700; color: #511616; margin: 0 0 1rem; }
.cart-summary dl { margin: 0; }
.cart-summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; }
.cart-summary-row dt { font-weight: 400; color: #333; }
.cart-summary-row dd { margin: 0; font-weight: 600; color: #0a0a0a; }
.cart-summary-total { border-top: 1px solid #f0e2a0; margin-top: .4rem; padding-top: .9rem; font-size: 1.1rem; }
.cart-summary-total dt, .cart-summary-total dd { font-weight: 700; }
.cart-summary-note { margin: .85rem 0 0; font-size: .8rem; color: #6b7280; text-align: center; }

/* primary button: brand yellow, near-black text, #E6B800 hover (design.md) */
.cart-checkout {
    display: block; width: 100%; margin-top: 1.1rem; padding: .8rem 1.25rem;
    background: #FACC15; color: #0a0a0a; border: 0; border-radius: 999px; font-weight: 600; text-align: center;
    transition: background-color .2s;
}
.cart-checkout:hover, .cart-checkout:focus { background: #E6B800; color: #0a0a0a; }
.cart-checkout:focus-visible { outline: 2px solid #0a0a0a; outline-offset: 2px; box-shadow: none; }

/* out-of-stock state */
.cart-badge-oos {
    display: inline-block; margin-left: .5rem; padding: .15rem .55rem; vertical-align: middle;
    background: #FDECEC; color: #9b2c2c; border-radius: 6px; font-size: .72rem; font-weight: 600; letter-spacing: .02em;
}
.cart-item-oos-note { margin: .25rem 0 0; font-size: .8rem; color: #6b7280; }
.cart-checkout.is-disabled, .cart-checkout.is-disabled:hover {
    background: #e5e7eb; color: #9ca3af; cursor: not-allowed; pointer-events: none;
}

/* empty state */
.cart-empty { max-width: 520px; margin: 24px auto; text-align: center; padding: 2.5rem 1.5rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; }
.cart-empty-icon {
    width: 88px; height: 88px; margin: 0 auto 1.25rem; display: grid; place-items: center;
    border-radius: 50%; background: #FFF6D6; color: #b8860b; font-size: 2.2rem;
}
.cart-empty h2 { font-size: 1.4rem; font-weight: 700; color: #511616; margin-bottom: .5rem; }
.cart-empty p { color: #4b5563; margin-bottom: 1.25rem; }
.cart-empty .cart-checkout { display: inline-block; width: auto; margin-top: 0; padding: .7rem 2rem; }

@media (max-width: 991.98px) {
    .cart-summary { position: static; }
}
@media (max-width: 575.98px) {
    .cart-hero { padding: 30px 0 24px; }
    .cart-main { padding: 28px 0 52px; }
    .cart-item { grid-template-columns: 84px 1fr; gap: .85rem; padding: .85rem; }
    .cart-item-media { width: 84px; height: 84px; }
    .cart-item-controls { justify-content: space-between; }
    .cart-item-subtotal { margin-left: 0; text-align: left; }
    .qty-btn { width: 42px; height: 42px; }
    .qty-input { height: 42px; }
}
