/* ── Schnellbestellung (Quick Order) block ───────────────────────────────── */

.riedel-quick-order {
	margin-top: 0 !important;
	padding-top: 40px;
	padding-bottom: 80px;
}

.riedel-quick-order__inner {
	width: 100%;
	max-width: var(--wp--style--global--content-size);
	margin-inline: auto;
}

.riedel-quick-order__heading {
	margin: 0 0 var(--wp--preset--spacing--2);
	font-size: var(--wp--preset--font-size--3-xl);
	font-weight: 600;
	color: var(--wp--preset--color--text-primary);
}

p.riedel-quick-order__description {
	margin: 0 0 var(--wp--preset--spacing--6);
	font-size: var(--wp--preset--font-size--base);
	color: var(--wp--preset--color--text-secondary);
}

.riedel-quick-order__layout {
	display: flex;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--8);
}

.riedel-quick-order__table-col {
	flex: 1 1 65%;
	min-width: 0;
}

.riedel-quick-order__summary-col {
	flex: 0 0 35%;
	width: 35%;
	max-width: 410px;
	position: sticky;
	top: 24px;
}

@media (max-width: 1023px) {
	.riedel-quick-order__layout {
		flex-direction: column;
		align-items: stretch;
	}

	.riedel-quick-order__summary-col {
		width: 100%;
		max-width: none;
		position: static;
	}
}

/* ── Table card ───────────────────────────────────────────────────────── */

.riedel-quick-order__table-card {
	overflow-x: auto;
	border: 1px solid var(--wp--preset--color--border-default);
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--preset--color--surface-default);
	box-shadow: 0px 1px 2px 0px #0000000D;
}

.riedel-quick-order__table {
	width: 100%;
	min-width: 640px;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--base);
}

.riedel-quick-order__head-row {
	background: var(--wp--preset--color--surface-secondary);
}

.riedel-quick-order__table th.riedel-quick-order__cell {
	padding: var(--wp--preset--spacing--3) var(--wp--preset--spacing--4);
	font-size: var(--wp--preset--font-size--base);
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--wp--preset--color--text-secondary);
	text-align: left;
	white-space: nowrap;
}

.riedel-quick-order__row {
	border-top: 1px solid var(--wp--preset--color--border-default);
}

.riedel-quick-order__table td.riedel-quick-order__cell {
	padding: var(--wp--preset--spacing--3) var(--wp--preset--spacing--4);
	vertical-align: middle;
}

.riedel-quick-order__cell--sku {
	width: 25%;
}

.riedel-quick-order__cell--name {
	min-width: 200px;
	font-size: var(--wp--preset--font-size--base);
	color: var(--wp--preset--color--text-primary);
}

.riedel-quick-order__cell--qty {
	width: 120px;
}

.riedel-quick-order__cell--price,
.riedel-quick-order__cell--total {
	width: 110px;
	white-space: nowrap;
	font-size: var(--wp--preset--font-size--base);
	color: var(--wp--preset--color--text-primary);
}

.riedel-quick-order__cell--total {
	font-weight: 600;
}

.riedel-quick-order__cell--remove {
	width: 90px;
	text-align: right;
}

.riedel-quick-order__hint {
	color: var(--wp--preset--color--text-tertiary);
	font-size: var(--wp--preset--font-size--sm);
}

.riedel-quick-order__error {
	color: var(--wp--preset--color--status-stock-out);
	font-size: var(--wp--preset--font-size--sm);
}

/* ── Loading state ────────────────────────────────────────────────────── */

.riedel-quick-order__loading {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--2);
	color: var(--wp--preset--color--text-tertiary);
	font-size: var(--wp--preset--font-size--sm);
}

.riedel-quick-order__spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid var(--wp--preset--color--border-strong);
	border-top-color: var(--wp--preset--color--action-primary);
	border-radius: var(--wp--custom--radius--full);
	animation: riedel-quick-order-spin 0.6s linear infinite;
}

