/* ==========================================================================
   Admitech — Snelbestellen (/snelbestellen/, shortcode [adm_snelbestellen])
   Prijs (actie), voorraad en toast: zie catalog.css en tokens.css.
   ========================================================================== */

.adm-qo { display: flex; flex-direction: column; gap: 24px; }
.adm-qo .adm-crumbs { margin: 0; }

/* --- Kop ----------------------------------------------------------------- */
.adm-qo__top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.adm-qo__intro { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.adm-qo__title { margin: 0; font: 900 var(--adm-fs-4xl)/1.05 var(--adm-font-head); color: var(--black); }
.adm-qo__lead { max-width: 640px; font-size: var(--adm-fs-base); line-height: var(--adm-lh-body); color: var(--steel-gray); }
.adm-qo__lead p { margin: 0 0 8px; }
.adm-qo__lead p:last-child { margin-bottom: 0; }

.adm-qo__steps { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 15px; }
.adm-qo__steps li { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.adm-qo__steps span {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--black);
	color: var(--white);
	font: 700 14px/1 var(--adm-font-head);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Hulpkaart: rechts in de kop; op mobiel onder de lijst. */
.adm-qo__help {
	flex: 0 1 320px;
	min-width: 260px;
	box-sizing: border-box;
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	background: var(--white);
	border: 1px solid var(--light-gray);
	border-radius: var(--adm-radius);
}
.adm-qo__help-title { margin: 0; font: 700 17px/1.3 var(--adm-font-head); }
.adm-qo__help p { margin: 0; font-size: var(--adm-fs-sm); line-height: 1.5; color: var(--steel-gray); }
.adm-qo__help-line { display: inline-flex; align-items: center; gap: 10px; min-height: 32px; font-weight: 600; color: var(--black); text-decoration: none; }
a.adm-qo__help-line:hover { color: var(--red); }
.adm-qo__help-hours { font-size: 13px; color: var(--steel-gray); }
.adm-qo__help--end { display: none; }

/* --- Bestellijst ---------------------------------------------------------- */
.adm-qo__form {
	margin: 0;
	background: var(--white);
	border: 1px solid var(--light-gray);
	border-radius: var(--adm-radius);
	overflow: hidden;
}
.adm-qo__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding: 16px 20px; }
.adm-qo__h2 { margin: 0; font: 700 var(--adm-fs-lg)/1.3 var(--adm-font-head); }
.adm-qo__tip { flex: 1 1 420px; margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: var(--adm-fs-sm); color: var(--steel-gray); }
.adm-qo__tip .adm-icon { flex: none; }

.adm-qo .adm-qo__clear {
	height: 36px;
	padding: 0 10px;
	border: 0;
	border-radius: var(--adm-radius);
	background: transparent;
	color: var(--steel-gray);
	font: 600 14px var(--adm-font-body);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.adm-qo .adm-qo__clear:hover { background: var(--off-white); color: var(--black); }

/* Tabel (vierkant, kop zwart zoals de variantentabel). */
.adm-qo__table { overflow-x: auto; border-top: 1px solid var(--light-gray); }
.adm-qo__cols,
.adm-qo__row {
	display: grid;
	grid-template-columns: 32px 240px 92px minmax(0, 1fr) 130px 120px 44px;
	gap: 12px;
	align-items: center;
	min-width: 980px;
	box-sizing: border-box;
	padding: 10px 20px;
}
.adm-qo__cols { background: var(--black); color: var(--white); font: 600 13px/1.2 var(--adm-font-head); }
.adm-qo__col-num { text-align: right; }
.adm-qo__row { min-height: 64px; border-top: 1px solid #E8EBEE; font-size: var(--adm-fs-sm); }
.adm-qo__rows > .adm-qo__row:first-child { border-top: 0; }
.adm-qo__n { color: var(--steel-gray); font-variant-numeric: tabular-nums; }

/* Velden */
.adm-qo .adm-qo__code-input,
.adm-qo .adm-qo__qty-input,
.adm-qo .adm-qo__variant {
	width: 100%;
	height: 44px;
	box-sizing: border-box;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--silver);
	border-radius: var(--adm-radius);
	background: var(--white);
	color: var(--black);
	font: 15px var(--adm-font-body);
	box-shadow: none;
}
.adm-qo .adm-qo__code-input { font: 500 15px var(--adm-font-mono); }
.adm-qo .adm-qo__qty-input { padding: 0 8px 0 10px; font-variant-numeric: tabular-nums; }
.adm-qo .adm-qo__variant { max-width: 360px; padding: 0 10px; font-size: var(--adm-fs-sm); }
.adm-qo .adm-qo__code-input::placeholder,
.adm-qo .adm-qo__qty-input::placeholder { color: #8A939C; opacity: 1; }
.adm-qo .adm-qo__code-input:focus,
.adm-qo .adm-qo__qty-input:focus,
.adm-qo .adm-qo__variant:focus { border-color: var(--black); }

/* Status van de regel: rand van het veld (dikker via box-shadow, zodat niets verspringt). */
.adm-qo__row[data-state="notfound"] .adm-qo__code-input,
.adm-qo__row[data-state="error"] .adm-qo__code-input { border-color: var(--brick); box-shadow: 0 0 0 1px var(--brick); }
.adm-qo__row[data-state="family"]:not(.is-chosen) .adm-qo__code-input,
.adm-qo__row[data-state="family"]:not(.is-chosen) .adm-qo__variant { border-color: var(--ochre); box-shadow: 0 0 0 1px var(--ochre); }

/* Productcel, prijs, totaal: op desktop elk een eigen kolom. */
.adm-qo__info { display: contents; }
.adm-qo__product { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.adm-qo__price { display: flex; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.adm-qo__price .adm-price__now { font-weight: 600; }
.adm-qo__mult { display: none; }
.adm-qo__total { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-qo__none,
.adm-qo__empty { color: #8A939C; font-weight: 400; }
.adm-qo__loading { color: var(--steel-gray); }

.adm-qo__name { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--black); text-decoration: none; }
a.adm-qo__name:hover { color: var(--red); }
.adm-qo__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--steel-gray); }
.adm-qo__meta .adm-stock { font-size: 13px; }
.adm-qo__meta .adm-stock::before { width: 8px; height: 8px; }
.adm-qo__nr { color: var(--black); }
.adm-qo__fam { display: flex; flex-direction: column; gap: 2px; }

.adm-qo__msg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1.35; }
.adm-qo__msg .adm-icon { flex: none; }
.adm-qo__msg--error { gap: 8px; font-size: var(--adm-fs-sm); font-weight: 600; color: var(--brick); }
.adm-qo__msg--warn { color: var(--ochre); }

.adm-qo .adm-qo__remove {
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--adm-radius);
	background: transparent;
	color: var(--steel-gray);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.adm-qo .adm-qo__remove:hover { background: var(--off-white); color: var(--black); }
/* Zonder JavaScript heeft verwijderen geen functie. */
.adm-qo__form:not(.is-js) .adm-qo__remove { visibility: hidden; }

/* --- Onderkant: regel toevoegen, subtotaal, knop -------------------------- */
.adm-qo__foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px 24px;
	padding: 16px 20px;
	border-top: 1px solid var(--light-gray);
	background: var(--off-white);
}
.adm-qo__addrow[hidden] + .adm-qo__submit { margin-left: auto; }

.adm-qo .adm-qo__addrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 16px;
	border: 1px solid var(--silver);
	border-radius: var(--adm-radius);
	background: var(--white);
	color: var(--black);
	font: 600 15px var(--adm-font-body);
	cursor: pointer;
}
.adm-qo .adm-qo__addrow:hover { border-color: var(--black); }
.adm-qo .adm-qo__addrow[hidden] { display: none; }

.adm-qo__submit { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 24px; }
.adm-qo__sum { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.adm-qo__sum[hidden] { display: none; }
.adm-qo__subtotal[hidden] { display: none; }
.adm-qo__subtotal { margin: 0; display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 4px 10px; }
.adm-qo__sum-label { font-size: var(--adm-fs-sm); color: var(--steel-gray); }
.adm-qo__sum-amount { font: 700 var(--adm-fs-xl)/1.2 var(--adm-font-head); font-variant-numeric: tabular-nums; }
.adm-qo__sum-vat { font-size: 13px; color: var(--steel-gray); }
.adm-qo__skipped { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--steel-gray); text-align: right; }
.adm-qo__skipped[hidden] { display: none; }
.adm-qo__skipped .adm-icon { flex: none; }

.adm-qo .adm-qo__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: var(--adm-radius);
	background: var(--black);
	color: var(--white);
	font: 600 15px var(--adm-font-body);
	cursor: pointer;
	transition: background-color .15s;
}
.adm-qo .adm-qo__btn:hover { background: var(--steel-gray); }
.adm-qo .adm-qo__btn.is-loading { opacity: .7; cursor: progress; }

