/* Cart and guest cart. Shares its look with layout/checkout.css. */
.basket-page {
	--co-green: #087b36;
	--co-green-dark: #066a2e;
	--co-green-tint: #eef7f1;
	--co-ink: #18251d;
	--co-text: #33413a;
	--co-muted: #66746b;
	--co-line: #e2e8e3;
	--co-field: #cdd6cf;
	--co-surface: #fff;
	--co-bg: #f3f6f3;
	--co-amber: #8a5a00;
	--co-amber-tint: #fff5df;
	--co-red: #b02a37;
	--co-red-tint: #fdecee;
	--co-radius: 12px;

	background: var(--co-bg);
	color: var(--co-ink);
	padding: 32px 0 72px;
}

.basket-page .container {
	max-width: 1180px;
}

.basket-page *,
.basket-page *::before,
.basket-page *::after {
	box-sizing: border-box;
}

.basket-header {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin-bottom: 24px;
}

.basket-page .basket-header h1 {
	color: var(--co-ink);
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.2;
	margin: 0;
}

.basket-count {
	color: var(--co-muted);
	font-size: 15px;
}

.basket-alert {
	background: #fff1f0;
	border: 1px solid #e8bab5;
	border-radius: 10px;
	color: #7a2922;
	font-size: 14px;
	line-height: 1.5;
	margin-bottom: 20px;
	padding: 12px 16px;
}

.basket-layout {
	align-items: start;
	display: grid;
	gap: 28px;
	grid-template-columns: minmax(0, 1fr) 380px;
}

.basket-main,
.basket-sidebar {
	min-width: 0;
}

.basket-items,
.basket-summary,
.basket-empty {
	background: var(--co-surface);
	border: 1px solid var(--co-line);
	border-radius: var(--co-radius);
	box-shadow: 0 1px 2px rgba(24, 37, 29, 0.04), 0 8px 24px -16px rgba(24, 37, 29, 0.18);
}

.basket-page .basket-items {
	list-style: none;
	margin: 0;
	padding: 0 24px;
}

/* Item */
.basket-item {
	align-items: center;
	display: grid;
	gap: 8px 20px;
	grid-template-areas: "image info qty total";
	grid-template-columns: 96px minmax(0, 1fr) auto 130px;
	padding: 22px 0;
}

.basket-item + .basket-item {
	border-top: 1px solid var(--co-line);
}

.basket-item-image {
	align-items: center;
	align-self: start;
	background: #f6f8f6;
	border: 1px solid var(--co-line);
	border-radius: 10px;
	color: #a6b2aa;
	display: flex;
	font-size: 28px;
	grid-area: image;
	height: 96px;
	justify-content: center;
	overflow: hidden;
	width: 96px;
}

.basket-item-image img {
	height: 100%;
	object-fit: contain;
	width: 100%;
}

.basket-item-info {
	grid-area: info;
	min-width: 0;
}

.basket-page .basket-item-name {
	color: var(--co-ink);
	display: block;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 4px;
	overflow-wrap: anywhere;
}

.basket-item-variation {
	color: var(--co-text);
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 4px;
}

.basket-item-meta {
	color: var(--co-muted);
	font-size: 13px;
	line-height: 1.5;
	margin: 0 0 10px;
}

.basket-pill {
	align-items: center;
	border-radius: 999px;
	display: inline-flex;
	font-size: 12px;
	font-weight: 600;
	gap: 6px;
	line-height: 1.35;
	padding: 4px 10px;
}

.basket-pill.is-in-stock {
	background: var(--co-green-tint);
	color: var(--co-green);
}

.basket-pill.is-backorder {
	background: var(--co-amber-tint);
	color: var(--co-amber);
}

.basket-pill.is-unavailable {
	background: var(--co-red-tint);
	border-radius: 8px;
	color: var(--co-red);
	padding: 6px 10px;
}

/* Quantity stepper */
.basket-item-qty {
	grid-area: qty;
}

