/* ══════════════════════════════════════════════════════════════════════════
   Cart — the page and the slide-over drawer.

   Loaded everywhere, because the drawer opens from the header on any page.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── page shell ─────────────────────────────────────────────────────────── */

.woocommerce-cart .page-hero .entry-title {
	display: flex;
	align-items: baseline;
	gap: 14px;
	flex-wrap: wrap;
}

.woocommerce-cart .page-hero .ccount {
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mut2);
}

.woocommerce-cart .crumb {
	margin-bottom: 6px;
}

.ccols {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 400px;
	gap: 48px;
	align-items: start;
	margin-top: 8px;
}

.cmainc {
	min-width: 0;
}

/* ── lines ──────────────────────────────────────────────────────────────── */

.clines {
	border-top: 1px solid var(--line);
}

.cline {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr) auto;
	gap: 18px;
	align-items: center;
	padding: 18px 0;
	border-bottom: 1px solid var(--line);
}

/* A light tile, in both skins. The catalogue is shot on white and saved with
 * transparency, so on the dark surface the machine lost its own background and
 * read as a thin sliver floating in the panel. */
.cthumb {
	display: block;
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--line);
}

/* The catalogue's product shots are tall transparent PNGs, not square crops,
 * so the tile holds them whole rather than cutting the machine in half. */
.cline .cthumb a {
	display: block;
}

.cline .cthumb {
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	padding: 7px;
	border-radius: 13px;
}

/* Sized to the tile and fitted inside it. Left to size itself the image only
 * had its width capped, so a tall machine overflowed the tile's height and the
 * overflow:hidden above cut its head and base off. */
.cline .cthumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.cname {
	margin: 0 0 11px;
	font-family: var(--disp);
	font-size: 18px;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.cname a {
	color: var(--txt);
	text-decoration: none;
}

.cname a:hover {
	color: var(--blue-lt);
}

.cline .crow {
	display: flex;
	align-items: center;
	gap: 22px;
	flex-wrap: wrap;
}

.cprice {
	text-align: right;
	white-space: nowrap;
}

.cprice b {
	display: block;
	font-family: var(--disp);
	font-size: 21px;
	letter-spacing: -0.03em;
	color: var(--txt);
	font-variant-numeric: tabular-nums;
}

.cprice s {
	display: block;
	margin-top: 3px;
	font-size: 14px;
	color: var(--mut2);
	font-variant-numeric: tabular-nums;
}

.cempty {
	padding: 34px 0;
	color: var(--mut);
}

/* ── stepper ────────────────────────────────────────────────────────────── */

.cqty {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 4px;
	border: 1px solid var(--line2);
	border-radius: 999px;
	background: var(--ghost-bg);
}

.cqty .cq {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--mut);
	cursor: pointer;
}

.cqty .cq svg {
	width: 15px;
	height: 15px;
}

.cqty .cq:hover:not(:disabled) {
	background: var(--line2);
	color: var(--txt);
}

.cqty .cq:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

/* The number is a real input, so it can be typed into as well as stepped. */
.cqty .cqn {
	width: 40px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--txt);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
	appearance: textfield;
}

.cqty .cqn::-webkit-outer-spin-button,
.cqty .cqn::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ── remove ─────────────────────────────────────────────────────────────── */

.crm {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--mut);
	font-size: 15px;
	text-decoration: none;
}

.crm svg {
	width: 17px;
	height: 17px;
}

.crm:hover {
	color: var(--neg);
}

/* ── actions under the lines ────────────────────────────────────────────── */

.cactions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 26px;
}

.cback {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--mut);
	font-size: 16px;
	text-decoration: none;
}

.cback:hover {
	color: var(--txt);
}

/* Only reachable with JavaScript off; with it on, every change saves itself. */
.cupdate {
	padding: 11px 22px;
	border: 1px solid var(--line2);
	border-radius: 999px;
	background: none;
	color: var(--txt);
	font: inherit;
	font-size: 14.5px;
	cursor: pointer;
}

.cupdate:hover {
	background: var(--ghost-bg);
}

.js-on .cupdate {
	display: none;
}

/* ── coupon ─────────────────────────────────────────────────────────────── */

.ccoupon {
	margin-top: 26px;
}

.ccoupon label {
	display: block;
	margin-bottom: 8px;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--mut2);
}

.ccfield {
	display: flex;
	gap: 10px;
}

.ccoupon input.input-text {
	width: 200px;
	padding: 13px 18px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--bg);
	color: var(--txt);
	font: inherit;
	font-size: 15px;
}

.ccapply {
	padding: 13px 24px;
	border: 1px solid var(--line2);
	border-radius: 999px;
	background: none;
	color: var(--txt);
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}

.ccapply:hover {
	background: var(--ghost-bg);
}

/* ── order summary ──────────────────────────────────────────────────────── */

.csum {
	position: sticky;
	top: 88px;
	align-self: start;
	padding: 28px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--surf);
}

.csum h2 {
	margin: 0 0 22px;
	font-family: var(--disp);
	font-size: 26px;
	letter-spacing: -0.025em;
}

.cslines {
	display: grid;
	gap: 15px;
	margin: 0;
}

.cslines > div {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}

.cslines dt {
	color: var(--mut);
	font-size: 15.5px;
}

.cslines dd {
	margin: 0;
	color: var(--txt);
	font-size: 15.5px;
	font-variant-numeric: tabular-nums;
}

.cslines .cssave dd {
	color: var(--txt);
}

.cslines .csfree {
	color: var(--pos);
	font-weight: 600;
}

.cslines .csmut {
	color: var(--mut2);
	font-size: 14.5px;
}

.cstotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-top: 22px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}