.riedel-quick-order__row.is-loading {
	opacity: 0.85;
}

@keyframes riedel-quick-order-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.riedel-quick-order__spinner {
		animation-duration: 1.5s;
	}
}

/* ── Combobox / autocomplete ──────────────────────────────────────────── */

.riedel-quick-order__combobox {
	position: relative;
}

.riedel-quick-order__suggestions {
	position: fixed;
	z-index: 50;
	margin: 0;
	padding: var(--wp--preset--spacing--1);
	list-style: none;
	max-height: 280px;
	overflow-y: auto;
	background: var(--wp--preset--color--surface-default);
	border: 1px solid var(--wp--preset--color--border-strong);
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: 0px 8px 24px 0px #0000001A;
}

.riedel-quick-order__suggestions[hidden] {
	display: none;
}

.riedel-quick-order__suggestion {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--3);
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--3);
	border-radius: var(--wp--custom--radius--md);
	cursor: pointer;
}

.riedel-quick-order__suggestion.is-active,
.riedel-quick-order__suggestion:hover {
	background: var(--wp--preset--color--interactive-hover);
}

.riedel-quick-order__suggestion-name {
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.3;
}

.riedel-quick-order__suggestion-sku {
	flex-shrink: 0;
	color: var(--wp--preset--color--text-tertiary);
	font-size: var(--wp--preset--font-size--sm);
	white-space: nowrap;
}

.riedel-quick-order__suggestion--loading,
.riedel-quick-order__suggestion--empty {
	justify-content: flex-start;
	gap: var(--wp--preset--spacing--2);
	color: var(--wp--preset--color--text-tertiary);
	font-size: var(--wp--preset--font-size--base);
	cursor: default;
}

.riedel-quick-order__suggestion--loading:hover,
.riedel-quick-order__suggestion--empty:hover {
	background: transparent;
}

.riedel-quick-order .riedel-quick-order__sku-input {
	display: block;
	width: 100%;
	height: 38px;
	border: 1px solid var(--wp--preset--color--border-default);
	border-radius: var(--wp--custom--radius--md);
	background: var(--wp--preset--color--surface-secondary);
	outline: none;
	box-shadow: none;
	line-height: 1;
	color: var(--wp--preset--color--text-primary);
	padding: 0 var(--wp--preset--spacing--3);
	font-size: var(--wp--preset--font-size--base);
}

.riedel-quick-order .riedel-quick-order__sku-input::placeholder {
	color: var(--wp--preset--color--text-placeholder);
	opacity: 1;
}

.riedel-quick-order .riedel-quick-order__sku-input:focus {
	border-color: var(--wp--preset--color--action-primary);
	background: var(--wp--preset--color--surface-default);
}

/* ── Stepper (matches .riedel-cart__stepper) ─────────────────────────────── */

.riedel-quick-order .riedel-quick-order__stepper {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	border-radius: var(--wp--custom--radius--lg);
	border: 1px solid var(--wp--preset--color--border-default);
	background: var(--wp--preset--color--surface-default);
	padding: var(--wp--preset--spacing--1);
}

.riedel-quick-order .riedel-quick-order__stepper-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 28px;
	padding: 0;
	border: none;
	border-radius: 0;
	background: var(--wp--preset--color--surface-secondary);
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--md);
	cursor: pointer;
}

.riedel-quick-order .riedel-quick-order__stepper-btn:hover:not(:disabled) {
	background: var(--wp--preset--color--surface-tertiary);
}

.riedel-quick-order .riedel-quick-order__stepper-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.riedel-quick-order .riedel-quick-order__stepper-input {
	width: 36px;
	height: 28px;
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	outline: none;
	text-align: center;
	font-size: var(--wp--preset--font-size--base);
	color: var(--wp--preset--color--text-primary);
	-moz-appearance: textfield;
}