.basket-stepper {
	align-items: center;
	background: #fff;
	border: 1px solid var(--co-field);
	border-radius: 10px;
	display: inline-flex;
	padding: 3px;
}

.basket-page .basket-qty-btn {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 7px;
	color: var(--co-ink);
	cursor: pointer;
	display: inline-flex;
	font-size: 12px;
	height: 36px;
	justify-content: center;
	padding: 0;
	transition: background-color 0.15s;
	width: 36px;
}

.basket-page .basket-qty-btn:hover {
	background: var(--co-green-tint);
	color: var(--co-green);
}

.basket-page .basket-qty-btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(8, 123, 54, 0.2);
	outline: 0;
}

.basket-page .basket-qty-input {
	-moz-appearance: textfield;
	background: transparent;
	border: 0;
	color: var(--co-ink);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	height: 36px;
	padding: 0;
	text-align: center;
	width: 52px;
}

.basket-page .basket-qty-input:focus {
	outline: 0;
}

.basket-page .basket-qty-input::-webkit-inner-spin-button,
.basket-page .basket-qty-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.basket-stepper:focus-within {
	border-color: var(--co-green);
	box-shadow: 0 0 0 3px rgba(8, 123, 54, 0.15);
}

/* Line total and remove */
.basket-item-total {
	align-items: flex-end;
	display: flex;
	flex-direction: column;
	gap: 2px;
	grid-area: total;
	text-align: right;
}

.basket-line-price {
	color: var(--co-ink);
	font-size: 17px;
	font-weight: 700;
	white-space: nowrap;
}

.basket-unit-price {
	color: var(--co-muted);
	font-size: 12px;
	white-space: nowrap;
}

.basket-page .basket-remove {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: var(--co-muted);
	cursor: pointer;
	display: inline-flex;
	font-size: 13px;
	font-weight: 600;
	gap: 6px;
	margin-top: 8px;
	padding: 4px 6px;
	transition: color 0.15s, background-color 0.15s;
}

.basket-page .basket-remove:hover {
	background: var(--co-red-tint);
	color: var(--co-red);
}

.basket-page .basket-remove:focus-visible {
	box-shadow: 0 0 0 3px rgba(176, 42, 55, 0.2);
	outline: 0;
}

/* Variation that can no longer be ordered */
.basket-item.is-unavailable .basket-item-image,
.basket-item.is-unavailable .basket-line-price,
.basket-item.is-unavailable .basket-unit-price {
	opacity: 0.45;
}

.basket-item.is-unavailable .basket-line-price {
	text-decoration: line-through;
}

.basket-item.is-unavailable .basket-stepper {
	opacity: 0.45;
	pointer-events: none;
}

/* Summary */
.basket-sidebar {
	position: sticky;
	top: 20px;
}

.basket-summary {
	padding: 24px;
}

.basket-page .basket-summary h2 {
	color: var(--co-ink);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 16px;
}

.basket-summary-row {
	align-items: baseline;
	color: var(--co-muted);
	display: flex;
	font-size: 14px;
	gap: 16px;
	justify-content: space-between;
	margin-bottom: 10px;
}

.basket-summary-row strong {
	color: var(--co-text);
	font-weight: 600;
	white-space: nowrap;
}

.basket-summary-total {
	align-items: baseline;
	background: var(--co-green-tint);
	border-radius: 10px;
	color: var(--co-ink);
	display: flex;
	font-size: 16px;
	font-weight: 700;
	justify-content: space-between;
	margin: 14px 0 12px;
	padding: 14px 16px;
}

.basket-summary-total strong {
	color: var(--co-green);
	font-size: 22px;
	white-space: nowrap;
}

.basket-shipping-note {
	align-items: flex-start;
	color: var(--co-muted);
	display: flex;
	font-size: 13px;
	gap: 8px;
	line-height: 1.5;
	margin: 0;
}

