/* HdM Funnel LG – Produktanfrage-Funnel. Farben und Radien kommen als CSS-Variablen vom Widget (Stil-Tab). */
.hdm-funnel {
	--hdm-primary: #034FA1;
	--hdm-primary-text: #FFFFFF;
	--hdm-accent: #95B8A1;
	--hdm-heading: #042C57;
	--hdm-text: #54595F;
	--hdm-card: #FFFFFF;
	--hdm-card-border: #DFCEBE;
	--hdm-surface: #F5F3F5;
	--hdm-error: #B3261E;
	--hdm-radius: 12px;
	--hdm-radius-btn: 50px;
	--hdm-cols: 3;
	color: var(--hdm-text);
	max-width: 100%;
	min-width: 0;
	/* Schrift aus dem Elementor-Kit (Globale Typografie „Text“), sonst vom Theme */
	font-family: var(--e-global-typography-text-font-family, inherit);
	-webkit-text-size-adjust: 100%;
}
.hdm-funnel button, .hdm-funnel input, .hdm-funnel textarea { font-family: inherit; }
.hdm-funnel__title { font-family: var(--e-global-typography-primary-font-family, inherit); }
.hdm-funnel *, .hdm-funnel *::before, .hdm-funnel *::after { box-sizing: border-box; }
.hdm-funnel [hidden] { display: none !important; }
/* Theme- und Kit-Regeln für Buttons neutralisieren (Hello Elementor setzt u. a. white-space und Hintergrund). */
.hdm-funnel button { white-space: normal; text-transform: none; letter-spacing: normal; line-height: 1.4; box-shadow: none; }