.riedel-quick-order .riedel-quick-order__stepper-input::-webkit-outer-spin-button,
.riedel-quick-order .riedel-quick-order__stepper-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.riedel-quick-order .riedel-quick-order__stepper-input:disabled {
	opacity: 0.4;
}

/* ── Remove link ──────────────────────────────────────────────────────── */

.riedel-quick-order .riedel-quick-order__remove {
	border: none;
	background: transparent;
	padding: 0;
	color: var(--wp--preset--color--action-primary);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	cursor: pointer;
}

.riedel-quick-order .riedel-quick-order__remove:hover:not(:disabled) {
	color: var(--wp--preset--color--action-primary-hover);
	text-decoration: underline;
}

.riedel-quick-order .riedel-quick-order__remove:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ── Add row button ───────────────────────────────────────────────────── */

.riedel-quick-order .riedel-quick-order__add-row {
	display: inline-flex;
	align-items: center;
	margin-top: var(--wp--preset--spacing--4);
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--4);
	border: 1px solid var(--wp--preset--color--border-strong);
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--preset--color--surface-default);
	color: var(--wp--preset--color--action-primary);
	font-size: var(--wp--preset--font-size--base);
	font-weight: 500;
	cursor: pointer;
}

.riedel-quick-order .riedel-quick-order__add-row:hover {
	background: var(--wp--preset--color--teal-action-light);
	border-color: var(--wp--preset--color--teal-action-border);
}

/* ── Summary card ─────────────────────────────────────────────────────── */

.riedel-quick-order__summary {
	background: var(--wp--preset--color--surface-default);
	border: 1px solid var(--wp--preset--color--border-default);
	border-radius: var(--wp--custom--radius--md);
	padding: var(--wp--preset--spacing--6);
}

.riedel-quick-order__summary-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: var(--wp--preset--spacing--2) 0;
	border-bottom: 1px solid var(--wp--preset--color--border-default);
	font-size: var(--wp--preset--font-size--base);
	color: var(--wp--preset--color--text-primary);
}

.riedel-quick-order__summary-row--meta {
	justify-content: flex-start;
	border-bottom: 1px solid var(--wp--preset--color--border-default);
	padding-bottom: var(--wp--preset--spacing--3);
	margin-bottom: var(--wp--preset--spacing--1);
	color: var(--wp--preset--color--text-secondary);
	font-weight: 500;
}

.riedel-quick-order__summary-row span:first-child {
	color: var(--wp--preset--color--text-secondary);
}

.riedel-quick-order__summary-row span:last-child {
	font-weight: 600;
}

.riedel-quick-order__summary-row--grand {
	border-bottom: none;
	border-top: 2px solid var(--wp--preset--color--text-primary);
	padding-top: var(--wp--preset--spacing--4);
	margin-top: var(--wp--preset--spacing--2);
}

.riedel-quick-order__summary-row--grand span:first-child {
	color: var(--wp--preset--color--text-primary);
	font-weight: 600;
}

.riedel-quick-order__summary-row--grand span:last-child {
	font-size: var(--wp--preset--font-size--xl);
}

.riedel-quick-order .riedel-quick-order__submit {
	width: 100%;
	margin-top: var(--wp--preset--spacing--6);
}

.riedel-quick-order .riedel-quick-order__submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.riedel-quick-order__feedback {
	display: none;
	margin: var(--wp--preset--spacing--3) 0 0;
	font-size: var(--wp--preset--font-size--sm);
	text-align: center;
}

.riedel-quick-order__feedback.is-success,
.riedel-quick-order__feedback.is-error {
	display: block;
}

.riedel-quick-order__feedback.is-success {
	color: var(--wp--preset--color--status-stock-in);
}

.riedel-quick-order__feedback.is-error {
	color: var(--wp--preset--color--status-stock-out);
}

@media (max-width: 767px) {
	.riedel-quick-order__cell--sku {
		width: 130px;
	}
}
