/**
 * Lef Creative - Herroepingsplicht — front-end styles.
 *
 * Fully self-contained: scoped under `.lef-hp`, driven by a single accent
 * variable (set inline from the plugin setting) plus hard-coded neutrals, so it
 * renders consistently on any WooCommerce theme without inheriting theme tokens.
 */

.lef-hp {
	--lef-hp-accent: #2d6df6;
	--lef-hp-text: #1f2733;
	--lef-hp-muted: #6b7280;
	--lef-hp-border: #e2e4e8;
	--lef-hp-bg-soft: #f4f5f7;
	--lef-hp-error-bg: #fdecea;
	--lef-hp-error-text: #b3261e;
	--lef-hp-radius: 10px;
	--lef-hp-max-width: none;

	color: var(--lef-hp-text);
	line-height: 1.55;

	/* Width is capped via the --lef-hp-max-width token (set inline from the
	   container_width setting; defaults to none = full width) and centred. */
	max-width: var(--lef-hp-max-width);
	margin-left: auto;
	margin-right: auto;
}

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

/* ── Heading / intro ──────────────────────────────────────────── */
.lef-hp-pagehead {
	margin-bottom: 28px;
}

.lef-hp-intro p:last-child {
	margin-bottom: 0;
}

.lef-hp-subtitle {
	font-size: 1.25rem;
	margin: 0 0 16px;
}

.lef-hp-lead {
	margin-bottom: 24px;
}

/* ── Loading state ────────────────────────────────────────────── */
.lef-hp-inner {
	position: relative;
	transition: opacity 0.2s ease;
}

.lef-hp-inner.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

.lef-hp-inner.is-loading::after {
	content: "";
	position: absolute;
	top: 40px;
	left: 50%;
	width: 36px;
	height: 36px;
	margin-left: -18px;
	border: 3px solid var(--lef-hp-border);
	border-top-color: var(--lef-hp-accent);
	border-radius: 50%;
	animation: lef-hp-spin 0.7s linear infinite;
}

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

/* ── Notices ──────────────────────────────────────────────────── */
.lef-hp-notice {
	padding: 14px 18px;
	border-radius: var(--lef-hp-radius);
	margin-bottom: 24px;
	background-color: var(--lef-hp-bg-soft);
	color: var(--lef-hp-text);
}

.lef-hp-notice p:last-child {
	margin-bottom: 0;
}

.lef-hp-notice--error {
	background-color: var(--lef-hp-error-bg);
	color: var(--lef-hp-error-text);
}

/* ── Buttons ──────────────────────────────────────────────────── */
.lef-hp-btn {
	display: inline-block;
	padding: 12px 24px;
	border: none;
	border-radius: var(--lef-hp-radius);
	background-color: var(--lef-hp-accent);
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.lef-hp-btn:hover,
.lef-hp-btn:focus {
	filter: brightness(0.92);
	color: #fff;
}

.lef-hp-actions {
	margin-top: 24px;
}

/* ── Forms ────────────────────────────────────────────────────── */
.lef-hp-field {
	margin-bottom: 18px;
}

.lef-hp-field label {
	display: block;
	margin-bottom: 5px;
	font-weight: 700;
}

/* Plugin field styling. Skipped when `lef-hp--theme-fields` is set (the
   "theme styling for fields" toggle), so the host theme styles the inputs. */
.lef-hp:not(.lef-hp--theme-fields) .lef-hp-field input[type="text"],
.lef-hp:not(.lef-hp--theme-fields) .lef-hp-field input[type="email"],
.lef-hp:not(.lef-hp--theme-fields) .lef-hp-field textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--lef-hp-border);
	border-radius: var(--lef-hp-radius);
	background: #fff;
	color: var(--lef-hp-text);
	font: inherit;
}

.lef-hp:not(.lef-hp--theme-fields) .lef-hp-field input:focus,
.lef-hp:not(.lef-hp--theme-fields) .lef-hp-field textarea:focus {
	outline: none;
	border-color: var(--lef-hp-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--lef-hp-accent) 20%, transparent);
}

.lef-hp-field textarea {
	resize: vertical;
	min-height: 90px;
}

/* ── Order summary ────────────────────────────────────────────── */
.lef-hp-summary {
	padding: 22px 24px;
	margin-bottom: 28px;
	border: 1px solid var(--lef-hp-border);
	border-radius: 12px;
	background-color: #fff;
}

.lef-hp-summary__meta {
	margin: 0;
}

.lef-hp-summary__row {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	padding: 8px 0;
	border-top: 1px solid var(--lef-hp-border);
}

.lef-hp-summary__row:first-child {
	border-top: none;
	padding-top: 0;
}

.lef-hp-summary__row dt {
	flex: 0 0 140px;
	margin: 0;
	font-weight: 600;
}

.lef-hp-summary__row dd {
	flex: 1;
	margin: 0;
	min-width: 180px;
}

.lef-hp-summary__row--address dd {
	line-height: 1.5;
}

.lef-hp-summary__notes {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid var(--lef-hp-border);
}

.lef-hp-summary__notes h3 {
	font-size: 1rem;
	margin: 0 0 10px;
}

