/* =========================================================================
   Ward's Equipment Rental — Reservation Request Cart
   Scoped to body.wards-cart-page so nothing leaks to other pages.
   ========================================================================= */

:root {
	--wards-red: #b91c1c;
	--wards-red-dark: #991b1b;
	--wards-red-tint: #fef2f2;
	--wards-ink: #111827;
	--wards-ink-2: #374151;
	--wards-muted: #6b7280;
	--wards-line: #e5e7eb;
	--wards-bg: #f4f5f7;
	--wards-card: #ffffff;
	--wards-green: #16a34a;
	--wards-green-tint: #f0fdf4;
	--wards-radius: 10px;
	--wards-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

body.wards-cart-page {
	background: var(--wards-bg);
}

body.wards-cart-page .site-content {
	background: var(--wards-bg);
}

body.wards-cart-page .content-area,
body.wards-cart-page .site-main {
	width: 100%;
	float: none;
	margin-right: 0;
}

body.wards-cart-page .col-full {
	max-width: 1280px;
}

/* Hide Storefront's own cart heading (we print our own intro) */
body.wards-cart-page .entry-header { display: none; }

/* ---------- Intro + progress steps ---------- */
.wards-cart-intro {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 2rem;
	margin: 1.25rem 0 1.5rem;
	flex-wrap: wrap;
}
.wards-cart-intro__title {
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--wards-ink);
	margin: 0 0 0.4rem;
}
.wards-cart-intro__sub {
	margin: 0;
	font-size: 1.15rem;
	color: var(--wards-muted);
}

.wards-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: flex-start;
	gap: 0;
}
.wards-steps__item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 130px;
	margin: 0;
	font-size: 0.95rem;
	color: var(--wards-muted);
}
.wards-steps__item::before {
	content: "";
	position: absolute;
	top: 18px;
	left: 50%;
	width: 100%;
	height: 2px;
	background: var(--wards-line);
	z-index: 0;
}
.wards-steps__item:last-child::before { display: none; }
.wards-steps__num {
	position: relative;
	z-index: 1;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #e9eaee;
	color: var(--wards-muted);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	margin-bottom: 0.4rem;
}
.wards-steps__item.is-active .wards-steps__num {
	background: var(--wards-red);
	color: #fff;
}
.wards-steps__item.is-active .wards-steps__label {
	color: var(--wards-red);
	font-weight: 600;
}

/* ---------- "Added to request" notice ---------- */
body.wards-cart-page .woocommerce-message,
body.wards-cart-page .woocommerce-notices-wrapper .woocommerce-message {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	background: var(--wards-green-tint);
	border: 1px solid #bbf7d0;
	border-radius: var(--wards-radius);
	color: var(--wards-ink);
	padding: 0.9rem 1.25rem 0.9rem 3rem;
	margin: 0 0 1.5rem;
	position: relative;
}
body.wards-cart-page .woocommerce-message::before {
	content: "";
	position: absolute;
	left: 1.1rem;
	top: 50%;
	transform: translateY(-50%);
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--wards-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat;
	font-family: inherit;
	line-height: 1;
}
body.wards-cart-page .woocommerce-message .wards-notice__link {
	margin-left: auto;
	color: var(--wards-red);
	font-weight: 600;
	text-decoration: underline;
	white-space: nowrap;
}
body.wards-cart-page .woocommerce-message .button { display: none; } /* core "View cart" button */

/* ---------- Layout ---------- */
.wards-cart__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 400px;
	grid-template-areas:
		"equipment summary"
		"delivery  summary";
	gap: 1.5rem;
	align-items: start;
}
.wards-cart__main   { grid-area: equipment; min-width: 0; }
.wards-delivery     { grid-area: delivery; }
.wards-summary-col  { grid-area: summary; position: sticky; top: 1.5rem; }

/* Woo wrappers become transparent to the grid */
.wards-cart .cart-collaterals,
.wards-cart .cart_totals { display: contents; }

