/**
 * BARKE Tools — Design (Master)
 *
 * Dies ist die ALLEINIGE Designquelle für ROI-Rechner und Standzeit-Tracker.
 * Sie ist bewusst so geschrieben, dass sie die Enfold-Theme-Defaults schlägt,
 * OHNE dass die Theme-Datei form-styles.css mithelfen muss:
 *   - Selektoren sind mit #top .barke-tool gescoped (hohe Spezifität auf der
 *     Live-Seite, wo alles innerhalb von #top liegt).
 *   - Auf den wenigen Eigenschaften, die Enfold erzwingt (Hintergrund, Rahmen,
 *     Farbe, Schrift, Mindesthöhe der Felder), steht gezielt !important.
 *
 * Schriftfamilie: kommt über die Variable --bt-font (Standard: inherit, also
 * die Schrift der Seite). Falls die Seitenschrift nicht korrekt erbt, genügt es,
 * --bt-font EINMAL unten auf den konkreten Namen zu setzen
 * (z. B. --bt-font: "Open Sans", Arial, sans-serif;).
 */

#top .barke-tool {
	/* Liest die gemeinsamen Tokens aus der Theme-form-styles.css (#top).
	   Die Fallback-Werte nach dem Komma machen das Plugin eigenständig,
	   falls die Datei fehlt. Eigene Variablennamen (--bt-*) vermeiden den
	   Zirkelbezug einer sich selbst referenzierenden Variable. */
	--bt-blue: var(--barke-blue, #004687);
	--bt-orange: var(--barke-orange, #EC6709);
	--bt-field: var(--barke-light, #EEF4FA);
	--bt-border: var(--barke-border, #C8DAEC);
	--bt-muted: var(--barke-muted, #5A6B7B);
	--bt-text: #1A1A1A;
	--bt-font: inherit; /* hier bei Bedarf konkreten Schriftnamen setzen */

	font-family: var(--bt-font);
	color: var(--bt-text);
	background: #FFFFFF;
	max-width: 940px;
	margin: 0;
	box-sizing: border-box;
	line-height: 1.5;
}
#top .barke-tool *,
#top .barke-tool *::before,
#top .barke-tool *::after { box-sizing: border-box; }

/* Schrift konsequent auf ALLE Elemente inkl. Formular-Controls anwenden
   (input/select/textarea/button erben font-family sonst nicht zuverlässig). */
#top .barke-tool,
#top .barke-tool p,
#top .barke-tool h3,
#top .barke-tool h4,
#top .barke-tool label,
#top .barke-tool input,
#top .barke-tool select,
#top .barke-tool textarea,
#top .barke-tool button,
#top .barke-tool a {
	font-family: var(--bt-font) !important;
}

/* ---------- Kopf ---------- */
#top .barke-tool .barke-head { margin-bottom: 24px; }
#top .barke-tool .barke-h3 {
	color: var(--bt-blue);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 10px;
}
#top .barke-tool .barke-intro {
	color: var(--bt-muted);
	font-size: 15px;
	margin: 0;
}

/* ---------- Hinweis-Box ---------- */
#top .barke-tool .barke-note {
	background: var(--bt-field);
	border-left: 3px solid var(--bt-blue);
	padding: 14px 18px;
	font-size: 13px;
	color: var(--bt-muted);
	margin-bottom: 24px;
}

/* ---------- Felder & Labels ---------- */
#top .barke-tool .barke-field { margin-bottom: 20px; }
#top .barke-tool .barke-label {
	display: block;
	font-weight: 700;
	color: var(--bt-blue);
	margin-bottom: 8px;
}
#top .barke-tool .barke-req { color: var(--bt-orange); }
#top .barke-tool .barke-hint {
	font-size: 13px;
	color: var(--bt-muted);
	margin: 6px 0 0;
}

/* ---------- Eingabefelder (unser Design, gegen Enfold gehärtet) ---------- */
#top .barke-tool input:not([type="button"]):not([type="submit"]):not([type="range"]):not([type="radio"]):not([type="checkbox"]),
#top .barke-tool select,
#top .barke-tool textarea {
	width: 100% !important;
	background-color: #FFFFFF !important;
	border: 2px solid var(--bt-border) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 11px 14px !important;
	min-height: 0 !important;
	font-size: 16px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	color: var(--bt-text) !important;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
