/* ==========================================================================
   Endura Valve Builder — Frontend Configurator
   ========================================================================== */

/* Layout
   ========================================================================== */
.evb-configurator {
	width: 100%;
	font-family: inherit;
	color: #1f1f1f;
}

.evb-layout {
	display: flex;
	align-items: flex-start;
	gap: 40px;
}

.evb-col-form {
	flex: 0 0 50%;
	max-width: 50%;
	min-width: 0;
}

.evb-col-images {
	flex: 0 0 calc(50% - 40px);
	max-width: calc(50% - 40px);
	min-width: 0;
	align-self: stretch;
	position: relative;
}

/* Image panel — translateY is set by JS to keep it vertically centred and within form bounds */
.evb-image-panel {
	position: absolute;
	width: 100%;
	top: 0;
	will-change: transform;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */
.evb-field-group {
	margin-bottom: 20px;
}

.evb-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #1f1f1f;
	margin-bottom: 6px;
}

.evb-select-wrap {
	position: relative;
}

.evb-select-wrap::after {
	content: '\25BC';
	font-size: 10px;
	color: #7e8083;
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
}

.evb-select {
	width: 100%;
	height: 44px;
	padding: 0 36px 0 12px;
	border: 1px solid #c8c8c8;
	border-radius: 0;
	background: #fff;
	color: #1f1f1f;
	font-size: 15px;
	font-family: inherit;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition: border-color 0.15s;
}

.evb-select:focus {
	outline: none;
	border-color: #1f1f1f;
}

.evb-select:disabled {
	background: #f7f7f7;
	color: #aaa;
	cursor: not-allowed;
}

.evb-select option:disabled {
	color: #bbb;
}

/* ==========================================================================
   Actions
   ========================================================================== */
.evb-actions {
	margin-bottom: 28px;
}

.evb-reset-btn {
	background: none;
	border: 1px solid #1f1f1f;
	padding: 9px 20px;
	font-size: 13px;
	font-family: inherit;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	color: #1f1f1f;
	transition: background 0.15s, color 0.15s;
}

.evb-reset-btn:hover {
	background: #1f1f1f;
	color: #fff;
}

/* ==========================================================================
   Results Table
   ========================================================================== */
.evb-results-wrap {
	border-top: 2px solid #1f1f1f;
	padding-top: 20px;
}

.evb-results-header {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 14px;
}

.evb-results-title {
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.evb-results-count {
	font-size: 13px;
	color: #7e8083;
}

.evb-no-results {
	font-size: 14px;
	color: #7e8083;
	padding: 12px 0;
}

.evb-loading {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #7e8083;
	padding: 12px 0;
}

.evb-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #ddd;
	border-top-color: #1f1f1f;
	border-radius: 50%;
	animation: evb-spin 0.6s linear infinite;
}

@keyframes evb-spin {
	to { transform: rotate(360deg); }
}

.evb-table-scroll {
	max-height: 380px;
	overflow-y: auto;
}

.evb-results-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.evb-results-table thead th {
	text-align: left;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #7e8083;
	border-bottom: 1px solid #e0e0e0;
	padding: 6px 8px;
}

.evb-results-table tbody tr {
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.1s;
}

.evb-results-table tbody tr:hover {
	background: #f9f9f9;
}

.evb-results-table tbody td {
	padding: 10px 8px;
	vertical-align: top;
}

.evb-part-number {
	font-weight: 700;
	font-size: 13px;
	white-space: nowrap;
	color: #1f1f1f;
}

.evb-description {
	color: #444;
	line-height: 1.45;
}

.evb-copy-btn {
	background: none;
	border: 1px solid #c8c8c8;
	padding: 4px 10px;
	font-size: 11px;
	font-family: inherit;
	font-weight: 600;
	cursor: pointer;
	color: #1f1f1f;
	white-space: nowrap;
	transition: background 0.12s, border-color 0.12s;
}

.evb-copy-btn:hover {
	background: #1f1f1f;
	border-color: #1f1f1f;
	color: #fff;
}

.evb-copy-btn.copied {
	background: #2e7d32;
	border-color: #2e7d32;
	color: #fff;
}

/* ==========================================================================
   Image Panel
   ========================================================================== */
.evb-img-row {
	margin-bottom: 16px;
}

.evb-img-row--grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}

.evb-img-row--grid .evb-img-slot {
	min-width: 0;
}

.evb-img-row--figure {
	display: flex;
	justify-content: center;
}

.evb-img-row--figure .evb-img-slot {
	width: 100%;
	max-width: 400px;
}

.evb-img-slot {
	text-align: center;
	position: relative;
}

.evb-img-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	background: #f5f5f5;
	border: 1px dashed #d0d0d0;
	padding: 16px 8px;
	gap: 8px;
}

.evb-img-row--figure .evb-img-placeholder {
	min-height: 200px;
}

.evb-img-icon {
	font-size: 28px;
	color: #c0c0c0;
}

.evb-img-icon.dashicons {
	width: auto;
	height: auto;
	display: inline-block;
}

.evb-img-hint {
	font-size: 11px;
	color: #aaa;
	line-height: 1.3;
}

.evb-img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: contain;
	border: 1px solid #e8e8e8;
}

.evb-img-row--grid .evb-img {
	max-height: 200px;
}

.evb-img-row--figure .evb-img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
}

.evb-img-label {
	display: block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #7e8083;
	margin-top: 6px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
	.evb-layout {
		flex-direction: column;
	}

	.evb-col-form,
	.evb-col-images {
		flex: none;
		max-width: 100%;
		width: 100%;
	}

	/* Images above the results section on mobile */
	.evb-col-images {
		order: -1;
	}

	.evb-image-panel {
		position: static;
	}

	.evb-img-row--figure .evb-img-slot {
		max-width: 260px;
	}
}

@media (max-width: 500px) {
	.evb-img-row--grid {
		grid-template-columns: 1fr;
		gap: 8px;
	}
}