/* ---------- Cards ---------- */
.wards-card {
	background: var(--wards-card);
	border: 1px solid var(--wards-line);
	border-radius: var(--wards-radius);
	box-shadow: var(--wards-shadow);
}
.wards-card__head {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--wards-line);
}
.wards-card__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--wards-ink);
}
.wards-card__meta {
	font-size: 0.95rem;
	color: var(--wards-muted);
	padding-left: 0.9rem;
	border-left: 1px solid var(--wards-line);
}

/* ---------- Equipment line items ---------- */
.wards-item {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr) auto;
	gap: 1.5rem;
	padding: 1.5rem;
	border-bottom: 1px solid var(--wards-line);
}
.wards-item:last-of-type { border-bottom: 0; }

.wards-item__thumb img {
	width: 100%;
	height: auto;
	max-height: 170px;
	object-fit: contain;
	margin: 0;
}
.wards-item__title {
	margin: 0 0 0.25rem;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.25;
}
.wards-cart .wards-item__title a { color: var(--wards-ink); text-decoration: none !important; }
.wards-item__variation { display: block; color: var(--wards-ink-2); font-size: 1rem; margin-bottom: 0.15rem; }
.wards-item__title a:hover { color: var(--wards-red); }

.wards-item__attrs {
	color: var(--wards-muted);
	font-size: 0.98rem;
	margin-bottom: 1rem;
}
.wards-item__attrs dl.variation {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.5rem;
	margin: 0;
}
.wards-item__attrs dl.variation dt,
.wards-item__attrs dl.variation dd {
	display: inline;
	margin: 0;
	padding: 0;
	float: none;
	font-weight: 400;
	font-style: normal;
}
.wards-item__attrs dl.variation dt { display: none; }               /* hide "Time Needed:" labels */
.wards-item__attrs dl.variation dd p { display: inline; margin: 0; }
.wards-item__attrs dl.variation dd + dt + dd::before { content: "•"; margin: 0 0.5rem; }

.wards-item__rate-label {
	display: block;
	font-size: 0.9rem;
	color: var(--wards-muted);
	margin-bottom: 0.1rem;
}
.wards-item__rate-value,
.wards-item__rate-value .amount {
	font-size: 1.55rem;
	font-weight: 700;
	color: var(--wards-ink);
}

.wards-item__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.6rem;
	min-width: 160px;
}
.wards-item__qty-label {
	display: block;
	font-size: 0.95rem;
	color: var(--wards-ink-2);
	margin-bottom: 0.3rem;
}
.wards-item__subtotal { display: none; } /* totals live in the summary card */

/* Stepper */
.wards-cart .quantity {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}
.wards-cart .quantity .qty {
	width: 56px;
	border: 0;
	border-left: 1px solid #d1d5db;
	border-right: 1px solid #d1d5db;
	text-align: center;
	font-size: 1.1rem;
	font-weight: 600;
	padding: 0.5rem 0;
	-moz-appearance: textfield;
	box-shadow: none;
	background: #fff;
}
.wards-cart .quantity .qty::-webkit-outer-spin-button,
.wards-cart .quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wards-cart .quantity .wards-step {
	width: 46px;
	border: 0;
	background: #fff;
	color: var(--wards-ink-2);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	border-radius: 0;
}
.wards-cart .quantity .wards-step:hover { background: #f3f4f6; color: var(--wards-ink); }
.wards-cart .quantity .wards-step:disabled { opacity: 0.4; cursor: default; }

/* Remove link — undo Storefront/Woo circle-x styling */
.wards-cart a.remove.wards-remove::before,
.wards-cart a.remove.wards-remove::after { display: none !important; content: none !important; }
.wards-cart a.remove.wards-remove {
	text-indent: 0 !important;
	display: inline;
	width: auto;
	height: auto;
	font-size: 0.98rem;
	line-height: 1.4;
	border-radius: 0;
	text-align: left;
	background: none !important;
	color: var(--wards-red) !important;
	text-decoration: underline;
	font-weight: 400;
	padding: 0;
}
.wards-cart a.remove.wards-remove:hover { color: var(--wards-red-dark) !important; }

/* Cart actions row (coupon + hidden update button) */
.wards-cart__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: 0.75rem 1.5rem;
	border-top: 1px solid var(--wards-line);
	background: #fafafa;
	border-radius: 0 0 var(--wards-radius) var(--wards-radius);
}
.wards-cart__actions:has(.wards-coupon) { justify-content: flex-start; }
.wards-coupon {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}
.wards-coupon .input-text {
	width: 180px;
	padding: 0.5rem 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	box-shadow: none;
}
.wards-coupon .button {
	background: #fff;
	color: var(--wards-ink-2);
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 0.5rem 0.9rem;
	font-weight: 600;
}
.wards-coupon .button:hover { border-color: var(--wards-ink-2); color: var(--wards-ink); }

