/* =========================================================================
 * hakolawood — custom cart (classic [woocommerce_cart])
 * Loaded only on is_cart(). All selectors are scoped under .hkw-cart /
 * .hkw-summary so nothing leaks into other WooCommerce pages. Brand tokens
 * are declared once below; the layout follows the Cart layout mockup.
 * ========================================================================= */

.hkw-cart {
	/* ── Brand tokens ───────────────────────────────────────── */
	--hkw-coral: #D85959;
	--hkw-coral-deep: #C0463F;
	--hkw-coral-tint: #F3E5E1;
	--hkw-ink: #1C1B1A;
	--hkw-charcoal: #4A4744;
	--hkw-warm-grey: #8A847E;
	--hkw-line: #E4DFD9;
	--hkw-white: #FFFFFF;
	--hkw-paper: #FAF7F3;
	--hkw-placeholder: #F2EFEA;
	--hkw-amber: #C99A3C;
	--hkw-font: 'Manrope', system-ui, 'Helvetica Neue', Helvetica, Arial, sans-serif;

	max-width: 1290px;
	margin: 0 auto;
	/* No horizontal padding: Kadence's .content-container already provides side
	   spacing, so the 1fr + 430px grid gets the full content width. Side padding
	   is re-added at the single-column breakpoints below. */
	padding: 48px 0;
	box-sizing: border-box;
	font-family: var(--hkw-font);
	color: var(--hkw-ink);
}

.hkw-cart *,
.hkw-cart *::before,
.hkw-cart *::after {
	box-sizing: border-box;
}

/* ── Heading ────────────────────────────────────────────────── */
.hkw-cart__head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 32px;
}

.hkw-cart__title {
	font-size: 34px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.1;
	margin: 0;
	color: var(--hkw-ink);
}

.hkw-cart__count {
	font-size: 18px;
	font-weight: 400;
	color: var(--hkw-warm-grey);
}

/* ── Two-column grid ────────────────────────────────────────── */
.hkw-cart__grid {
	display: grid;
	grid-template-columns: 1fr 430px;
	gap: 30px;
	align-items: start;
}

.hkw-cart__items {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin: 0;
}

/* ── Item card ──────────────────────────────────────────────── */
.hkw-item {
	background: var(--hkw-white);
	border: 1px solid var(--hkw-line);
	border-radius: 8px;
	overflow: hidden;
	display: flex;
}

.hkw-item__media {
	flex: 0 0 350px;
	width: 350px;
	height: 350px;
	background: var(--hkw-placeholder);
	/* Hairline between the (now white-background) image and the details. */
	border-right: 1px solid var(--hkw-line);
	display: block;
	overflow: hidden;
	line-height: 0;
}

.hkw-item__media img {
	width: 350px;
	height: 350px;
	object-fit: cover;
	display: block;
	margin: 0;
	max-width: none;
	border-radius: 0;
}

.hkw-item__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 26px 30px 0 30px;
}

/* title + price */
.hkw-item__top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
}

.hkw-item__name {
	font-size: 20px;
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: 1.3;
	margin: 0;
	color: var(--hkw-ink);
}

.hkw-item__name a {
	color: inherit;
	text-decoration: none;
}

.hkw-item__name a:hover {
	color: var(--hkw-coral-deep);
}

.hkw-item__price {
	text-align: right;
	flex-shrink: 0;
}

.hkw-item__price-row {
	display: flex;
	align-items: baseline;
	gap: 10px;
	justify-content: flex-end;
}

.hkw-item__price-now {
	font-size: 21px;
	font-weight: 600;
	line-height: 1.3; /* match the name so the two top-align (Kadence inherits 1.7) */
	color: var(--hkw-coral-deep);
	white-space: nowrap;
}

.hkw-item__price-now .woocommerce-Price-amount {
	font-weight: 600;
}

.hkw-item__price-was {
	font-size: 17px;
	color: var(--hkw-warm-grey);
	text-decoration: line-through;
	white-space: nowrap;
}

.hkw-item__price-unit {
	font-size: 13px;
	color: var(--hkw-coral-deep);
	margin-top: 4px;
}

/* hide any tax suffix WooCommerce may append inside the price cells */
.hkw-item__price .tax_label {
	display: none;
}

.hkw-item__divider {
	height: 1px;
	background: var(--hkw-line);
	margin: 18px 0 0 0;
}

/* specs + ships */
.hkw-item__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px 20px;
	margin-top: 20px;
}

.hkw-item__specs {
	flex: 0 1 auto;
}

.hkw-item__ships {
	flex: 0 0 auto;
}

.hkw-item__specs {
	font-size: 14px;
	color: var(--hkw-charcoal);
	line-height: 1.7;
	min-width: 0;
}