/* Fortschritt (klickbar) */
.hdm-funnel__progress { display: flex; list-style: none; margin: 0 0 2rem; padding: 0; }
.hdm-funnel__progress li { flex: 1 1 0; position: relative; min-width: 0; }
.hdm-funnel__progress li::before { content: ""; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--hdm-card-border); z-index: 0; }
.hdm-funnel__progress li:last-child::before { display: none; }
.hdm-funnel .hdm-funnel__progress-btn {
	appearance: none; -webkit-appearance: none; background: none; border: 0; padding: 0; margin: 0; width: 100%; cursor: default;
	display: flex; flex-direction: column; align-items: center; gap: .4rem; font: inherit; font-size: .85rem; color: var(--hdm-text); opacity: .6;
}
.hdm-funnel__progress-num {
	position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	background: var(--hdm-surface); border: 2px solid var(--hdm-card-border); font-weight: 600; color: var(--hdm-heading); transition: transform .15s;
}
.hdm-funnel__progress li.is-active .hdm-funnel__progress-btn { opacity: 1; }
.hdm-funnel__progress li.is-active .hdm-funnel__progress-num { background: var(--hdm-primary); border-color: var(--hdm-primary); color: var(--hdm-primary-text); }
.hdm-funnel__progress li.is-done .hdm-funnel__progress-btn { opacity: 1; }
.hdm-funnel__progress li.is-done .hdm-funnel__progress-num { background: var(--hdm-accent); border-color: var(--hdm-accent); color: #fff; }
.hdm-funnel__progress li.is-done::before { background: var(--hdm-accent); }
.hdm-funnel .hdm-funnel__progress-btn { cursor: pointer; }
.hdm-funnel__progress li.is-reachable .hdm-funnel__progress-btn { opacity: 1; }
.hdm-funnel__progress li.is-reachable .hdm-funnel__progress-btn:hover .hdm-funnel__progress-num { transform: scale(1.08); border-color: var(--hdm-primary); }

/* Schritte */
.hdm-funnel__step { display: none; animation: hdmFade .25s ease; }
.hdm-funnel__step.is-active { display: block; }
.hdm-funnel--editor .hdm-funnel__step { display: block; border-top: 1px dashed var(--hdm-card-border); padding-top: 1.5rem; margin-top: 1.5rem; }
.hdm-funnel--editor .hdm-funnel__step.is-active { border-top: 0; padding-top: 0; margin-top: 0; }
@keyframes hdmFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hdm-funnel__title { margin: 0 0 .4rem; color: var(--hdm-heading); font-size: 1.5rem; line-height: 1.25; }
.hdm-funnel__help { margin: 0 0 1.25rem; }
.hdm-funnel__notice { background: #fff8e5; border: 1px solid #e6c46b; padding: 1rem; border-radius: var(--hdm-radius); color: #6b4f00; }

/* Karten (Schritt 1) */
.hdm-funnel__cards { display: grid; grid-template-columns: repeat(var(--hdm-cols), minmax(0, 1fr)); gap: 1rem; }
.hdm-funnel__cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hdm-funnel .hdm-funnel__card {
	appearance: none; -webkit-appearance: none; position: relative; width: 100%; min-width: 0; text-align: left; cursor: pointer; font: inherit; color: inherit;
	background: var(--hdm-card); border: 2px solid var(--hdm-card-border); border-radius: var(--hdm-radius);
	padding: 1.1rem 2.4rem 1.1rem 1.2rem; display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; height: 100%;
	transition: border-color .15s, box-shadow .15s, transform .15s; overflow: hidden;
}
.hdm-funnel .hdm-funnel__card:hover, .hdm-funnel .hdm-funnel__card:focus-visible { border-color: var(--hdm-primary); box-shadow: 0 6px 20px rgba(4,44,87,.08); transform: translateY(-1px); outline: none; background: var(--hdm-card); color: inherit; }
.hdm-funnel .hdm-funnel__card.is-selected { border-color: var(--hdm-primary); box-shadow: inset 0 0 0 1px var(--hdm-primary); }
.hdm-funnel .hdm-funnel__card.is-selected::after { content: "✓"; position: absolute; top: .6rem; right: .8rem; color: var(--hdm-primary); font-weight: 700; }
.hdm-funnel__card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: calc(var(--hdm-radius) - 4px); margin-bottom: .4rem; background: var(--hdm-surface); }
.hdm-funnel__card-label, .hdm-funnel__card-text { display: block; max-width: 100%; white-space: normal; overflow-wrap: break-word; hyphens: auto; }
.hdm-funnel__card-label { font-weight: 600; color: var(--hdm-heading); font-size: 1.05rem; }
.hdm-funnel__card-text { font-size: .9rem; line-height: 1.45; }

/* Reiter je Produktart */
.hdm-funnel__tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; margin: 0 0 1rem; }
.hdm-funnel .hdm-funnel__tab {
	appearance: none; -webkit-appearance: none; position: relative; min-width: 0; cursor: pointer; font: inherit; color: var(--hdm-heading); text-align: left;
	background: var(--hdm-card); border: 2px solid var(--hdm-card-border); border-radius: var(--hdm-radius); padding: .8rem 2.4rem .8rem 1rem;
	display: flex; flex-direction: column; gap: .15rem; transition: border-color .15s, background .15s;
}
.hdm-funnel .hdm-funnel__tab:hover { border-color: var(--hdm-primary); background: var(--hdm-card); color: var(--hdm-heading); }
.hdm-funnel .hdm-funnel__tab.is-active { border-color: var(--hdm-primary); background: var(--hdm-primary); color: var(--hdm-primary-text); }
.hdm-funnel .hdm-funnel__tab.is-active .hdm-funnel__tab-text { color: inherit; opacity: .85; }
.hdm-funnel__tab-img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: calc(var(--hdm-radius) - 6px); margin-bottom: .35rem; }
.hdm-funnel__tab-label { font-weight: 600; font-size: 1rem; overflow-wrap: break-word; hyphens: auto; }
.hdm-funnel__tab-text { font-size: .82rem; line-height: 1.35; color: var(--hdm-text); overflow-wrap: break-word; hyphens: auto; }
.hdm-funnel__badge {
	position: absolute; top: .55rem; right: .6rem; min-width: 22px; height: 22px; padding: 0 .4rem; border-radius: 11px;
	background: var(--hdm-accent); color: #fff; font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.hdm-funnel .hdm-funnel__tab.is-active .hdm-funnel__badge { background: #fff; color: var(--hdm-primary); }

/* Chips je Ausführung */
.hdm-funnel__chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.hdm-funnel .hdm-funnel__chip {
	appearance: none; -webkit-appearance: none; position: relative; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 500; color: var(--hdm-heading);
	background: var(--hdm-surface); border: 1px solid var(--hdm-card-border); border-radius: var(--hdm-radius-btn); padding: .45rem 1rem; transition: border-color .15s, background .15s;
	display: inline-flex; align-items: center; gap: .5rem;
}
.hdm-funnel .hdm-funnel__chip:hover { border-color: var(--hdm-primary); background: var(--hdm-surface); color: var(--hdm-heading); }
.hdm-funnel .hdm-funnel__chip.is-active { background: var(--hdm-heading); border-color: var(--hdm-heading); color: #fff; }
.hdm-funnel .hdm-funnel__chip .hdm-funnel__badge { position: static; min-width: 20px; height: 20px; font-size: .7rem; }
.hdm-funnel .hdm-funnel__chip.is-active .hdm-funnel__badge { background: #fff; color: var(--hdm-heading); }

/* Artikelliste */
.hdm-funnel__panel { margin-bottom: 1.5rem; }
.hdm-funnel__group { margin: .25rem 0 .6rem; font-weight: 600; color: var(--hdm-heading); font-size: .95rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
.hdm-funnel__group-help { font-weight: 400; color: var(--hdm-text); font-size: .85rem; }
.hdm-funnel__list { display: flex; flex-direction: column; gap: .5rem; }
.hdm-funnel__row {
	display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 1rem;
	background: var(--hdm-card); border: 1px solid var(--hdm-card-border); border-radius: var(--hdm-radius); padding: .6rem 1rem;
}
.hdm-funnel__row.has-qty { border-color: var(--hdm-primary); background: color-mix(in srgb, var(--hdm-primary) 5%, var(--hdm-card)); }
.hdm-funnel__row-name { font-weight: 500; color: var(--hdm-heading); overflow-wrap: break-word; hyphens: auto; }
.hdm-funnel__row-sub { display: block; font-size: .8rem; color: var(--hdm-text); font-weight: 400; }
.hdm-funnel__qty { display: flex; align-items: center; gap: .35rem; }
.hdm-funnel .hdm-funnel__qty input {
	width: 90px; min-height: 40px; padding: .4rem .6rem; border: 1px solid var(--hdm-card-border); border-radius: 8px; font: inherit; text-align: right;
	background: #fff; color: var(--hdm-heading); margin: 0;
}
.hdm-funnel .hdm-funnel__qty input:focus { outline: 2px solid var(--hdm-primary); outline-offset: 1px; border-color: var(--hdm-primary); }
.hdm-funnel__qty-unit { font-size: .85rem; white-space: nowrap; }

/* Freitext */
.hdm-funnel .hdm-funnel__textarea {
	width: 100%; min-height: 140px; padding: .8rem 1rem; border: 1px solid var(--hdm-card-border); border-radius: var(--hdm-radius); font: inherit; color: var(--hdm-heading); background: #fff;
}
.hdm-funnel .hdm-funnel__textarea:focus { outline: 2px solid var(--hdm-primary); outline-offset: 1px; }

/* Auswahlliste (unter dem Katalog) und Übersicht (über dem Formular) */
.hdm-funnel__picked, .hdm-funnel__summary { background: var(--hdm-surface); border-radius: var(--hdm-radius); padding: 1rem 1.25rem; margin: 0 0 1.5rem; }
.hdm-funnel__picked-head, .hdm-funnel__summary-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; color: var(--hdm-heading); }
.hdm-funnel__picked-count { font-size: .85rem; color: var(--hdm-text); }
.hdm-funnel__picked-body, .hdm-funnel__summary-body { font-size: .95rem; line-height: 1.5; }
.hdm-funnel__empty { color: var(--hdm-text); opacity: .8; }
.hdm-funnel__sum-group { font-weight: 600; color: var(--hdm-heading); margin: .6rem 0 .25rem; }
.hdm-funnel__sum-group:first-child { margin-top: 0; }
.hdm-funnel__sum-item { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; padding: .4rem .6rem; background: var(--hdm-card); border-radius: 8px; margin-bottom: .3rem; }
.hdm-funnel__sum-qty { margin-left: auto; }
.hdm-funnel__sum-name { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.hdm-funnel__sum-name--text { white-space: pre-line; }
.hdm-funnel__sum-qty { white-space: nowrap; font-weight: 600; color: var(--hdm-heading); }
.hdm-funnel .hdm-funnel__remove {
	appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 28px; height: 28px; padding: 0; margin: 0; border-radius: 50%; border: 1px solid var(--hdm-card-border);
	background: #fff; color: var(--hdm-text); font-size: 1.1rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.hdm-funnel .hdm-funnel__remove:hover { background: var(--hdm-error); border-color: var(--hdm-error); color: #fff; }
.hdm-funnel__form .elementor-field-group.hdm-hidden { display: none !important; }
.hdm-funnel__form textarea[readonly] { background: var(--hdm-surface); }

/* Danke-Ansicht nach dem Absenden */
.hdm-funnel__done { text-align: center; padding: 2.5rem 1.5rem; background: var(--hdm-surface); border-radius: var(--hdm-radius); animation: hdmFade .3s ease; }
.hdm-funnel__done-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--hdm-accent); color: #fff; font-size: 1.6rem; font-weight: 700; margin-bottom: 1rem; }
.hdm-funnel__done .hdm-funnel__title { margin-bottom: .5rem; }
.hdm-funnel__done .hdm-funnel__help { margin: 0; }

/* Links, Buttons, Fehler */
.hdm-funnel .hdm-funnel__link { appearance: none; background: none; border: 0; padding: 0; color: var(--hdm-primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.hdm-funnel .hdm-funnel__link:hover { background: none; color: var(--hdm-heading); }
.hdm-funnel__nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.hdm-funnel__nav:empty { display: none; }
.hdm-funnel__nav .hdm-funnel__btn--primary:only-of-type:not([hidden]) { margin-left: auto; }
.hdm-funnel .hdm-funnel__btn {
	appearance: none; -webkit-appearance: none; cursor: pointer; font: inherit; font-weight: 600; letter-spacing: .02em;
	padding: .8rem 1.6rem; border-radius: var(--hdm-radius-btn); border: 2px solid var(--hdm-primary); transition: background .15s, color .15s;
}
.hdm-funnel .hdm-funnel__btn--primary { background: var(--hdm-primary); color: var(--hdm-primary-text); }
.hdm-funnel .hdm-funnel__btn--primary:hover { background: var(--hdm-heading); border-color: var(--hdm-heading); color: #fff; }
.hdm-funnel .hdm-funnel__btn--ghost { background: transparent; color: var(--hdm-primary); }
.hdm-funnel .hdm-funnel__btn--ghost:hover { background: var(--hdm-surface); color: var(--hdm-primary); }
.hdm-funnel__error { margin: 1rem 0 0; color: var(--hdm-error); font-weight: 600; }

/* Mobil */
@media (max-width: 767px) {
	.hdm-funnel__title { font-size: 1.3rem; }
	.hdm-funnel__help { font-size: .95rem; margin-bottom: 1rem; }
	.hdm-funnel__progress { margin-bottom: 1.5rem; }
	.hdm-funnel__progress-label { font-size: .72rem; }
	.hdm-funnel__cards, .hdm-funnel__cards--2 { grid-template-columns: 1fr; gap: .75rem; }
	.hdm-funnel .hdm-funnel__card { padding: .9rem 2.2rem .9rem 1rem; }

	/* Reiter und Chips als horizontal wischbare Leisten (kein Umbruch, Beschreibungen ausgeblendet) */
	.hdm-funnel__tabs, .hdm-funnel__chips {
		display: flex; flex-wrap: nowrap; gap: .5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
		margin: 0 -4px .9rem; padding: 2px 4px 6px; scrollbar-width: none;
	}
	.hdm-funnel__tabs::-webkit-scrollbar, .hdm-funnel__chips::-webkit-scrollbar { display: none; }
	.hdm-funnel .hdm-funnel__tab { flex: 0 0 auto; scroll-snap-align: start; flex-direction: row; align-items: center; gap: .5rem; padding: .6rem .9rem; border-radius: var(--hdm-radius-btn); }
	.hdm-funnel .hdm-funnel__tab .hdm-funnel__tab-text, .hdm-funnel .hdm-funnel__tab .hdm-funnel__tab-img { display: none; }
	.hdm-funnel .hdm-funnel__tab .hdm-funnel__badge { position: static; min-width: 20px; height: 20px; font-size: .7rem; }
	.hdm-funnel .hdm-funnel__chip { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; }

	/* Artikelzeilen: Name links, Menge rechts, in einer Zeile */
	.hdm-funnel__group { font-size: .9rem; }
	.hdm-funnel__group-help { display: block; width: 100%; }
	.hdm-funnel__row { grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; padding: .5rem .75rem; }
	.hdm-funnel__row-name { font-size: .92rem; line-height: 1.3; }
	.hdm-funnel .hdm-funnel__qty input { width: 72px; min-height: 38px; padding: .3rem .5rem; }
	.hdm-funnel__qty-unit { font-size: .78rem; }

	/* Listen und Übersicht */
	.hdm-funnel__picked, .hdm-funnel__summary { padding: .85rem .9rem; }
	.hdm-funnel__picked-body, .hdm-funnel__summary-body { font-size: .9rem; }
	.hdm-funnel__sum-item { padding: .35rem .5rem; }
	.hdm-funnel .hdm-funnel__remove { width: 26px; height: 26px; }

	.hdm-funnel__nav { flex-direction: column-reverse; gap: .6rem; margin-top: 1.2rem; }
	.hdm-funnel .hdm-funnel__btn { width: 100%; padding: .85rem 1rem; }
	.hdm-funnel__done { padding: 1.8rem 1rem; }
}
