/**
 * Landing page cart.
 *
 * Every colour is a --lcw-* variable so the Elementor Style tab can restyle
 * the cart without touching layout. Everything is scoped under .lcw so
 * nothing leaks into the rest of the landing page.
 */

.lcw {
	--lcw-accent: #d50f2d;
	--lcw-text: #111827;
	--lcw-muted: #5f6672;
	--lcw-background: #ffffff;
	--lcw-border: #e3e5e8;
	--lcw-track: #eef0f2;
	--lcw-success: #15803d;
	--lcw-chosen: var(--lcw-accent);
	--lcw-chosen-bg: color-mix(in srgb, var(--lcw-chosen) 5%, var(--lcw-background));
	--lcw-fill-start: var(--lcw-accent);
	--lcw-fill-end: var(--lcw-accent);
	--lcw-radius: 14px;
	--lcw-control-radius: 8px;
	--lcw-ease: cubic-bezier(0.2, 0, 0, 1);

	padding: 22px;
	color: var(--lcw-text);
	background: var(--lcw-background);
	border: 1px solid var(--lcw-border);
	border-radius: var(--lcw-radius);
	font-size: 15px;
	line-height: 1.5;
}

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

.lcw [hidden] {
	display: none !important;
}

.lcw svg {
	width: 1em;
	height: 1em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}

.lcw button,
.lcw input {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
	text-transform: none;
	margin: 0;
}

.lcw button {
	cursor: pointer;
}

.lcw button:disabled {
	cursor: not-allowed;
}

.lcw button:focus-visible,
.lcw input:focus-visible {
	outline: 2px solid var(--lcw-accent);
	outline-offset: 2px;
}

.lcw .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Head */

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

.lcw .lcw__title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: 1.25em;
	font-weight: 700;
	line-height: 1.3;
}

.lcw__count {
	color: var(--lcw-muted);
	font-size: 0.875em;
	white-space: nowrap;
}

/* Stands where the product rows go, so an empty cart keeps its full layout. */
.lcw .lcw__empty {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 16px 0 0;
	padding: 22px 16px;
	color: var(--lcw-muted);
	background: var(--lcw-track);
	border: 1px dashed var(--lcw-border);
	border-radius: 12px;
	text-align: center;
}

.lcw__empty svg {
	width: 1.4em;
	height: 1.4em;
}

/* Lines */

.lcw__lines {
	display: grid;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
	/* On .lcw this container makes the Elementor widget taller than the
	   cart. The line list is the element the narrow rule actually styles. */
	container-type: inline-size;
}

.lcw-line {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 14px;
	margin: 0;
	padding: 12px 0;
	border-top: 1px solid var(--lcw-border);
	transition: opacity 0.2s var(--lcw-ease);
}

.lcw-line:first-child {
	border-top: 0;
	padding-top: 0;
}

.lcw-line.is-busy {
	opacity: 0.45;
	pointer-events: none;
}

/* Elementor's `.elementor img` rule outranks a lone class. */
.lcw img.lcw-line__image,
.elementor .lcw img.lcw-line__image {
	display: block;
	width: 56px;
	height: 56px;
	max-width: none;
	margin: 0;
	object-fit: cover;
	background: var(--lcw-track);
	border: 0;
	border-radius: var(--lcw-control-radius);
	box-shadow: none;
}

.lcw-line__info {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.lcw-line__name {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.lcw-line__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
	font-size: 0.8em;
	line-height: 1.2;
}

/* Colour, size, and quantity as labelled chips. */
.lcw-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 9px;
	background: var(--lcw-track);
	border: 1px solid var(--lcw-border);
	border-radius: 999px;
	white-space: nowrap;
}

.lcw-chip__label {
	color: var(--lcw-muted);
}

.lcw-chip__value {
	color: var(--lcw-text);
	font-weight: 600;
}

.lcw-chip__swatch {
	width: 12px;
	height: 12px;
	background: var(--lcw-swatch);
	border-radius: 999px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
	flex-shrink: 0;
}

.lcw-chip--quantity {
	background: var(--lcw-background);
}

.lcw-line__total {
	font-weight: 600;
	white-space: nowrap;
}

.lcw .lcw-line__remove {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	padding: 0;
	color: var(--lcw-muted);
	background: transparent;
	border: 1px solid var(--lcw-border);
	border-radius: 999px;
	box-shadow: none;
	transition: color 0.15s var(--lcw-ease), border-color 0.15s var(--lcw-ease);
}

.lcw .lcw-line__remove:hover {
	color: var(--lcw-accent);
	background: transparent;
	border-color: var(--lcw-accent);
}

/* Totals */

.lcw__totals {
	display: grid;
	gap: 8px;
	margin: 16px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--lcw-border);
}

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

.lcw__row dt,
.lcw__row dd {
	margin: 0;
	font-weight: inherit;
}

.lcw__row dt {
	color: var(--lcw-muted);
}

.lcw__row dd {
	text-align: right;
}

.lcw__row--discount dd {
	color: var(--lcw-success);
}

.lcw__totals--grand {
	margin-top: 18px;
}

.lcw__row--total {
	align-items: baseline;
	font-size: 1.2em;
	font-weight: 700;
}

.lcw__row--total dt {
	color: inherit;
}

/* Shipping options as full-width cards */

.lcw-shipping {
	margin-top: 18px;
}

