/* Cart + checkout v2 — Haukur, 2026-11-16. Loaded only on /karfa/ + /greidsla/ (inc/checkout.php). Uses kemi.css variables. */

/* ---------- cart: shipping line instead of the chooser ---------- */
.kemi-theme.woocommerce-cart .cart_totals tr.kemi-cart-ship td { line-height: 1.35; }
.kemi-theme.woocommerce-cart .cart_totals tr.kemi-cart-ship .kemi-cart-ship__v { font-weight: 600; }
.kemi-theme.woocommerce-cart .cart_totals tr.kemi-cart-ship small { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 400; color: var(--kemi-muted); }
.kemi-theme.woocommerce-cart .cart_totals tr.kemi-cart-total-note td { padding-top: 0; border-top: 0; background: var(--kemi-bg); font-size: 12px; color: var(--kemi-muted); text-align: right; }

/* ---------- cart: credit ---------- */
.kemi-theme.woocommerce-cart .cart_totals tr.kemi-credit-row td { padding: 14px 16px; }
.kemi-credit { border: 1px solid var(--kemi-line); background: #fbfbfb; padding: 12px 14px; }
.kemi-credit__row, .kemi-credit__sub { display: flex; justify-content: space-between; gap: 12px; }
.kemi-credit__row { font-size: 14px; }
.kemi-credit__sub { margin-top: 2px; font-size: 12px; color: var(--kemi-muted); }
.kemi-credit__bar { height: 6px; margin: 8px 0 6px; background: #e4e4e4; overflow: hidden; }
.kemi-credit__bar i { display: block; height: 100%; background: var(--kemi-ink); }
.kemi-credit.is-over .kemi-credit__bar i { background: var(--kemi-red); }
.kemi-credit__warn { margin: 8px 0 0; font-size: 12.5px; color: var(--kemi-red); font-weight: 600; }

/* ---------- cart: auto-update qty, stepper, coupon behind a link ---------- */
.kemi-cart-auto .woocommerce-cart-form button[name="update_cart"] { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0 !important; border: 0 !important; }
.kemi-cart-auto .woocommerce-cart-form td.actions { padding: 12px 16px; }
.kemi-theme.woocommerce-cart .kemi-cqty { display: inline-flex; align-items: stretch; border: 1px solid var(--kemi-ink); background: #fff; }
.kemi-theme.woocommerce-cart .kemi-cqty button { width: 38px; border: 0; background: var(--kemi-bg); color: var(--kemi-ink); font: 600 18px/1 var(--kemi-font, inherit); cursor: pointer; }
.kemi-theme.woocommerce-cart .kemi-cqty button:hover { background: var(--kemi-ink); color: #fff; }
.kemi-theme.woocommerce-cart .kemi-cqty button:focus-visible { outline: 2px solid var(--kemi-red); outline-offset: -2px; }
.kemi-theme.woocommerce-cart table.cart .kemi-cqty .qty { width: 52px; border: 0 !important; height: 42px; }
.kemi-coupon-toggle { background: none; border: 0; padding: 0; color: var(--kemi-ink); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.kemi-coupon-toggle:hover { color: var(--kemi-red); }
.kemi-cart-auto .woocommerce-cart-form td.actions .coupon.is-collapsed { display: none; }
.kemi-cart-form-busy { opacity: .65; transition: opacity .15s; }

/* ---------- cart: sticky CTA on phones ---------- */
.kemi-cart-sticky { display: none; }
@media (max-width: 760px) {
	.kemi-cart-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--kemi-line); box-shadow: 0 -4px 14px rgba(0, 0, 0, .07); transform: translateY(0); transition: transform .18s; }
	.kemi-cart-sticky.is-hidden { transform: translateY(110%); }
	.kemi-cart-sticky__s { flex: 1; min-width: 0; font-size: 12px; color: var(--kemi-muted); line-height: 1.2; }
	.kemi-cart-sticky__s b { display: block; color: var(--kemi-ink); font-size: 19px; font-weight: 800; }
	.kemi-cart-sticky__s small { display: none; }
	.kemi-cart-sticky a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; background: var(--kemi-ink); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
	.kemi-cart-has-sticky .site-footer, .kemi-cart-has-sticky footer { padding-bottom: 76px; }
}

/* ---------- checkout: grouped shipping ---------- */
.kemi-checkout .kemi-co-choices li.kemi-co-grp { margin: 18px 0 8px; padding: 0; border: 0; background: none; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--kemi-muted); list-style: none; }
.kemi-checkout .kemi-co-choices li.kemi-co-grp:first-child { margin-top: 0; }
.kemi-checkout .kemi-co-choices .kemi-choice .t small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--kemi-muted); }
.kemi-checkout .kemi-co-cod { font-weight: 600; color: var(--kemi-muted); white-space: nowrap; }

/* ---------- checkout: the summary stays readable while Woo refreshes it ---------- */
.kemi-checkout .woocommerce-checkout-review-order-table .blockUI.blockOverlay,
.kemi-checkout .kemi-co-shipping .blockUI.blockOverlay { background: transparent !important; opacity: 1 !important; }
.kemi-checkout .woocommerce-checkout-review-order-table .blockUI.blockOverlay::before,
.kemi-checkout .kemi-co-shipping .blockUI.blockOverlay::before { display: none !important; }
.kemi-checkout .woocommerce-checkout-review-order-table.processing { animation: kemi-co-pulse 1s ease-in-out infinite; }
@keyframes kemi-co-pulse { 50% { opacity: .72; } }
@media (prefers-reduced-motion: reduce) { .kemi-checkout .woocommerce-checkout-review-order-table.processing { animation: none; opacity: .8; } }