.basket-shipping-note i {
	color: var(--co-green);
	margin-top: 3px;
}

.basket-summary .basket-alert {
	font-size: 13px;
	margin: 16px 0 0;
}

.basket-page .basket-checkout {
	align-items: center;
	background: var(--co-green);
	border: 1px solid var(--co-green);
	border-radius: 10px;
	box-shadow: 0 6px 16px -8px rgba(8, 123, 54, 0.6);
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 16px;
	font-weight: 700;
	gap: 10px;
	justify-content: center;
	margin-top: 18px;
	min-height: 52px;
	padding: 12px 18px;
	transition: background-color 0.15s;
	width: 100%;
}

.basket-page .basket-checkout:hover,
.basket-page .basket-checkout:focus {
	background: var(--co-green-dark);
	border-color: var(--co-green-dark);
	color: #fff;
}

.basket-page .basket-checkout:focus-visible {
	box-shadow: 0 0 0 4px rgba(8, 123, 54, 0.25);
	outline: 0;
}

.basket-page .basket-checkout:disabled {
	background: #7f9787;
	border-color: #7f9787;
	box-shadow: none;
	cursor: not-allowed;
}

.basket-page .basket-continue {
	align-items: center;
	color: var(--co-muted);
	display: inline-flex;
	font-size: 14px;
	font-weight: 600;
	gap: 6px;
	margin-top: 14px;
	padding: 4px 0;
	text-decoration: none;
}

.basket-page .basket-continue:hover {
	color: var(--co-green);
}

/* Empty and loading states */
.basket-empty {
	padding: 56px 24px;
	text-align: center;
}

.basket-empty-icon {
	align-items: center;
	background: var(--co-green-tint);
	border-radius: 50%;
	color: var(--co-green);
	display: inline-flex;
	font-size: 30px;
	height: 72px;
	justify-content: center;
	margin-bottom: 16px;
	width: 72px;
}

.basket-page .basket-empty h2 {
	color: var(--co-ink);
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 8px;
}

.basket-page .basket-empty p {
	color: var(--co-muted);
	font-size: 15px;
	margin: 0 0 22px;
}

.basket-page .basket-empty .basket-checkout {
	display: inline-flex;
	margin: 0;
	text-decoration: none;
	width: auto;
}

.basket-loading {
	color: var(--co-muted);
	font-size: 15px;
	padding: 72px 0;
	text-align: center;
}

.basket-spinner {
	animation: basket-spin 0.8s linear infinite;
	border: 3px solid var(--co-line);
	border-radius: 50%;
	border-top-color: var(--co-green);
	display: inline-block;
	height: 40px;
	margin-bottom: 14px;
	width: 40px;
}

@keyframes basket-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.basket-spinner {
		animation-duration: 2.4s;
	}
}

@media screen and (max-width: 991px) {
	.basket-layout {
		gap: 20px;
		grid-template-columns: minmax(0, 1fr);
	}

	.basket-sidebar {
		position: static;
	}
}

@media screen and (max-width: 767px) {
	.basket-item {
		grid-template-areas:
			"image info info"
			"image qty total";
		grid-template-columns: 80px auto minmax(0, 1fr);
	}

	.basket-item-image {
		height: 80px;
		width: 80px;
	}
}

@media screen and (max-width: 575px) {
	.basket-page {
		padding: 20px 0 48px;
	}

	.basket-page .basket-header h1 {
		font-size: 24px;
	}

	.basket-page .basket-items {
		border-radius: 10px;
		padding: 0 16px;
	}

	.basket-item {
		gap: 10px 14px;
		grid-template-areas:
			"image info"
			"qty total";
		grid-template-columns: 72px minmax(0, 1fr);
		padding: 18px 0;
	}

	.basket-item-image {
		height: 72px;
		width: 72px;
	}

	.basket-summary {
		border-radius: 10px;
		padding: 18px 16px 20px;
	}
}