/* WooCommerce renders the configured spec as a <dl class="variation"> */
.hkw-item__specs .variation,
.hkw-item__specs dl.variation {
	margin: 0;
	font-size: 14px;
	color: var(--hkw-charcoal);
	line-height: 1.7;
}

.hkw-item__specs .variation dt,
.hkw-item__specs .variation dd {
	display: inline;
	margin: 0;
	padding: 0;
	font-weight: inherit;
	float: none;
}

.hkw-item__specs .variation dt {
	font-weight: 400;
}

.hkw-item__specs .variation dd::after {
	content: '';
	display: block;
}

.hkw-item__specs .variation dd p {
	display: inline;
	margin: 0;
}

.hkw-item__specs .backorder_notification {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--hkw-amber);
}

.hkw-item__ships {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	padding: 7px 13px;
	background: var(--hkw-paper);
	border: 1px solid var(--hkw-line);
	border-radius: 6px;
}

.hkw-item__ships-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--hkw-amber);
	display: inline-block;
	flex-shrink: 0;
}

.hkw-item__ships-text {
	font-size: 13px;
	color: var(--hkw-charcoal);
	white-space: nowrap;
}

/* quantity stepper */
.hkw-item__qty {
	display: flex;
	align-items: center;
	margin-top: 22px;
}

.hkw-item__qty .quantity {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--hkw-line);
	border-radius: 4px;
	overflow: hidden;
	height: 42px;
	margin: 0;
}

.hkw-qty-btn {
	width: 42px;
	height: 42px;
	border: none;
	background: var(--hkw-paper);
	color: var(--hkw-charcoal);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-family: inherit;
	transition: background 0.12s ease, color 0.12s ease;
}

.hkw-qty-btn--dec {
	border-right: 1px solid var(--hkw-line);
}

.hkw-qty-btn--inc {
	border-left: 1px solid var(--hkw-line);
	font-size: 18px;
}

.hkw-qty-btn:hover:not(:disabled) {
	background: var(--hkw-coral-tint);
	color: var(--hkw-coral-deep);
}

.hkw-qty-btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.hkw-item__qty .quantity .qty,
.hkw-item__qty-input {
	width: 56px;
	height: 42px;
	min-width: 48px;
	border: none;
	background: var(--hkw-white);
	text-align: center;
	font-size: 16px;
	font-weight: 500;
	color: var(--hkw-ink);
	font-family: inherit;
	-moz-appearance: textfield;
	appearance: textfield;
	padding: 0;
}

.hkw-item__qty .quantity .qty::-webkit-outer-spin-button,
.hkw-item__qty .quantity .qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* When JS has enhanced the stepper, hide the native number input chrome but
   keep the value visible and centred. */
.hkw-item__qty.is-enhanced .quantity .qty {
	pointer-events: none;
}

/* action row — full bleed to the card edges */
.hkw-item__actions {
	margin-top: auto;
	display: flex;
	border-top: 1px solid var(--hkw-line);
	margin-left: -30px;
	margin-right: -30px;
}

.hkw-item__action {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 18px 0;
	background: none;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	color: var(--hkw-ink);
	text-decoration: none;
	transition: color 0.12s ease;
}

.hkw-item__action + .hkw-item__action {
	border-left: 1px solid var(--hkw-line);
}

.hkw-item__action:hover {
	color: var(--hkw-coral);
}

.hkw-item__action .hkw-icon {
	flex-shrink: 0;
}

.hkw-item__action span {
	white-space: nowrap;
}

/* neutralise WooCommerce core's `.woocommerce a.remove { color:red !important }`
   so our Remove link matches the other actions (ink, coral on hover). The
   compound selector out-specifies the core rule. */
.hkw-cart a.remove.hkw-item__action--remove {
	font-weight: 400;
	color: var(--hkw-ink) !important;
}

.hkw-cart a.remove.hkw-item__action--remove:hover {
	background: none;
	color: var(--hkw-coral) !important;
}

/* hidden no-JS update submit */
.hkw-cart__update.screen-reader-text {
	position: absolute !important;
}

/* =========================================================================
 * Order summary
 * ========================================================================= */
.hkw-summary {
	background: var(--hkw-white);
	border: 1px solid var(--hkw-line);
	border-radius: 8px;
	/* Top padding tuned so "Order summary" lines up with the product name/price
	   in the first item card (which sit at the details' 26px top padding). */
	padding: 28px 30px 32px;
	position: sticky;
	top: 48px;
	font-family: var(--hkw-font);
	color: var(--hkw-ink);
}

