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

.lpw {
	--lpw-accent: #d50f2d;
	--lpw-price: var(--lpw-accent);
	--lpw-text: #111827;
	--lpw-muted: #5f6672;
	--lpw-card: #ffffff;
	--lpw-border: #e3e5e8;
	--lpw-selected: var(--lpw-accent);
	--lpw-badge-bg: #fde8eb;
	--lpw-badge-text: #b40d27;
	--lpw-unavailable: #f2f4f6;
	--lpw-radius: 14px;
	--lpw-control-radius: 8px;
	--lpw-ease: cubic-bezier(0.2, 0, 0, 1);

	color: var(--lpw-text);
	font-size: 15px;
	line-height: 1.5;
}

/* A size container on .lpw itself makes this Elementor flex item reserve
   the whole column height, which leaves a gap under the last card. The
   column is the container, so the narrow-column rules still see the same
   width and the widget grows with the cards. */
.e-con:has(> .elementor-widget-astra-landing-products) {
	container-type: inline-size;
}

@container (max-width: 600px) {
	.lpw .lpw-card__attributes {
		flex-direction: column;
		gap: 18px;
	}

	.lpw .lpw-attr {
		flex: none;
	}
}

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

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

.lpw button {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
	text-transform: none;
	margin: 0;
	cursor: pointer;
	/* WoodMart button overrides */
	background: none;
	border: 0;
	box-shadow: none;
	outline: none;
	line-height: inherit;
	min-height: 0;
	min-width: 0;
	text-decoration: none;
	vertical-align: baseline;
}

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

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

/* Card list */

.lpw .lpw__list {
	display: grid;
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Card */

.lpw .lpw-card {
	margin: 0;
	background: var(--lpw-card);
	border: 1px solid var(--lpw-border);
	border-radius: var(--lpw-radius);
	overflow: hidden;
	transition: border-color 0.2s var(--lpw-ease), box-shadow 0.2s var(--lpw-ease);
}

.lpw .lpw-card.is-selected {
	border-color: var(--lpw-selected);
}

.lpw .lpw-card__head {
	display: grid;
	grid-template-columns: auto auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 22px;
	padding: 22px 22px 22px 22px;
	cursor: pointer;
}

.lpw .lpw-card.is-unavailable .lpw-card__head {
	cursor: default;
}

.lpw .lpw-card__check {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 1.5px solid var(--lpw-border);
	border-radius: 50%;
	background: var(--lpw-card);
	color: transparent;
	font-size: 14px;
	transition: background-color 0.18s var(--lpw-ease), border-color 0.18s var(--lpw-ease), color 0.18s var(--lpw-ease);
}

.lpw .lpw-card__check svg {
	stroke-width: 2.6;
}

.lpw .lpw-card__check:hover:not(:disabled) {
	border-color: var(--lpw-accent);
}

.lpw .lpw-card.is-selected .lpw-card__check {
	background: var(--lpw-accent);
	border-color: var(--lpw-accent);
	color: #fff;
}

.lpw .lpw-card__media {
	width: 96px;
	height: 96px;
	border-radius: 10px;
	background: var(--lpw-unavailable);
	overflow: hidden;
}

/* `.elementor img` is one class plus the element, which beats a lone class
   and resets radius, shadow, height, and max-width. Two classes under .lpw
   put these images back in charge, inside Elementor and outside it. */
.lpw .lpw-card__media img,
.elementor .lpw .lpw-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
}

.lpw .lpw-card.is-unavailable .lpw-card__media img {
	filter: grayscale(1);
	opacity: 0.75;
}

.lpw .lpw-card__info {
	min-width: 0;
}

/* The badge lives in this heading. The parent theme's heading font would
   otherwise replace the font set on the widget. */
.lpw h3.lpw-card__name {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 0 0 6px;
	color: var(--lpw-text);
	font-family: inherit;
	font-size: 20px;
	font-style: inherit;
	font-weight: 700;
	letter-spacing: inherit;
	line-height: 1.25;
	text-transform: none;
}

.lpw .lpw-card__name-text {
	font: inherit;
}

.lpw .lpw-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--lpw-badge-bg);
	color: var(--lpw-badge-text);
	font-family: inherit;
	font-size: 11px;
	font-style: inherit;
	font-weight: 600;
	letter-spacing: inherit;
	line-height: 1.4;
	text-transform: none;
	white-space: nowrap;
}

