/* 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: 22px 0 2px; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--kemi-ink); list-style: none; } /* sentence case, no small-caps label (Gústi + Haukur 2026-11-24) */
.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; } }

/* ---------- checkout: Sækja / Senda + carrier logos — Haukur 2026-11-25 ---------- */
.kemi-checkout .kemi-co-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.kemi-checkout .kemi-co-mode { display: flex; align-items: center; gap: 12px; min-height: 76px; margin: 0; padding: 14px 16px; border: 1px solid #cfcfcf; border-radius: 0; background: #fff; color: var(--kemi-ink); font: inherit; text-align: left; text-transform: none; letter-spacing: 0; box-shadow: none; cursor: pointer; transition: border-color .12s; }
.kemi-checkout .kemi-co-mode:hover { border-color: var(--kemi-ink); background: #fff; color: var(--kemi-ink); }
.kemi-checkout .kemi-co-mode.is-on { border-color: var(--kemi-red); box-shadow: 0 0 0 1px var(--kemi-red) inset; }
.kemi-checkout .kemi-co-mode:focus-visible { outline: 2px solid var(--kemi-red); outline-offset: 2px; }
.kemi-checkout .kemi-co-mode .kemi-co-ico { flex: 0 0 auto; width: 30px; height: 30px; }
.kemi-checkout .kemi-co-mode.is-on .kemi-co-ico { color: var(--kemi-red); }
.kemi-checkout .kemi-co-mode__t { min-width: 0; }
.kemi-checkout .kemi-co-mode__t b { display: block; font-size: 17px; font-weight: 700; line-height: 1.2; }
.kemi-checkout .kemi-co-mode__t small { display: block; margin-top: 3px; font-size: 13px; font-weight: 400; line-height: 1.3; color: var(--kemi-muted); }
.kemi-checkout .kemi-co-mode-hint { margin: 10px 0 0; font-size: 14px; color: var(--kemi-muted); }
.kemi-co-js .kemi-co-shipping:has(.kemi-co-mode.is-on) .kemi-co-mode-hint { display: none; }

/* Only the open half shows (JS sets .kemi-co-js; without JS every row stays visible). */
.kemi-theme.kemi-checkout.kemi-co-js #shipping_method[data-kemi-split] > li[data-kemi-mode] { display: none; }
.kemi-theme.kemi-checkout.kemi-co-js #shipping_method[data-kemi-open="pickup"] > li[data-kemi-mode="pickup"],
.kemi-theme.kemi-checkout.kemi-co-js #shipping_method[data-kemi-open="send"] > li[data-kemi-mode="send"] { display: block; }
.kemi-theme.kemi-checkout.kemi-co-js #shipping_method[data-kemi-split]:not([data-kemi-open="pickup"]):not([data-kemi-open="send"]) { display: none; }

.kemi-theme.kemi-checkout #shipping_method[data-kemi-split] { margin-top: 12px; }
.kemi-theme.kemi-checkout #shipping_method[data-kemi-split] li.kemi-co-grp:first-child { margin-top: 18px; }

/* Logo tile in front of each row. */
.kemi-theme.kemi-checkout #shipping_method li.kemi-choice > label { align-items: center; }
.kemi-theme.kemi-checkout #shipping_method li.kemi-choice > input { top: 26px; }
.kemi-checkout .kemi-co-logo { flex: 0 0 68px; display: flex; align-items: center; justify-content: center; height: 42px; padding: 5px 7px; border: 1px solid var(--kemi-line); background: #fff; box-sizing: border-box; }
.kemi-checkout .kemi-co-logo img { display: block; max-width: 100%; max-height: 28px; width: auto; height: auto; margin: 0; }
.kemi-checkout .kemi-co-logo--dropp img { max-height: 22px; }
.kemi-checkout .kemi-co-logo--icon { color: var(--kemi-ink); }
.kemi-checkout .kemi-co-logo--icon .kemi-co-ico { width: 26px; height: 26px; }
.kemi-checkout .kemi-choice .t small { line-height: 1.35; }

/* „Sækja“: no address needed — the address fields and „Senda á annað heimilisfang“ go away (order note stays). */
.kemi-co--pickup .kemi-co-addr, .kemi-co--pickup .kemi-co-shipto .woocommerce-shipping-fields { display: none !important; }

@media (max-width: 480px) {
	.kemi-checkout .kemi-co-modes { gap: 8px; }
	.kemi-checkout .kemi-co-mode { flex-direction: column; align-items: flex-start; gap: 6px; min-height: 0; padding: 12px; }
	.kemi-checkout .kemi-co-mode .kemi-co-ico { width: 26px; height: 26px; }
	/* Phone: logo | title, price under the title — keeps words whole on a 390 px screen. */
	.kemi-theme.kemi-checkout #shipping_method li.kemi-choice > label { display: grid !important; grid-template-columns: 52px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: start; padding: 14px 12px 14px 44px; }
	.kemi-theme.kemi-checkout #shipping_method li.kemi-choice > label .kemi-co-logo { grid-row: 1 / span 2; }
	.kemi-theme.kemi-checkout #shipping_method li.kemi-choice > label .t { grid-column: 2; overflow-wrap: normal; }
	.kemi-theme.kemi-checkout #shipping_method li.kemi-choice > label .t b { overflow-wrap: normal; word-break: normal; hyphens: auto; }
	.kemi-theme.kemi-checkout #shipping_method li.kemi-choice > label .p { grid-column: 2; margin-left: 0; font-size: 15px; }
	.kemi-checkout .kemi-co-logo { width: 52px; height: 36px; padding: 4px 5px; }
	.kemi-theme.kemi-checkout #shipping_method li.kemi-choice > input { left: 14px; top: 23px; }
	.kemi-theme.kemi-checkout #shipping_method li.kemi-choice .kemi-choice-extra { padding-left: 44px; padding-right: 12px; }
}