#top .barke-tool input:not([type="button"]):not([type="submit"]):not([type="range"]):not([type="radio"]):not([type="checkbox"]):focus,
#top .barke-tool input:not([type="button"]):not([type="submit"]):not([type="range"]):not([type="radio"]):not([type="checkbox"]):active,
#top .barke-tool select:focus,
#top .barke-tool select:active,
#top .barke-tool textarea:focus,
#top .barke-tool textarea:active {
	outline: none !important;
	border: 2px solid var(--bt-orange) !important;
	box-shadow: 0 0 0 3px rgba(236, 103, 9, 0.30) !important;
}
#top .barke-tool input::placeholder,
#top .barke-tool textarea::placeholder { color: #8CAAD8; opacity: 1; }

/* Select mit blauem Chevron (wie auf der Seite) */
#top .barke-tool select {
	background-image: url("data:image/svg+xml,%3Csvg width='18' height='12' viewBox='0 0 18 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2L9 9L16 2' stroke='%23004687' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 14px center !important;
	background-size: 15px 10px !important;
	padding-right: 42px !important;
	cursor: pointer;
}

/* ---------- Eingaben-Grid ---------- */
#top .barke-tool .barke-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
	background: var(--bt-border);
	margin-bottom: 24px;
}
#top .barke-tool .barke-field-card { background: var(--bt-field); padding: 18px; }

/* ---------- Schnellauswahl-Chips ---------- */
#top .barke-tool .barke-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}
#top .barke-tool .barke-chip {
	background-color: #FFFFFF !important;
	border: 1px solid var(--bt-border) !important;
	border-radius: 0 !important;
	padding: 8px 16px !important;
	font-size: 14px !important;
	color: var(--bt-text) !important;
	cursor: pointer;
	min-height: 0 !important;
	transition: all 0.15s;
}
#top .barke-tool .barke-chip:hover {
	border-color: var(--bt-orange) !important;
	color: var(--bt-orange) !important;
}
#top .barke-tool .barke-chip.selected {
	background-color: var(--bt-orange) !important;
	border-color: var(--bt-orange) !important;
	color: #FFFFFF !important;
}

/* ---------- Slider ---------- */
#top .barke-tool .barke-slider-value {
	font-size: 24px;
	font-weight: 700;
	color: var(--bt-blue);
	margin-bottom: 8px;
}
#top .barke-tool input[type="range"].barke-range {
	-webkit-appearance: none;
	appearance: none;
	width: 100% !important;
	height: 4px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: var(--bt-border) !important;
	border-radius: 0;
	outline: none;
	margin: 8px 0;
	box-shadow: none !important;
}
#top .barke-tool .barke-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--bt-blue);
	cursor: pointer;
	transition: background 0.15s, transform 0.1s;
}
#top .barke-tool .barke-range::-webkit-slider-thumb:hover {
	background: var(--bt-orange);
	transform: scale(1.1);
}
#top .barke-tool .barke-range::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border: none;
	border-radius: 50%;
	background: var(--bt-blue);
	cursor: pointer;
}
#top .barke-tool .barke-range::-moz-range-thumb:hover { background: var(--bt-orange); }
#top .barke-tool .barke-slider-labels {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	color: var(--bt-muted);
	margin-top: 2px;
}

/* ---------- Aufklappbare Berechnung ---------- */
#top .barke-tool .barke-disclosure {
	border: 1px solid var(--bt-border);
	border-radius: 0;
	margin-bottom: 24px;
}
#top .barke-tool .barke-disclosure-toggle {
	width: 100% !important;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background-color: var(--bt-field) !important;
	border: none !important;
	padding: 14px 18px !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	color: #000000 !important;
	cursor: pointer;
	text-align: left;
	min-height: 0 !important;
}
#top .barke-tool .barke-chev { transition: transform 0.2s; }
#top .barke-tool .barke-disclosure.open .barke-chev { transform: rotate(180deg); }
#top .barke-tool .barke-disclosure-body { display: none; padding: 20px 18px; }
#top .barke-tool .barke-disclosure.open .barke-disclosure-body { display: block; }