/* Update cart is driven by JS; keep it reachable for a11y but out of the layout */
.wards-cart .wards-update-cart {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Pickup or delivery ---------- */
.wards-delivery__body { padding: 1.25rem 1.5rem 1.5rem; }
.wards-delivery__hint { margin: 0 0 1rem; color: var(--wards-muted); }

.wards-shipping { display: block; }
.wards-options {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.wards-option { margin: 0; }
.wards-option__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}
.wards-option__label {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border: 1px solid var(--wards-line);
	border-radius: var(--wards-radius);
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
	margin: 0;
	font-weight: 400;
}
.wards-option__label:hover { border-color: #cbd0d8; }
.wards-option__radio {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 2px solid #9ca3af;
	position: relative;
	background: #fff;
}
.wards-option__radio::after {
	content: "";
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background: var(--wards-red);
	transform: scale(0);
	transition: transform 0.12s;
}
.wards-option__text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.wards-option__title { font-weight: 700; color: var(--wards-ink); font-size: 1.05rem; }
.wards-option__sub { color: var(--wards-muted); font-size: 0.95rem; }
.wards-option__price {
	margin-left: auto;
	font-weight: 700;
	color: var(--wards-ink);
	white-space: nowrap;
	font-size: 1.05rem;
}
.wards-option__price .amount { font-weight: 700; }
.wards-option--quote .wards-option__price { font-weight: 400; color: var(--wards-muted); }

.wards-option__input:checked + .wards-option__label,
.wards-option.is-selected .wards-option__label {
	border-color: var(--wards-red);
	background: var(--wards-red-tint);
	box-shadow: 0 0 0 1px var(--wards-red);
}
.wards-option__input:checked + .wards-option__label .wards-option__radio,
.wards-option.is-selected .wards-option__radio { border-color: var(--wards-red); }
.wards-option__input:checked + .wards-option__label .wards-option__radio::after,
.wards-option.is-selected .wards-option__radio::after { transform: scale(1); }
.wards-option__input:checked + .wards-option__label .wards-option__price,
.wards-option.is-selected .wards-option__price { color: var(--wards-red); }
.wards-option--quote.is-selected .wards-option__price,
.wards-option--quote .wards-option__input:checked + .wards-option__label .wards-option__price { color: var(--wards-muted); }
.wards-option__input:focus-visible + .wards-option__label { outline: 2px solid var(--wards-red); outline-offset: 2px; }

.wards-destination {
	margin: 0 0 0.5rem;
	font-size: 0.95rem;
	color: var(--wards-muted);
}
.wards-calculator { font-size: 0.95rem; }
.wards-calculator .shipping-calculator-button {
	color: var(--wards-red);
	text-decoration: underline;
	font-weight: 600;
}
.wards-calculator .shipping-calculator-form { margin-top: 0.75rem; max-width: 420px; }
.wards-calculator .shipping-calculator-form .input-text,
.wards-calculator .shipping-calculator-form select {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	box-shadow: none;
	padding: 0.55rem 0.75rem;
}
.wards-calculator .shipping-calculator-form .button { border-radius: 8px; }

.wards-note {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0.25rem 0 0;
	font-size: 0.95rem;
	color: var(--wards-muted);
}
.wards-note__icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #e5e7eb;
	color: var(--wards-ink-2);
	font-size: 0.72rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 0.1rem;
	font-style: normal;
}

/* ---------- Request summary ---------- */
.wards-summary__lines {
	margin: 0;
	padding: 0.5rem 1.5rem 0;
}
.wards-summary__line {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: 0.65rem 0;
	margin: 0;
}
.wards-summary__line dt {
	font-weight: 400;
	color: var(--wards-ink-2);
	margin: 0;
	float: none;
	width: auto;
}
.wards-summary__line dd {
	margin: 0;
	font-weight: 600;
	color: var(--wards-ink);
	text-align: right;
}
.wards-summary__line dd .amount { font-weight: 600; }
.wards-summary__line--total {
	border-top: 1px solid var(--wards-line);
	margin-top: 0.5rem;
	padding-top: 1.1rem;
	padding-bottom: 0.2rem;
}
.wards-summary__line--total dt {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--wards-ink);
}
.wards-summary__line--total dd,
.wards-summary__line--total dd .amount {
	font-size: 1.85rem;
	font-weight: 800;
	color: var(--wards-ink);
}
.wards-summary__line--total dd .includes_tax { display: block; font-size: 0.8rem; font-weight: 400; color: var(--wards-muted); }
.wards-summary__basis {
	margin: 0;
	padding: 0 1.5rem 1rem;
	font-size: 0.92rem;
	color: var(--wards-muted);
}
.wards-summary__cta { padding: 0.25rem 1.5rem 0.75rem; }
.wards-summary__note { padding: 0 1.5rem 1.25rem; margin: 0; }

