/**
 * Stili per il toggle pelle/tessuto nel configuratore
 */

/* ============================================================================
   TOGGLE SWITCH PELLE/TESSUTO
   ============================================================================ */

.sbf-field-pelle-toggle {
	margin: 20px 0;
	padding: 15px;
	background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
	border-radius: 8px;
	border-left: 4px solid #667eea;
}

.sbf-field-pelle-toggle .sbf-field-title {
	display: block;
	margin-bottom: 12px;
	font-size: 16px;
	font-weight: 600;
	color: #2c3e50;
}

.sbf-field-pelle-toggle small {
	display: block;
	margin-bottom: 15px;
	font-size: 13px;
	color: #666;
	font-style: italic;
}

/* Toggle switch (checkbox styled) */
.sbf-toggle-switch {
	display: inline-flex;
	align-items: center;
	gap: 12px;
}

.sbf-toggle-switch input[type="checkbox"] {
	width: 50px;
	height: 24px;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	background: #ccc;
	border-radius: 12px;
	outline: none;
	transition: background 0.3s, box-shadow 0.3s;
	position: relative;
}

.sbf-toggle-switch input[type="checkbox"]:before {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: white;
	top: 2px;
	left: 2px;
	transition: left 0.3s;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sbf-toggle-switch input[type="checkbox"]:checked {
	background: #667eea;
}

.sbf-toggle-switch input[type="checkbox"]:checked:before {
	left: 28px;
}

.sbf-toggle-switch input[type="checkbox"]:focus {
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sbf-toggle-label {
	font-weight: 500;
	color: #2c3e50;
	font-size: 14px;
	cursor: pointer;
	user-select: none;
}


/* ============================================================================
   PANNELLO PELLE
   ============================================================================ */

.sbf-field-pelle {
	margin-top: 20px;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 8px;
	border: 2px dashed #ddd;
}

.sbf-field-pelle .sbf-field-title {
	display: block;
	margin-bottom: 15px;
	font-size: 16px;
	font-weight: 600;
	color: #2c3e50;
}

.sbf-field-pelle small {
	display: block;
	margin-bottom: 15px;
	font-size: 13px;
	color: #666;
}

/* Griglia colori pelle */
.sbf-leather-color-panel {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	gap: 15px;
	margin-top: 15px;
}

.sbf-leather-color-panel[hidden] {
	display: none;
}

/* Swatch pelle (con effetto di texture) */
.sbf-swatch-option.sbf-leather-option {
	position: relative;
}

.sbf-swatch-option.sbf-leather-option input[type="radio"] {
	margin-right: 8px;
}

.sbf-leather-option .sbf-swatch-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	border: 2px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	transition: all 0.3s ease;
	background: #fff;
	position: relative;
}

.sbf-leather-option .sbf-swatch-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sbf-leather-option .sbf-swatch-label {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(0, 0, 0, 0.7);
	color: white;
	padding: 8px;
	text-align: center;
	font-size: 12px;
	font-weight: 500;
	z-index: 2;
}

/* Effetto hover */
.sbf-leather-option .sbf-swatch-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	border-color: #667eea;
}

/* Stato selected */
.sbf-leather-option input[type="radio"]:checked + .sbf-swatch-card,
.sbf-leather-option .sbf-swatch-card.selected {
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sbf-leather-option input[type="radio"]:checked + .sbf-swatch-card:after {
	content: '✓';
	position: absolute;
	top: 8px;
	right: 8px;
	background: #667eea;
	color: white;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 14px;
	z-index: 3;
}


/* ============================================================================
   VISIBILITÀ TESSUTI VS PELLE
   ============================================================================ */

/* Nascondi i tessuti quando è selezionata la pelle */
.sbf-field-latka.hidden,
.sbf-field-farba-latky.hidden {
	display: none;
}

/* Animazione fade in/out */
.sbf-field-latka,
.sbf-field-farba-latky,
.sbf-field-pelle {
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sbf-field-latka.hidden,
.sbf-field-farba-latky.hidden,
.sbf-field-pelle.hidden {
	opacity: 0;
	visibility: hidden;
}


/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
	.sbf-field-pelle-toggle {
		padding: 12px;
	}

	.sbf-leather-color-panel {
		grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
		gap: 12px;
	}

	.sbf-leather-option .sbf-swatch-card {
		min-height: 100px;
	}

	.sbf-toggle-switch {
		flex-direction: column;
		align-items: flex-start;
	}
}


/* ============================================================================
   ACCESSIBILITÀ
   ============================================================================ */

.sbf-toggle-switch input[type="checkbox"]:focus-visible {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

.sbf-leather-option .sbf-swatch-card:focus-visible {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}
