/* Cart page (WooCommerce Cart block) */
.wc-block-cart{align-items:flex-start;gap:28px}
.wc-block-cart__main{min-width:0}

/* Line items — each row reads as its own product card: border-collapse:separate
   lets individual <td>s carry a matching top/bottom border + background, with
   border-radius only on the outer (first/last) cell of each row, and the gap
   between cards comes from border-spacing on the table itself. */
.wc-block-cart-items{width:100%;border-collapse:separate;border-spacing:0 16px;margin-top:-16px}
.wc-block-cart-items__header th{padding:0 16px 8px;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--ev-muted)}
.wc-block-cart-items__row td{background:var(--ev-bg);border-top:1px solid var(--ev-border);border-bottom:1px solid var(--ev-border);box-shadow:0 6px 18px rgba(0,0,0,.06);padding:18px 16px;vertical-align:top}
.wc-block-cart-items__row td:first-child{border-left:1px solid var(--ev-border);border-top-left-radius:18px;border-bottom-left-radius:18px;padding-right:0}
.wc-block-cart-items__row td:last-child{border-right:1px solid var(--ev-border);border-top-right-radius:18px;border-bottom-right-radius:18px}
.wc-block-cart-item__image img{border-radius:14px;border:1px solid var(--ev-border);background:#fff}
.wc-block-components-product-name{color:var(--ev-text);font-weight:700;font-size:16px;text-decoration:none}
.wc-block-components-product-name:hover{color:var(--ev-accent)}
.wc-block-cart-item__prices .price,.wc-block-cart-item__total .price{color:var(--ev-accent);font-weight:700}
.wc-block-components-product-metadata__description p{color:var(--ev-muted);font-size:14px;margin:6px 0 0}
.wc-block-cart-item__total{font-size:17px;font-weight:800;color:var(--ev-text)}

/* Quantity stepper + remove */
.wc-block-cart-item__quantity{display:flex;align-items:center;gap:14px;margin-top:14px}
.wc-block-components-quantity-selector{display:flex;align-items:center;border:1px solid var(--ev-border);border-radius:999px;overflow:hidden;background:var(--ev-bg)}
.wc-block-components-quantity-selector__button{background:none;border:0;width:34px;height:34px;font-size:16px;font-weight:700;color:var(--ev-text);cursor:pointer}
.wc-block-components-quantity-selector__button:hover:not(:disabled){color:var(--ev-accent)}
.wc-block-components-quantity-selector__button:disabled{opacity:.3;cursor:default}
.wc-block-components-quantity-selector__input{width:40px;border:0;background:none;text-align:center;font:inherit;font-weight:700;color:var(--ev-text)}
.wc-block-cart-item__remove-link{background:none;border:0;color:var(--ev-muted);cursor:pointer;padding:6px;border-radius:50%;display:inline-flex}
.wc-block-cart-item__remove-link:hover{color:#e6483c;background:var(--ev-surface)}

/* Totals sidebar */
.wc-block-cart__sidebar{background:var(--ev-surface);border:1px solid var(--ev-border);border-radius:20px;padding:24px;min-width:280px}
.wc-block-cart__totals-title{font-size:20px;margin:0 0 16px}
.wc-block-components-totals-coupon{border-top:1px solid var(--ev-border);border-bottom:1px solid var(--ev-border);padding:4px 0;margin-bottom:14px}
.wc-block-components-panel__button{color:var(--ev-text);font-weight:600;padding:10px 0}
.wc-block-components-panel__button:hover{color:var(--ev-accent)}
.wc-block-components-totals-item__label{color:var(--ev-muted)}
.wc-block-components-totals-item{padding:8px 0}
.wc-block-components-totals-footer-item{border-top:1px solid var(--ev-border);margin-top:6px;padding-top:14px;font-size:18px;font-weight:800}
.wc-block-components-totals-footer-item .wc-block-components-totals-item__label{color:var(--ev-text);font-weight:800}
.wc-block-components-totals-footer-item .wc-block-components-formatted-money-amount{color:var(--ev-accent)}

/* Checkout button */
.wc-block-cart__submit-button{display:flex;align-items:center;justify-content:center;background:var(--ev-btn-bg)!important;color:var(--ev-btn-text)!important;border-radius:999px!important;padding:16px!important;font-weight:700!important;font-size:16px;text-decoration:none;transition:opacity .2s}
.wc-block-cart__submit-button:hover{opacity:.85}

/* Empty cart */
.wp-block-woocommerce-empty-cart-block{text-align:center;padding:60px 20px;background:var(--ev-surface);border:1px solid var(--ev-border);border-radius:20px}
.wp-block-woocommerce-empty-cart-block h2{margin-bottom:10px}
.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-title,.wp-block-woocommerce-empty-cart-block a.wc-block-components-button{border-radius:999px}

@media(max-width:767px){
	/* table-layout:auto (the default) sizes every column to fit whatever content in
	   it can't wrap - across ALL rows. A single long product name was enough to force
	   the whole table (and therefore the price column of every row) past the screen
	   edge, even though the price/badge text itself could already wrap.
	   The real mechanism turned out to be different from a normal table, though:
	   WooCommerce's own CSS switches .wc-block-cart-items__row to display:grid at
	   this width with a hard-coded 4-track grid-template-columns (80px 132px 131px
	   62px = 405px), but this row only ever has 3 cells (image/product/total) - that
	   mismatched, oversized template was the actual source of the overflow, and
	   table-layout:fixed has no effect on a row that's been switched to grid display.
	   Overriding the template directly, matching the real 3 cells, is what fixes it. */
	.wc-block-cart-items__header-image,.wc-block-cart-items__header-product,.wc-block-cart-items__header-total{padding:10px 12px}
	.wc-block-cart-items__row td{padding:14px 12px}
	.wc-block-cart-items__row{grid-template-columns:minmax(0,26%) minmax(0,42%) minmax(0,32%)!important}
	.wc-block-components-product-name{overflow-wrap:break-word}
	.wc-block-components-product-metadata__description p{overflow-wrap:break-word}
	.wc-block-cart__sidebar{margin-top:20px}
	/* The price column is too narrow at this width for "KSh 999.00" on one line
	   (WC's own money-amount span is nowrap by default), which the card's
	   overflow:hidden corner-rounding was silently clipping instead of wrapping. */
	.wc-block-cart-item__total{text-align:right}
	.wc-block-cart-item__total .wc-block-formatted-money-amount{white-space:normal}
	/* Same issue for the "Save KSh X" sale badge: its nowrap text forced the whole
	   table wider than the screen (table-layout:auto sizes columns to fit the
	   widest unbreakable content), pushing the price off the right edge. */
	.wc-block-cart-item__total .wc-block-components-sale-badge{white-space:normal;max-width:100%}
}