.hkw-summary__title {
	font-size: 24px;
	font-weight: 600;
	letter-spacing: -0.015em;
	margin: 0 0 26px 0;
	color: var(--hkw-ink);
}

.hkw-summary__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	font-size: 16px;
	color: var(--hkw-ink);
	margin-bottom: 16px;
}

.hkw-summary__row .tax_label {
	display: none;
}

.hkw-summary__row--discount {
	margin-bottom: 22px;
}

.hkw-summary__coupon-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	color: var(--hkw-charcoal);
}

.hkw-summary__coupon-amount,
.hkw-summary__coupon-amount .woocommerce-Price-amount {
	color: var(--hkw-coral-deep);
}

/* the remove-coupon link Woo appends */
.hkw-summary__coupon-label a,
.hkw-summary__row--discount a {
	color: var(--hkw-warm-grey);
	margin-left: 6px;
	font-size: 13px;
}

.hkw-summary__coupon-label a:hover,
.hkw-summary__row--discount a:hover {
	color: var(--hkw-coral-deep);
}

/* coupon input + apply */
.hkw-summary__coupon {
	display: flex;
	gap: 0;
	margin: 0 0 26px 0;
}

.hkw-summary__coupon-input {
	flex: 1;
	min-width: 0;
	height: 50px;
	padding: 0 16px;
	border: 1px solid var(--hkw-line);
	border-right: none;
	border-radius: 4px 0 0 4px;
	font-family: inherit;
	font-size: 15px;
	color: var(--hkw-ink);
	outline: none;
	background: var(--hkw-white);
}

.hkw-summary__coupon-input:focus {
	border-color: var(--hkw-coral);
}

.hkw-summary__coupon-apply {
	flex: 0 0 auto;
	padding: 0 26px;
	height: 50px;
	background: var(--hkw-coral);
	color: #fff;
	border: none;
	border-radius: 0 4px 4px 0;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.12s ease;
}

.hkw-summary__coupon-apply:hover {
	background: var(--hkw-coral-deep);
}

.hkw-summary__divider {
	height: 1px;
	background: var(--hkw-line);
	margin: 0 0 24px 0;
}

.hkw-summary__total {
	align-items: baseline;
	margin-bottom: 6px;
}

.hkw-summary__total span {
	font-size: 24px;
	font-weight: 600;
	color: var(--hkw-ink);
	white-space: nowrap;
}

.hkw-summary__tax-note {
	text-align: right;
	font-size: 13px;
	color: var(--hkw-warm-grey);
	margin-bottom: 26px;
}

.hkw-summary__tax-note .woocommerce-Price-amount {
	color: inherit;
}

/* proceed to checkout — style the Woo button output */
.hkw-summary__checkout {
	margin: 0;
}

.hkw-summary__checkout .checkout-button,
.hkw-summary__checkout .button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 60px;
	background: var(--hkw-coral);
	color: #fff;
	border: none;
	border-radius: 4px;
	font-family: inherit;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.01em;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background 0.12s ease;
}

.hkw-summary__checkout .checkout-button:hover,
.hkw-summary__checkout .button:hover {
	background: var(--hkw-coral-deep);
	color: #fff;
}

/* =========================================================================
 * Responsive
 * ========================================================================= */
/* Collapse to a single column below 1280px: the design needs ~1290px for the
   1fr + 430px summary to breathe; tighter than this squeezes the item details. */
@media (max-width: 1280px) {
	.hkw-cart__grid {
		grid-template-columns: 1fr;
	}

	.hkw-summary {
		position: static;
	}
}

@media (max-width: 640px) {
	.hkw-cart {
		padding: 28px 16px;
	}

	.hkw-item {
		flex-direction: column;
	}

	.hkw-item__media,
	.hkw-item__media img {
		flex: 0 0 auto;
		width: 100%;
		max-width: 350px;
		height: auto;
		aspect-ratio: 1 / 1;
	}

	/* Stacked layout — no vertical divider. */
	.hkw-item__media {
		border-right: none;
	}

	.hkw-item__media img {
		max-width: 100%;
	}

	.hkw-item__body {
		padding: 22px 22px 0 22px;
	}

	.hkw-item__actions {
		margin-left: -22px;
		margin-right: -22px;
	}

	.hkw-item__top {
		flex-direction: column;
		gap: 10px;
	}

	.hkw-item__price,
	.hkw-item__price-row {
		text-align: left;
		justify-content: flex-start;
	}

	.hkw-item__meta {
		flex-direction: column;
		gap: 14px;
	}

	.hkw-cart__title {
		font-size: 28px;
	}

	/* Shrink the three action labels so they fit one line on narrow screens. */
	.hkw-cart .hkw-item__actions a,
	.hkw-cart .hkw-item__actions button {
		gap: 6px;
		padding: 16px 0;
		font-size: 13px;
	}

	.hkw-item__action .hkw-icon {
		width: 15px;
		height: 15px;
	}
}