.lef-hp-summary__notes ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lef-hp-summary__notes li {
	padding: 10px 14px;
	border-radius: 8px;
	background-color: var(--lef-hp-bg-soft);
	margin-bottom: 8px;
}

.lef-hp-summary__notes li:last-child {
	margin-bottom: 0;
}

.lef-hp-note__date {
	display: block;
	font-size: 0.8rem;
	opacity: 0.7;
	margin-bottom: 2px;
}

.lef-hp-note__content p:last-child {
	margin-bottom: 0;
}

/* ── Items ────────────────────────────────────────────────────── */
.lef-hp-items {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
}

.lef-hp-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border: 1px solid var(--lef-hp-border);
	transition: background-color 0.15s ease;
}

.lef-hp-item:first-child {
	border-top-left-radius: var(--lef-hp-radius);
	border-top-right-radius: var(--lef-hp-radius);
}

.lef-hp-item:not(:first-child) {
	border-top: none;
}

.lef-hp-item:last-child {
	border-bottom-left-radius: var(--lef-hp-radius);
	border-bottom-right-radius: var(--lef-hp-radius);
}

.lef-hp-item:has(.lef-hp-item__toggle:checked),
.lef-hp-item.is-selected {
	border-color: var(--lef-hp-accent);
	background: color-mix(in srgb, var(--lef-hp-accent) 8%, transparent);
}

.lef-hp-item__select {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	cursor: pointer;
	flex: 1;
	min-width: 0;
}

.lef-hp-item__toggle {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--lef-hp-accent);
}

.lef-hp-item__image {
	flex: 0 0 56px;
}

.lef-hp-item__image img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}

.lef-hp-item__name {
	font-weight: 600;
	line-height: 1.3;
}

.lef-hp-item__qty {
	display: flex;
	align-items: center;
	gap: 12px;
}

.lef-hp-item__qty-max {
	font-size: 0.85rem;
	opacity: 0.7;
	white-space: nowrap;
}

/* ── Quantity control (self-contained, replaces theme .quantity) ── */
.lef-hp-qty {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--lef-hp-border);
	border-radius: var(--lef-hp-radius);
	overflow: hidden;
	background: #fff;
}

.lef-hp-qty__minus,
.lef-hp-qty__plus {
	width: 36px;
	border: none;
	background: var(--lef-hp-bg-soft);
	color: var(--lef-hp-text);
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
}

.lef-hp-qty__minus:hover,
.lef-hp-qty__plus:hover {
	background: #e7e9ee;
}

.lef-hp-qty__input {
	width: 48px;
	border: none;
	border-left: 1px solid var(--lef-hp-border);
	border-right: 1px solid var(--lef-hp-border);
	text-align: center;
	font: inherit;
	color: var(--lef-hp-text);
	-moz-appearance: textfield;
	appearance: textfield;
}

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

/* Disabled when the line isn't selected → grey it out. */
.lef-hp-qty:has(.lef-hp-qty__input:disabled) {
	opacity: 0.5;
	pointer-events: none;
}

/* On narrow screens stack the rows. */
@media only screen and (max-width: 575px) {
	.lef-hp-item__select {
		flex: 0 0 100%;
	}

	.lef-hp-item__qty {
		flex: 0 0 100%;
		justify-content: flex-start;
	}
}

/* ── Disclaimer + confirm checkbox ────────────────────────────── */
.lef-hp-disclaimer {
	margin-bottom: 20px;
}

.lef-hp-disclaimer p:last-child {
	margin-bottom: 0;
}

.lef-hp-confirm-check {
	margin-bottom: 20px;
}

.lef-hp-confirm-check label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	cursor: pointer;
}

.lef-hp-confirm-check input {
	flex: 0 0 auto;
	margin-top: 3px;
	width: 18px;
	height: 18px;
	accent-color: var(--lef-hp-accent);
}

/* ── Confirmation ─────────────────────────────────────────────── */
.lef-hp-confirmation__notice {
	padding: 28px 24px;
	border: 1px solid var(--lef-hp-border);
	border-radius: 12px;
	background: var(--lef-hp-bg-soft);
	text-align: center;
}

.lef-hp-confirmation__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 14px;
	border-radius: 50%;
	background: var(--lef-hp-accent);
	color: #fff;
}

.lef-hp-confirmation__title {
	margin: 0 0 12px;
	font-size: 1.4rem;
}

.lef-hp-confirmation__body p:last-child {
	margin-bottom: 0;
}

.lef-hp-confirmation__overview {
	margin-top: 24px;
	padding: 22px 24px;
	border: 1px solid var(--lef-hp-border);
	border-radius: 12px;
	background: #fff;
}

.lef-hp-confirmation__heading {
	font-size: 1.1rem;
	margin: 0 0 14px;
}

.lef-hp-confirmation__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lef-hp-confirmation__items li {
	padding: 6px 0;
	border-top: 1px solid var(--lef-hp-border);
}

.lef-hp-confirmation__items li:first-child {
	border-top: none;
	padding-top: 0;
}

.lef-hp-confirmation__qty {
	font-weight: 600;
}

/* ── Order-page / account button wrapper ──────────────────────── */
.lef-hp-order-actions {
	margin: 16px 0 0;
}