/* Direct child only: wc_price() wraps the figure in its own <span>, which this
 * label styling would otherwise shrink to mono caps. */
.cstotal > span {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--mut2);
}

.cstotal b {
	font-family: var(--disp);
	font-size: 32px;
	letter-spacing: -0.035em;
	color: var(--txt);
	font-variant-numeric: tabular-nums;
}

.csgo {
	width: 100%;
	justify-content: center;
	margin-top: 20px;
}

.cssec {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 14px 0 0;
	color: var(--mut2);
	font-size: 13px;
}

.cssec svg {
	width: 14px;
	height: 14px;
}

.cstrust {
	display: grid;
	gap: 12px;
	margin: 24px 0 0;
	padding: 22px 0 0;
	border-top: 1px solid var(--line);
	list-style: none;
}

.cstrust li {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	color: var(--mut);
	font-size: 14.5px;
	line-height: 1.5;
}

.cstrust svg {
	width: 16px;
	height: 16px;
	flex: none;
	margin-top: 2px;
	color: var(--pos);
}

.csnote {
	margin: 0 0 20px;
	color: var(--mut);
	font-size: 15px;
	line-height: 1.6;
}

/* ── drawer ─────────────────────────────────────────────────────────────── */

.cdrawer {
	position: fixed;
	inset: 0;
	z-index: 120;
}

.cdrawer[hidden] {
	display: none;
}

.cdback {
	position: absolute;
	inset: 0;
	background: rgba(2, 6, 14, 0.62);
	opacity: 0;
	transition: opacity 0.28s ease;
}

.cdrawer.on .cdback {
	opacity: 1;
}

.cdwrap {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(440px, 100%);
	display: flex;
	background: var(--bg2);
	border-left: 1px solid var(--line);
	transform: translateX(100%);
	transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.cdrawer.on .cdwrap {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.cdback,
	.cdwrap {
		transition: none;
	}
}

.cdpanel {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: 0;
}

.cdhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px;
	border-bottom: 1px solid var(--line);
}

.cdhead h2 {
	display: flex;
	align-items: center;
	gap: 11px;
	margin: 0;
	font-family: var(--disp);
	font-size: 24px;
	letter-spacing: -0.025em;
}

.cdn {
	display: grid;
	place-items: center;
	min-width: 26px;
	height: 26px;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--blue);
	color: #fff;
	font-family: var(--sans, inherit);
	font-size: 13px;
	font-weight: 700;
}

.cdx {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--mut);
	cursor: pointer;
}

.cdx svg {
	width: 19px;
	height: 19px;
}

.cdx:hover {
	background: var(--ghost-bg);
	color: var(--txt);
}

.cdbody {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 8px 24px;
}

.cdline {
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr);
	gap: 16px;
	padding: 20px 0;
	border-bottom: 1px solid var(--line);
}

.cdline .cthumb {
	display: grid;
	place-items: center;
	width: 84px;
	height: 84px;
	padding: 8px;
}

.cdline .cthumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.cdmain {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 14px;
	min-width: 0;
}

.cdtop {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.cdtop h3 {
	margin: 0;
	font-size: 16.5px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--txt);
}

.cdtop h3 a {
	color: inherit;
	text-decoration: none;
}

.cdtop h3 a:hover {
	color: var(--blue-lt);
}

.cdrm {
	flex: none;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	color: var(--mut2);
}

.cdrm svg {
	width: 17px;
	height: 17px;
}

.cdrm:hover {
	background: var(--ghost-bg);
	color: var(--neg);
}

.cdbot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
}

.cdbot .cprice b {
	font-size: 21px;
}

.cdbot .cprice s {
	font-size: 13.5px;
}

.cdempty {
	display: grid;
	gap: 18px;
	justify-items: start;
	padding: 40px 0;
	color: var(--mut);
}

.cdfoot {
	flex: none;
	padding: 20px 24px 24px;
	border-top: 1px solid var(--line);
	background: var(--bg2);
}

.cdsub {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.cdsub > span {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--mut2);
}

.cdsub b {
	font-family: var(--disp);
	font-size: 26px;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

.cdgo {
	width: 100%;
	justify-content: center;
}

.cdcart {
	display: block;
	margin-top: 14px;
	color: var(--mut);
	font-size: 14px;
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cdcart:hover {
	color: var(--txt);
}

/* WooCommerce drops a "View cart" link beside any button it has just added
 * from. The drawer now opens instead, so the link would only break the card's
 * two-button row. */
a.added_to_cart.wc-forward {
	display: none;
}

/* The page behind the drawer should not scroll with it.
 *
 * Hiding the overflow takes the scrollbar away, and the layout jumps sideways
 * by its width. The padding puts that width back; cart.js measures it, because
 * it differs per platform and is 0 on overlay-scrollbar systems. */
body.cart-open {
	overflow: hidden;
	padding-right: var(--vp-sbw, 0px);
}

/* A pending update dims the numbers rather than blocking the panel. */
body.cart-busy .cdpanel,
body.cart-busy .clines,
body.cart-busy .csum {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* ── narrow ─────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
	.ccols {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.csum {
		position: static;
	}
}

@media (max-width: 620px) {
	.cline {
		grid-template-columns: 68px minmax(0, 1fr);
		gap: 14px;
		align-items: start;
	}

	.cname {
		font-size: 18px;
		margin-bottom: 12px;
	}

	/* Price moves under the controls rather than off the side of the screen. */
	.cprice {
		grid-column: 2;
		text-align: left;
	}

	.cprice b {
		font-size: 21px;
	}

	.cprice s {
		display: inline-block;
		margin-left: 10px;
	}

	.ccoupon input.input-text {
		width: 100%;
	}
}