.lpw .lpw-badge--muted {
	background: var(--lpw-unavailable);
	color: var(--lpw-muted);
}

.lpw .lpw-card__desc {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--lpw-muted);
	font-size: 14px;
	line-height: 1.45;
	line-clamp: 2;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.lpw .lpw-card__price {
	margin: 0;
	max-width: 9.5rem;
	color: var(--lpw-price);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
	text-align: right;
	white-space: normal;
}

.lpw .lpw-card.is-unavailable .lpw-card__price {
	color: var(--lpw-muted);
	font-size: 15px;
}

.lpw .lpw-card.is-unavailable .lpw-card__name-text,
.lpw .lpw-card.is-unavailable .lpw-card__desc {
	opacity: 0.85;
}

.lpw .lpw-card__unavailable {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 14px 22px;
	border-top: 1px solid var(--lpw-border);
	background: var(--lpw-unavailable);
	color: var(--lpw-muted);
	font-size: 13px;
}

.lpw .lpw-card__unavailable svg {
	font-size: 16px;
}

/* Options */

.lpw .lpw-card__options {
	border-top: 1px solid var(--lpw-border);
	padding: 22px;
	animation: lpw-reveal 0.22s var(--lpw-ease);
}

.lpw .lpw-card__options[hidden] {
	display: none;
}

@keyframes lpw-reveal {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
}

.lpw .lpw-card__attributes {
	display: flex;
	flex-wrap: wrap;
	gap: 22px 40px;
	margin-bottom: 22px;
}

.lpw .lpw-attr {
	flex: 1 1 200px;
	min-width: 0;
}

.lpw .lpw-attr--button {
	flex: 1.3 1 260px;
}

.lpw .lpw-attr__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 24px;
	margin-bottom: 12px;
}

.lpw .lpw-attr__label {
	margin: 0;
	color: var(--lpw-text);
	font-size: 14px;
	font-weight: 600;
}

.lpw .lpw-attr__chosen {
	margin-left: 4px;
	color: var(--lpw-muted);
	font-weight: 400;
}

.lpw .lpw-attr__options {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.lpw .lpw-option-wrap {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.lpw .lpw-option {
	position: relative;
	display: inline-grid;
	place-items: center;
	padding: 0;
	background: var(--lpw-card);
	border: 1px solid var(--lpw-border);
	transition: border-color 0.15s var(--lpw-ease), box-shadow 0.15s var(--lpw-ease), background-color 0.15s var(--lpw-ease);
}

.lpw .lpw-option:hover:not(:disabled) {
	border-color: var(--lpw-text);
}

.lpw .lpw-option.is-active {
	border-color: var(--lpw-accent);
	box-shadow: 0 0 0 1px var(--lpw-accent);
}

/* Colour swatches */

.lpw .lpw-option--color {
	width: 34px;
	height: 34px;
	border-radius: 50%;
}

.lpw .lpw-swatch {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--lpw-swatch, var(--lpw-unavailable));
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
	color: var(--lpw-muted);
	font-size: 11px;
	font-weight: 600;
}

.lpw .lpw-option--color.is-sold-out .lpw-swatch {
	opacity: 0.45;
}

.lpw .lpw-option--color.is-sold-out::after {
	content: "";
	position: absolute;
	inset: 50% 4px auto;
	height: 1.5px;
	background: var(--lpw-muted);
	transform: rotate(-45deg);
}

/* Size buttons */

.lpw .lpw-option--button {
	min-width: 48px;
	height: 40px;
	padding: 0 14px;
	border-radius: var(--lpw-control-radius);
	font-size: 13px;
	font-weight: 500;
}

.lpw .lpw-option--button.is-sold-out {
	background: var(--lpw-unavailable);
	color: var(--lpw-muted);
}

.lpw .lpw-option--button.is-sold-out .lpw-option__text {
	text-decoration: line-through;
}

.lpw .lpw-option__note {
	color: var(--lpw-muted);
	font-size: 10px;
	line-height: 1.2;
	visibility: hidden;
}

.lpw .lpw-option.is-sold-out + .lpw-option__note {
	visibility: visible;
}

/* Size chart link */

.lpw .lpw-chart-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 0;
	background: none;
	border: 0;
	color: var(--lpw-muted);
	font-size: 13px;
	white-space: nowrap;
	box-shadow: none;
}