/* Primary button */
.wards-cart .wards-btn--primary,
.wards-cart .wc-proceed-to-checkout a.checkout-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	width: 100%;
	background: var(--wards-red);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 1.05rem 1.25rem;
	font-size: 1.15rem;
	font-weight: 700;
	text-decoration: none;
	margin: 0;
	transition: background 0.15s, transform 0.1s;
}
.wards-cart .wards-btn--primary:hover,
.wards-cart .wc-proceed-to-checkout a.checkout-button:hover {
	background: var(--wards-red-dark);
	color: #fff;
}
.wards-cart .wc-proceed-to-checkout a.checkout-button:active { transform: translateY(1px); }
.wards-cart .wc-proceed-to-checkout a.checkout-button::after { margin-left: 0.5rem; }

/* Help card */
.wards-help {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
	padding: 1.5rem;
	margin-top: 1.5rem;
}
.wards-help__icon {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #f3f4f6;
	color: var(--wards-ink-2);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.wards-help__title { margin: 0 0 0.3rem; font-size: 1.1rem; font-weight: 700; color: var(--wards-ink); }
.wards-help__text { margin: 0 0 0.6rem; color: var(--wards-muted); font-size: 0.98rem; }
.wards-help__link { color: var(--wards-red); font-weight: 600; text-decoration: underline; }

/* AJAX loading overlay (Woo blockUI) keeps card radius */
.wards-cart .blockUI.blockOverlay { border-radius: var(--wards-radius); }

/* Empty cart */
body.wards-cart-page .cart-empty { text-align: center; font-size: 1.25rem; }
body.wards-cart-page .return-to-shop .button { background: var(--wards-red); color: #fff; border-radius: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.wards-cart__layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"equipment"
			"delivery"
			"summary";
	}
	.wards-summary-col { position: static; }
}
@media (max-width: 768px) {
	.wards-cart-intro { flex-direction: column; align-items: flex-start; }
	.wards-steps__item { min-width: 100px; font-size: 0.85rem; }
	.wards-item {
		grid-template-columns: 110px minmax(0, 1fr);
		gap: 1rem;
		padding: 1.25rem;
	}
	.wards-item__actions {
		grid-column: 1 / -1;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
	.wards-item__qty-label { display: inline; margin: 0 0.5rem 0 0; }
	.wards-card__head,
	.wards-delivery__body,
	.wards-summary__lines,
	.wards-summary__basis,
	.wards-summary__cta,
	.wards-summary__note { padding-left: 1.1rem; padding-right: 1.1rem; }
	.wards-option__label { padding: 0.85rem 1rem; }
	body.wards-cart-page .woocommerce-message { flex-wrap: wrap; }
	body.wards-cart-page .woocommerce-message .wards-notice__link { margin-left: 0; }
}