/* ---------- Preis-Tabelle ---------- */
#top .barke-tool .barke-price-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 22px;
	font-size: 13px;
}
#top .barke-tool .barke-price-table caption {
	text-align: left;
	font-size: 13px;
	font-weight: 700;
	font-style: normal !important;
	color: var(--bt-blue);
	padding-bottom: 8px;
}
#top .barke-tool .barke-price-table thead th { background-color: var(--bt-field); }
#top .barke-tool .barke-price-table th {
	text-align: left;
	font-size: 13px;
	font-weight: 600;
	color: var(--bt-muted);
	border-bottom: 1px solid var(--bt-border);
	padding: 8px 10px;
}
/* Spalten 2–4 (Stückpreis, Anzahl, Summe) rechtsbündig, Position bleibt links */
#top .barke-tool .barke-price-table th:nth-child(n+2),
#top .barke-tool .barke-price-table td:nth-child(n+2) { text-align: right; }
#top .barke-tool .barke-price-table td {
	background-color: #FFFFFF;
	padding: 7px 10px;
	border-bottom: 1px solid #EDF2F7;
}
#top .barke-tool .barke-price-table .barke-row-sum td {
	border-top: 1px solid #000000;
	border-bottom: none;
	font-weight: 700;
	color: #000000;
}

/* ---------- Material-Box & Folgekosten ---------- */
#top .barke-tool .barke-material-box {
	background: var(--bt-field);
	border-left: 3px solid var(--bt-blue);
	padding: 14px 18px;
	margin-bottom: 16px;
}
#top .barke-tool .barke-material-label {
	font-size: 13px;
	font-weight: 700;
	color: var(--bt-muted);
	margin-bottom: 6px;
}
#top .barke-tool .barke-material-value {
	font-size: 24px;
	font-weight: 800;
	color: var(--bt-blue);
}
#top .barke-tool .barke-material-sub {
	font-size: 13px;
	color: var(--bt-muted);
	margin-top: 4px;
}
#top .barke-tool .barke-folge-hint {
	font-size: 13px;
	color: var(--bt-muted);
	line-height: 1.5;
	margin: 0;
}
#top .barke-tool .barke-folge-hint strong { color: var(--bt-blue); }

/* ---------- Ergebnis-Box (BARKE-Blau) ---------- */
#top .barke-tool .barke-result {
	background: var(--bt-blue);
	color: #FFFFFF;
	padding: 34px 28px;
	border-radius: 0;
	text-align: center;
}
#top .barke-tool .barke-result-label {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.85);
	margin-bottom: 12px;
}
#top .barke-tool .barke-result-value {
	font-size: 48px;
	font-weight: 800;
	line-height: 1;
	margin-bottom: 8px;
}
#top .barke-tool .barke-result-sub {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.8);
}

/* ---------- Balkenvergleich ---------- */
#top .barke-tool .barke-bars,
#top .barke-tool .barke-tracker-compare {
	display: flex;
	justify-content: center;
	align-items: flex-end;
	gap: 28px;
	min-height: 120px;
	margin: 28px 0 24px;
}
#top .barke-tool .barke-bar-item,
#top .barke-tool .barke-tbar-wrap {
	width: 120px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	text-align: center;
}
#top .barke-tool .barke-bar,
#top .barke-tool .barke-tbar {
	width: 100%;
	margin-bottom: 8px;
	transition: height 0.4s;
	flex-shrink: 0;
	border-radius: 0;
}
#top .barke-tool .barke-bar.ist,
#top .barke-tool .barke-tbar.a { background: rgba(255, 255, 255, 0.35); }
#top .barke-tool .barke-bar.soll,
#top .barke-tool .barke-tbar.b { background: #FFFFFF; }
#top .barke-tool .barke-bar-value,
#top .barke-tool .barke-tbar-num {
	font-size: 18px;
	font-weight: 700;
	margin-bottom: 8px;
	color: #FFFFFF;
}
#top .barke-tool .barke-bar-label,
#top .barke-tool .barke-tbar-sub {
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
	margin-top: 8px;
}

