/* Stahlbau-Konfigurator: 2-Spalten-Layout (3D-Ansicht links, Konfiguration
   rechts), Kacheln, nummerierte Abschnitte -- angelehnt an die vom Kunden
   vorgegebene Referenz-Optik. */

.stbk-configurator {
	--stbk-accent: #1e69b8;
	--stbk-accent-bg: #eaf2fa;
	--stbk-accent-border: #a9cbe8;
	--stbk-border: #e0e0e0;
	--stbk-text: #222222;
	--stbk-text-muted: #555555;
	--stbk-text-faint: #808080;
	--stbk-surface: #fff;
	--stbk-surface-alt: #f7f7f7;

	display: grid;
	grid-template-columns: 1.15fr 1fr;
	gap: 20px;
	margin-bottom: 32px;
	align-items: start;
	font-family: var(--stbk-font-body, inherit);
	color: var(--stbk-text);
}

@media (max-width: 900px) {
	.stbk-configurator {
		grid-template-columns: 1fr;
	}
}

.stbk-panel {
	background: var(--stbk-surface);
	border: 1px solid var(--stbk-border);
	border-radius: 14px;
	padding: 20px;
}

.stbk-panel-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}

.stbk-panel-header-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: var(--stbk-accent-bg);
	color: var(--stbk-accent);
	flex: none;
}

.stbk-panel-header-text {
	flex: 1;
	min-width: 0;
}

.stbk-panel-title {
	font-weight: 700;
	font-size: 15.5px;
	line-height: 1.3;
}

.stbk-panel-subtitle {
	font-size: 12px;
	color: var(--stbk-text-muted);
	margin-top: 2px;
}

.stbk-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	border-radius: 100px;
	font-size: 11.5px;
	font-weight: 600;
	white-space: nowrap;
	flex: none;
}

.stbk-badge-steel {
	background: var(--stbk-surface-alt);
	color: var(--stbk-text-muted);
	border: 1px solid var(--stbk-border);
}

.stbk-badge-delivery {
	background: var(--stbk-accent-bg);
	color: var(--stbk-accent);
}

.stbk-reset-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--stbk-surface);
	border: 1px solid var(--stbk-border);
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 600;
	color: var(--stbk-text-muted);
	cursor: pointer;
	flex: none;
}
.stbk-reset-btn:hover {
	border-color: var(--stbk-text-faint);
}

/* ---- Viewer ---- */

/* Bleibt beim Scrollen durch die (bei mehreren Bohrungen teils lange)
   Konfigurationsspalte rechts sichtbar, statt aus dem Blickfeld zu
   verschwinden. Offset unter dem sticky Seiten-Header (siehe
   storefront-child/style.css .site-header), Grid-Spalte bleibt normal
   scrollbar, wenn sie selbst hoeher als der verbleibende Viewport ist. */
.stbk-viewer-panel {
	position: sticky;
	top: 96px;
	max-height: calc(100vh - 116px);
	overflow-y: auto;
}

@media (max-width: 900px) {
	.stbk-viewer-panel {
		position: static;
		max-height: none;
		overflow-y: visible;
	}
}

.stbk-canvas-wrap {
	position: relative;
	background: linear-gradient(180deg, #fafaf7, #f0efe9);
	border: 1px solid var(--stbk-border);
	border-radius: 10px;
	height: 400px;
	overflow: hidden;
}

.stbk-canvas {
	width: 100%;
	height: 100%;
	display: block;
	cursor: grab;
	touch-action: none;
}

.stbk-material-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 7px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid var(--stbk-border);
	border-radius: 100px;
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 600;
	color: var(--stbk-text);
}

.stbk-material-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #4b5259;
	flex: none;
}

.stbk-geo-card {
	position: absolute;
	bottom: 12px;
	left: 12px;
	z-index: 2;
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid var(--stbk-border);
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 12px;
	min-width: 190px;
}

.stbk-geo-title {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--stbk-text-faint);
	text-transform: uppercase;
	margin-bottom: 8px;
}

.stbk-geo-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 2px 0;
	color: var(--stbk-text-muted);
}
.stbk-geo-row strong {
	color: var(--stbk-text);
	font-family: var(--stbk-font-mono, monospace);
	font-weight: 600;
}

.stbk-stats-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
	margin-top: 14px;
}

@media (max-width: 560px) {
	.stbk-stats-row {
		grid-template-columns: repeat(2, 1fr);
	}
}

.stbk-stat-tile {
	background: var(--stbk-surface-alt);
	border: 1px solid var(--stbk-border);
	border-radius: 10px;
	padding: 10px 12px;
}

.stbk-stat-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--stbk-text-faint);
	margin-bottom: 4px;
}

.stbk-stat-value {
	font-family: var(--stbk-font-mono, monospace);
	font-weight: 700;
	font-size: 14px;
}

/* ---- Config sections ---- */

.stbk-section {
	margin-bottom: 20px;
}

.stbk-section-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: var(--stbk-text-faint);
	margin-bottom: 10px;
}

.stbk-tile-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}
.stbk-tile-grid-4 {
	grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 480px) {
	.stbk-tile-grid-4 {
		grid-template-columns: repeat(4, 1fr);
	}
}

.stbk-tile {
	position: relative;
	background: var(--stbk-surface);
	border: 1.5px solid var(--stbk-border);
	border-radius: 10px;
	padding: 12px 10px;
	text-align: left;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 2px;
	color: var(--stbk-text);
}
.stbk-tile:hover {
	border-color: var(--stbk-text-faint);
}
.stbk-tile.is-active {
	border-color: var(--stbk-accent);
	background: var(--stbk-accent-bg);
}