.lpw .lpw-chart-link span {
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 3px;
	transition: text-decoration-color 0.15s var(--lpw-ease);
}

.lpw .lpw-chart-link:hover {
	color: var(--lpw-text);
}

.lpw .lpw-chart-link:hover span {
	text-decoration-color: currentColor;
}

/* Footer: quantity and note */

.lpw .lpw-card__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 20px;
}

.lpw .lpw-qty {
	display: inline-flex;
	align-items: center;
	height: 42px;
	padding: 0 6px;
	border: 1px solid var(--lpw-border);
	border-radius: 999px;
	background: var(--lpw-card);
}

.lpw .lpw-qty__step {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	color: var(--lpw-muted);
	font-size: 16px;
	transition: background-color 0.15s var(--lpw-ease), color 0.15s var(--lpw-ease);
}

.lpw .lpw-qty__step:hover:not(:disabled) {
	background: var(--lpw-unavailable);
	color: var(--lpw-text);
}

.lpw .lpw-qty__step:disabled {
	opacity: 0.35;
}

.lpw .lpw-qty__input {
	width: 40px;
	height: 30px;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
	color: var(--lpw-text);
	font: inherit;
	font-size: 14px;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

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

.lpw .lpw-card__note {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 0 auto;
	color: var(--lpw-muted);
	font-size: 13px;
}

.lpw .lpw-card__note svg {
	color: var(--lpw-accent);
	font-size: 14px;
}

.lpw .lpw-card__note:has([data-lpw-note-text]:empty) {
	visibility: hidden;
}

.lpw .lpw-card__note.is-error {
	color: var(--lpw-accent);
}

.lpw .lpw-card__note.is-error svg {
	display: none;
}

.lpw .lpw-card.is-busy .lpw-card__note {
	opacity: 0.6;
}

.lpw .lpw-card.is-busy .lpw-card__check,
.lpw .lpw-card.is-busy .lpw-option {
	pointer-events: none;
}

/* Size chart dialog */

.lpw .lpw-chart {
	width: fit-content;
	height: fit-content;
	max-width: none;
	max-height: none;
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.lpw .lpw-chart[open] {
	animation: lpw-dialog-in 0.2s var(--lpw-ease);
}

.lpw .lpw-chart::backdrop {
	background: rgba(15, 23, 42, 0.6);
	animation: lpw-fade-in 0.2s var(--lpw-ease);
}

@keyframes lpw-dialog-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
}

@keyframes lpw-fade-in {
	from {
		opacity: 0;
	}
}

.lpw img.lpw-chart__image,
.elementor .lpw img.lpw-chart__image {
	display: block;
	width: auto;
	height: auto;
	max-width: min(760px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	border: 0;
	border-radius: var(--lpw-radius);
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
	object-fit: contain;
}

.lpw .lpw-chart__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: rgba(255, 255, 255, 0.92);
	border: 0;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
	color: #111827;
	font-size: 18px;
	transition: background-color 0.15s var(--lpw-ease), transform 0.15s var(--lpw-ease);
}

.lpw .lpw-chart__close:hover {
	background: #ffffff;
	transform: scale(1.06);
}

/* Editor placeholder */

.lpw .lpw-placeholder {
	padding: 28px;
	border: 1px dashed #c8ccd2;
	border-radius: 12px;
	color: #5f6672;
	font-size: 14px;
	text-align: center;
}

.lpw .lpw-placeholder p {
	margin: 0;
}

@media (max-width: 640px) {
	.lpw .lpw-card__head {
		gap: 14px;
		padding: 16px;
	}

	.lpw .lpw-card__media {
		width: 72px;
		height: 72px;
	}

	.lpw h3.lpw-card__name {
		font-size: 17px;
	}

	.lpw .lpw-card__price {
		font-size: 16px;
	}

	.lpw .lpw-card__options {
		padding: 16px;
	}

	.lpw .lpw-card__attributes {
		gap: 18px;
	}

	.lpw .lpw-attr--button {
		flex-basis: 100%;
	}

	.lpw .lpw-card__unavailable {
		padding: 12px 16px;
	}

	.lpw .lpw-card__note {
		margin-left: 0;
		flex-basis: 100%;
	}
}

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