/* =========================================================================
 * Specificity overrides — beat Kadence + WooCommerce defaults.
 * Kadence's content styles (`.entry-content h1/h2`, `.woocommerce a.button.alt`,
 * `.woocommerce a.remove`) out-specify single-class rules, so these higher-
 * specificity selectors restore the design-system values. Measured against the
 * live cart, not guessed.
 * ========================================================================= */

/* Page background → paper. Kadence paints `.site.wp-site-blocks` white over the
   paper <body>; the header (white) and footer (linen) keep their own fills. */
body.woocommerce-cart .site.wp-site-blocks {
	background-color: #FAF7F3;
}

/* Headings — Kadence `.entry-content.single-content h1/h2` (0,2,1) forces large
   sizes / weight 400, so these need (0,3,0)+ selectors to win. */
.hkw-cart .hkw-cart__head .hkw-cart__title {
	font-size: 34px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.hkw-cart .hkw-item__top .hkw-item__name,
.hkw-cart .hkw-item__top .hkw-item__name a {
	font-size: 20px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.hkw-cart .hkw-summary .hkw-summary__title {
	font-size: 24px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.015em;
}

.hkw-cart .hkw-summary .hkw-summary__total span {
	font-size: 24px;
	font-weight: 600;
}

/* Action row — strip WooCommerce/Kadence button & link chrome so the three
   actions are clean equal thirds with hairline dividers and a coral hover. */
.hkw-cart .hkw-item__actions a,
.hkw-cart .hkw-item__actions button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex: 1 1 0;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 18px 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--hkw-ink);
	text-decoration: none;
	text-transform: none;
}

/* Hairline dividers between the three actions. `:not(:first-child)` raises this
   to (0,3,0) so it beats the (0,2,1) `border:0` reset above. */
.hkw-cart .hkw-item__actions > *:not(:first-child) {
	border-left: 1px solid var(--hkw-line);
}

.hkw-cart .hkw-item__actions a:hover,
.hkw-cart .hkw-item__actions button:hover {
	background: none;
	color: var(--hkw-coral);
}

/* Remove link — WooCommerce forces display:block / 1.5em / red. */
.hkw-cart .hkw-item__actions a.remove {
	display: flex;
	font-size: 15px;
	color: var(--hkw-ink);
}

.hkw-cart .hkw-item__actions a.remove:hover {
	color: var(--hkw-coral);
}

/* Proceed to checkout — Kadence `.woocommerce a.button.alt` paints it deep
   coral by default; restore coral → deep-coral on hover, full-width, centred. */
.hkw-cart .hkw-summary__checkout a.checkout-button.button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 60px;
	padding: 0;
	background-color: var(--hkw-coral);
	color: #fff;
	border: 0;
	border-radius: 4px;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.01em;
	text-transform: none;
}

.hkw-cart .hkw-summary__checkout a.checkout-button.button:hover {
	background-color: var(--hkw-coral-deep);
	color: #fff;
}

/* Image fills the full card height — the card grows with the details, so a
   fixed 350px image left white space below it. Stretch + cover removes it
   (min-height keeps the card ≥350 when the details are short). */
.hkw-cart .hkw-item__media {
	align-self: stretch;
	height: auto;
	min-height: 350px;
}

.hkw-cart .hkw-item__media img {
	width: 350px;
	height: 100%;
	min-height: 350px;
	object-fit: cover;
}

/* Kill the extra space WooCommerce wraps around the checkout button
   (`.wc-proceed-to-checkout` padding + `.checkout-button` margin-bottom) so it
   sits a clean 32px (the card padding) from the bottom edge. */
.hkw-cart .hkw-summary__checkout {
	margin: 0;
	padding: 0;
}

.hkw-cart .hkw-summary__checkout a.checkout-button.button {
	margin: 0;
}

/* Specs — unify Shape/Size/Corner radius/Colour to 14px. The values sit in
   <p> tags that otherwise inherit Kadence's `.entry-content p` (16px). */
.hkw-cart .hkw-item__specs .variation,
.hkw-cart .hkw-item__specs .variation dt,
.hkw-cart .hkw-item__specs .variation dd,
.hkw-cart .hkw-item__specs .variation dd p {
	font-size: 14px;
	font-weight: 400;
	line-height: 1.7;
	color: var(--hkw-charcoal);
}

.hkw-cart .hkw-item__specs .variation dd p {
	display: inline;
	margin: 0;
}