.stbk-tile-label {
	font-weight: 700;
	font-size: 13.5px;
}
.stbk-tile-sub {
	font-size: 11px;
	color: var(--stbk-text-muted);
}
.stbk-tile.is-active .stbk-tile-sub {
	color: var(--stbk-accent);
}

.stbk-tile-check {
	position: absolute;
	top: 8px;
	right: 8px;
	color: var(--stbk-accent);
	display: flex;
}

.stbk-size-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.stbk-size-row select {
	flex: 1;
	min-width: 160px;
	padding: 10px 32px 10px 12px;
	border: 1.5px solid var(--stbk-border);
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--stbk-text);
	background: var(--stbk-surface);
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6a63' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}

.stbk-size-reset {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: none;
	border: none;
	color: var(--stbk-accent);
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	padding: 6px 4px;
}

.stbk-length-row {
	display: flex;
	align-items: center;
	gap: 14px;
}
.stbk-length-row input[type=range] {
	flex: 1;
}
.stbk-length-number-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
	border: 1.5px solid var(--stbk-border);
	border-radius: 8px;
	padding: 8px 10px;
	flex: none;
}
.stbk-length-number {
	width: 64px;
	border: none;
	font-family: var(--stbk-font-mono, monospace);
	font-weight: 700;
	font-size: 14px;
	text-align: right;
	color: var(--stbk-text);
}
.stbk-length-number:focus {
	outline: none;
}
.stbk-length-unit {
	font-size: 12px;
	color: var(--stbk-text-muted);
}

.stbk-length-minmax {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--stbk-text-faint);
	margin-top: 6px;
}

.stbk-cut-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.stbk-cut-label {
	display: block;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: var(--stbk-text-faint);
	margin-bottom: 6px;
}
.stbk-cut-select {
	width: 100%;
	padding: 10px 12px;
	border: 1.5px solid var(--stbk-border);
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--stbk-text);
	background: var(--stbk-surface);
}

.stbk-holes-header {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	margin-bottom: 10px;
}
.stbk-add-hole {
	background: var(--stbk-accent-bg);
	color: var(--stbk-accent);
	border: none;
	padding: 8px 14px;
	border-radius: 7px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.stbk-holes-empty {
	color: var(--stbk-text-muted);
	font-size: 13.5px;
	padding: 4px 0 8px;
}
.stbk-hole-row {
	padding: 10px 0;
	border-top: 1px solid var(--stbk-surface-alt);
}
.stbk-hole-row-main {
	display: grid;
	grid-template-columns: auto 1fr 1fr auto;
	gap: 10px;
	align-items: center;
}
.stbk-hole-row-axis {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 10px;
	margin-top: 8px;
	padding-left: 18px;
}
.stbk-hole-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	flex: none;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}
.stbk-hole-row button {
	background: none;
	border: none;
	color: #b5432f;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	padding: 6px;
}
.stbk-hole-label {
	font-size: 11px;
	color: var(--stbk-text-faint);
	margin-bottom: 3px;
}
.stbk-hole-row input,
.stbk-hole-row select {
	width: 100%;
	padding: 7px 9px;
	border: 1px solid var(--stbk-border);
	border-radius: 6px;
	font-family: var(--stbk-font-mono, monospace);
	font-size: 13px;
	color: var(--stbk-text);
	background: var(--stbk-surface, #fff);
}

.stbk-material-badge {
	color: var(--stbk-text);
}

/* ---- Price card ---- */

.stbk-price-card {
	background: var(--stbk-surface-alt);
	border: 1px solid var(--stbk-border);
	border-radius: 12px;
	padding: 16px 18px;
}

.stbk-price-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	gap: 10px;
}
.stbk-price-card-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--stbk-text-faint);
	text-transform: uppercase;
}

.stbk-price-card-main {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 12px;
}
.stbk-price-big {
	font-family: var(--stbk-font-mono, monospace);
	font-weight: 800;
	font-size: 28px;
	color: var(--stbk-text);
}
.stbk-price-note {
	font-size: 11.5px;
	color: var(--stbk-text-faint);
}

.stbk-price-breakdown {
	display: flex;
	flex-direction: column;
	gap: 6px;
	border-top: 1px solid var(--stbk-border);
	padding-top: 10px;
}
.stbk-price-row {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	color: var(--stbk-text-muted);
}
.stbk-price-row span:last-child {
	font-family: var(--stbk-font-mono, monospace);
	font-weight: 600;
	color: var(--stbk-text);
}

/* ---- Native WooCommerce variation form bits we keep but restyle ----
   table.variations and .single_variation_wrap are NOT nested inside our
   injected .stbk-configurator markup -- they stay in their original position
   as siblings within form.cart (we only move the <select> itself out of the
   table into our own "Nenngröße" section). Selectors below intentionally
   don't require a .stbk-config-panel ancestor. */

form.cart table.variations {
	display: none;
}
form.cart .woocommerce-variation-price,
form.cart .woocommerce-variation-availability {
	display: none;
}
form.cart .woocommerce-variation-add-to-cart {
	margin-top: 4px;
}

input[type=range] {
	-webkit-appearance: none;
	appearance: none;
	height: 5px;
	border-radius: 3px;
	background: var(--stbk-border);
	outline: none;
}
input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--stbk-accent);
	border: 3px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

/* Hinweis zu Oberflaechenzustand/Qualitaet auf der Produktseite (ausserhalb
   des .stbk-configurator-Containers, daher eigene Farbwerte statt der
   dortigen CSS-Variablen). */
.stbk-surface-note {
	margin: 16px 0;
	padding: 12px 14px;
	background: #f7f7f7;
	border-left: 3px solid #1e69b8;
	border-radius: 4px;
	font-size: 0.92em;
	color: #444;
	line-height: 1.5;
}
.stbk-surface-note strong {
	color: #222;
}