.lcw .lcw-shipping__title {
	margin: 0 0 10px;
	color: var(--lcw-muted);
	font-size: 0.75em;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.lcw-shipping__options {
	display: grid;
	gap: 10px;
}

.lcw .lcw-rate {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 14px 16px;
	background: var(--lcw-background);
	border: 1px solid var(--lcw-border);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.15s var(--lcw-ease), background-color 0.15s var(--lcw-ease), box-shadow 0.15s var(--lcw-ease);
}

.lcw .lcw-rate:hover {
	border-color: var(--lcw-chosen);
}
.lcw .lcw-rate.is-chosen {
	background: var(--lcw-chosen-bg);
	border-color: var(--lcw-chosen);
	box-shadow: 0 0 0 1px var(--lcw-chosen);
}

.lcw .lcw-rate input {
	width: 18px;
	height: 18px;
	margin: 0;
	flex-shrink: 0;
	accent-color: var(--lcw-chosen);
	cursor: pointer;
}

.lcw-rate__label {
	flex: 1;
	min-width: 0;
	font-weight: 600;
}

.lcw-rate__cost {
	font-weight: 700;
	white-space: nowrap;
}

.lcw__note {
	margin: 10px 0 0;
	color: var(--lcw-muted);
	font-size: 0.85em;
}

/* Coupon */

.lcw-coupon {
	margin-top: 16px;
	padding: 14px 16px;
	border: 1px solid var(--lcw-border);
	border-radius: 12px;
}

.lcw .lcw-coupon__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 0;
	color: var(--lcw-accent);
	background: transparent;
	border: 0;
	box-shadow: none;
	font-weight: 600;
	text-align: left;
}

.lcw .lcw-coupon__toggle:hover {
	color: var(--lcw-accent);
	background: transparent;
	text-decoration: underline;
}

.lcw-coupon__panel {
	margin-top: 10px;
}

.lcw-coupon__help {
	margin: 0 0 8px;
	color: var(--lcw-muted);
	font-size: 0.9em;
}

.lcw-coupon__form {
	display: flex;
	gap: 8px;
	margin: 0;
}

.lcw .lcw-coupon__input {
	flex: 1;
	min-width: 0;
	height: 42px;
	padding: 0 12px;
	color: var(--lcw-text);
	background: var(--lcw-background);
	border: 1px solid var(--lcw-border);
	border-radius: var(--lcw-control-radius);
	box-shadow: none;
}

/* Replaces the parent theme's blue dotted focus ring. */
.lcw .lcw-coupon__input:focus,
.lcw .lcw-coupon__input:focus-visible {
	border-color: var(--lcw-accent);
	outline: 0;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--lcw-accent) 15%, transparent);
}

.lcw .lcw-coupon__apply {
	height: 42px;
	padding: 0 18px;
	color: #ffffff;
	background: var(--lcw-accent);
	border: 0;
	border-radius: var(--lcw-control-radius);
	box-shadow: none;
	font-weight: 600;
	transition: opacity 0.15s var(--lcw-ease);
}

.lcw .lcw-coupon__apply:hover {
	color: #ffffff;
	background: var(--lcw-accent);
	opacity: 0.9;
}

.lcw .lcw-coupon__apply:disabled {
	opacity: 0.6;
}

.lcw-coupon__applied {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--lcw-success);
	font-weight: 600;
}

.lcw .lcw-coupon__remove {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	padding: 0;
	color: var(--lcw-muted);
	background: transparent;
	border: 0;
	border-radius: 999px;
	box-shadow: none;
}

.lcw .lcw-coupon__remove:hover {
	color: var(--lcw-accent);
	background: transparent;
}

.lcw-coupon__error {
	margin: 8px 0 0;
	color: var(--lcw-accent);
	font-size: 0.9em;
}

/* Free delivery progress */

.lcw-progress {
	margin-top: 16px;
	padding: 16px;
	border: 1px solid var(--lcw-border);
	border-radius: 12px;
}

.lcw .lcw-progress__text {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
	font-size: 0.95em;
	font-weight: 500;
	line-height: 1.4;
}

.lcw-progress__text svg {
	width: 1.25em;
	height: 1.25em;
	color: var(--lcw-accent);
}

.lcw-progress__amount {
	color: var(--lcw-accent);
	font-weight: 700;
}

.lcw-progress__track {
	height: 10px;
	overflow: hidden;
	background: var(--lcw-track);
	border-radius: 999px;
}

.lcw-progress__fill {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--lcw-fill-start), var(--lcw-fill-end));
	border-radius: inherit;
	transition: width 0.4s var(--lcw-ease);
}

.lcw .lcw-progress__scale {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: 8px 0 0;
	color: var(--lcw-muted);
	font-size: 0.78em;
}

.lcw-progress.is-unlocked .lcw-progress__text,
.lcw-progress.is-unlocked .lcw-progress__text svg {
	color: var(--lcw-success);
	font-weight: 700;
}

.lcw-progress.is-unlocked .lcw-progress__fill {
	background: var(--lcw-success);
}

/* Narrow columns and phones */

@container (max-width: 380px) {
	.lcw .lcw-line {
		grid-template-columns: 48px minmax(0, 1fr) auto;
		gap: 10px 12px;
	}

	.lcw img.lcw-line__image,
	.elementor .lcw img.lcw-line__image {
		width: 48px;
		height: 48px;
	}

	.lcw .lcw-line__total {
		grid-column: 2;
		grid-row: 2;
	}

	.lcw .lcw-line__remove {
		grid-column: 3;
		grid-row: 1 / span 2;
	}
}

@media (max-width: 640px) {
	.lcw {
		padding: 18px;
	}
}

.lcw-placeholder {
	padding: 24px;
	color: #5f6672;
	text-align: center;
	background: #f7f8fa;
	border: 1px dashed #d1d5db;
	border-radius: 14px;
}

.lcw-placeholder p {
	margin: 0;
}

@media (prefers-reduced-motion: reduce) {
	.lcw *,
	.lcw *::before,
	.lcw *::after {
		transition: none !important;
	}
}