.adm-qo__note { margin: -8px 0 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--steel-gray); }
.adm-qo__note .adm-icon { flex: none; }
.adm-qo__note [hidden] { display: none; }

/* Toast zonder link (bij een foutmelding). */
.adm-toast__link[hidden] { display: none; }

/* --- Mobiel --------------------------------------------------------------- */
@media (max-width: 719px) {
	.adm-qo { gap: 16px; }
	.adm-qo__title { font-size: var(--adm-fs-3xl); }
	.adm-qo__lead { font-size: 15px; }
	.adm-qo__steps,
	.adm-qo__tip { display: none; }
	.adm-qo__top > .adm-qo__help { display: none; }
	.adm-qo__help--end { display: flex; min-width: 0; padding: 16px; }

	/* Geen overflow: hidden, anders blijft de knop onderin niet staan (sticky). */
	.adm-qo__form { overflow: visible; }
	.adm-qo__head { padding: 8px 8px 8px 16px; flex-wrap: nowrap; }
	.adm-qo .adm-qo__clear { height: 44px; }

	.adm-qo__table { overflow: visible; }
	.adm-qo__cols,
	.adm-qo__row {
		grid-template-columns: 16px minmax(0, 1fr) 68px 36px;
		gap: 10px 8px;
		min-width: 0;
		padding: 12px 16px;
	}
	.adm-qo__cols { padding-top: 8px; padding-bottom: 8px; font-size: 12px; }
	.adm-qo__col-product,
	.adm-qo__col-num { display: none; }
	.adm-qo__n { font-size: 13px; }
	.adm-qo__row { min-height: 0; }
	.adm-qo .adm-qo__code-input { padding: 0 10px; }
	.adm-qo .adm-qo__qty-input { padding: 0 6px 0 8px; }
	.adm-qo .adm-qo__variant { max-width: none; font-size: 15px; }
	.adm-qo .adm-qo__remove { grid-row: 1; grid-column: 4; width: 36px; }

	/* Productinfo onder de velden, in een grijs vlak: links naam/nummer/voorraad, rechts totaal en prijs. */
	.adm-qo__info {
		grid-row: 2;
		grid-column: 2 / -1;
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 4px 12px;
		align-items: start;
		padding: 10px 12px;
		border-radius: var(--adm-radius);
		background: var(--off-white);
	}
	.adm-qo__product { grid-column: 1; grid-row: 1 / span 2; }
	.adm-qo__total { grid-column: 2; grid-row: 1; font-size: 16px; font-weight: 700; }
	.adm-qo__price { grid-column: 2; grid-row: 2; align-items: flex-start; gap: 4px; font-size: 13px; color: var(--steel-gray); white-space: nowrap; }
	.adm-qo__mult { display: inline; }
	.adm-qo__price .adm-price { flex-direction: column-reverse; }
	.adm-qo__price .adm-price.is-net { flex-direction: column; }
	.adm-qo__price .adm-price__now { font-weight: 600; color: var(--black); }
	.adm-qo__price .adm-price.is-sale .adm-price__now { color: var(--red); }

	/* Zonder bestelbaar artikel: geen prijs/totaal, info over de volle breedte. */
	.adm-qo__row[data-state="empty"] .adm-qo__info { display: none; }
	.adm-qo__row:not([data-state="ok"]):not(.is-chosen) .adm-qo__price,
	.adm-qo__row:not([data-state="ok"]):not(.is-chosen) .adm-qo__total { display: none; }
	.adm-qo__row:not([data-state="ok"]):not(.is-chosen) .adm-qo__product { grid-column: 1 / -1; grid-row: 1; }
	.adm-qo__row[data-state="notfound"] .adm-qo__info,
	.adm-qo__row[data-state="error"] .adm-qo__info,
	.adm-qo__row[data-state="loading"] .adm-qo__info { padding: 0; background: none; }
	.adm-qo__row[data-state="family"] .adm-qo__product { align-items: stretch; gap: 8px; }

	/* Regel toevoegen in de lijst; subtotaal en knop blijven onderin in beeld. */
	.adm-qo__foot { display: contents; }
	.adm-qo .adm-qo__addrow { justify-content: center; width: calc(100% - 32px); margin: 0 16px 12px; }
	.adm-qo__submit {
		position: sticky;
		bottom: 0;
		z-index: 5;
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		padding: 12px 16px;
		border-top: 1px solid var(--light-gray);
		border-radius: 0 0 var(--adm-radius) var(--adm-radius);
		background: var(--white);
	}
	.adm-qo__sum { align-items: stretch; }
	.adm-qo__subtotal { justify-content: flex-end; column-gap: 6px; }
	.adm-qo__sum-label { margin-right: auto; }
	.adm-qo__skipped { text-align: left; }
	.adm-qo .adm-qo__btn { width: 100%; height: 48px; font-size: 16px; }

	.adm-qo__note { margin: 0; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.adm-qo .adm-qo__btn { transition: none; }
}