/* ---------- Tracker-Text ---------- */
#top .barke-tool .barke-tracker-text {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.9);
	max-width: 460px;
	margin: 0 auto 24px;
	line-height: 1.5;
}
#top .barke-tool .barke-tracker-text strong { color: #FFFFFF; }

/* ---------- CTA-Reihe (Buttons stylt das Enfold-Theme über .avia-button) ---------- */
#top .barke-tool .barke-cta-row {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
	align-items: center;
}
/* Sekundär-Button (Tracker): blaue Fläche, weiße Outline, weißer Text.
   Überschreibt gezielt die Enfold-Themefarbe für den Ghost-Button. */
#top .barke-tool .barke-cta-row .avia-button.avia-button-ghost {
	background-color: var(--bt-blue) !important;
	border: 1.5px solid #FFFFFF !important;
	color: #FFFFFF !important;
}
#top .barke-tool .barke-cta-row .avia-button.avia-button-ghost .avia_iconbox_title {
	color: #FFFFFF !important;
}
#top .barke-tool .barke-cta-row .avia-button.avia-button-ghost:hover {
	background-color: var(--bt-blue) !important;
}

/* ---------- Disclaimer ---------- */
#top .barke-tool .barke-disclaimer {
	font-size: 13px;
	color: var(--bt-muted);
	line-height: 1.5;
	margin: 18px 0 0;
}

/* ---------- Tracker-Spalten ---------- */
#top .barke-tool .barke-tracker-cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
	background: var(--bt-border);
	margin-bottom: 24px;
}
#top .barke-tool .barke-tracker-col { background: var(--bt-field); padding: 22px 20px; }
#top .barke-tool .barke-col-kennung {
	font-size: 13px;
	font-weight: 700;
	color: var(--bt-muted);
}
#top .barke-tool .barke-col-title {
	font-size: 17px;
	font-weight: 700;
	color: var(--bt-blue);
	margin: 2px 0 18px;
}

/* ---------- Hobelbild-Rating ---------- */
#top .barke-tool .barke-rating { display: flex; gap: 6px; }
#top .barke-tool .barke-rating-item {
	flex: 1;
	background-color: #FFFFFF !important;
	border: 1px solid var(--bt-border) !important;
	border-radius: 0 !important;
	padding: 8px 4px !important;
	min-height: 0 !important;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	transition: all 0.15s;
}
#top .barke-tool .barke-rating-item:hover { border-color: var(--bt-orange) !important; }
#top .barke-tool .barke-rating-item.selected {
	background-color: var(--bt-orange) !important;
	border-color: var(--bt-orange) !important;
}
#top .barke-tool .barke-rating-item.selected .barke-rating-num,
#top .barke-tool .barke-rating-item.selected .barke-rating-lab { color: #FFFFFF !important; }
#top .barke-tool .barke-rating-num { font-size: 15px; font-weight: 700; color: var(--bt-blue); }
#top .barke-tool .barke-rating-lab {
	font-size: 9px;
	color: var(--bt-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
	#top .barke-tool .barke-h3 { font-size: 22px; }
	#top .barke-tool .barke-result-value { font-size: 38px; }
	#top .barke-tool .barke-grid { grid-template-columns: 1fr; }
	#top .barke-tool .barke-tracker-cols { grid-template-columns: 1fr; }
	#top .barke-tool .barke-bars,
	#top .barke-tool .barke-tracker-compare { gap: 18px; }
	#top .barke-tool .barke-bar-item,
	#top .barke-tool .barke-tbar-wrap { width: 100px; }
	#top .barke-tool .barke-cta-row { flex-direction: column; }
	#top .barke-tool .barke-cta-row .avia-button { width: 100%; text-align: center; }
	#top .barke-tool .barke-rating-lab { font-size: 8px; }
	#top .barke-tool .barke-result { padding: 26px 18px; }
}
