/**
 * CENTRO USATO - CSS
 * Stili per pagina Centro Usato Peragnoli
 * Path: /public_html/css/centro-usato.css
 * Autore: Filippo Peragnoli - 14/01/2026 (v1.1 CORRETTO)
 */

/* ========================================
   HERO SECTION
   ======================================== */

/* .centro-usato-hero {
	background: linear-gradient(135deg, #183F72 0%, #2a5a8f 100%);
	position: relative;
	overflow: hidden;
}

.centro-usato-hero::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 50%;
	height: 100%;
	background: url('/images/centro-usato-pattern.svg') no-repeat center right;
	background-size: contain;
	opacity: 0.1;
} */

/* ========================================
   HERO SECTION - CON IMMAGINE (v2.0)
   Aggiungi/Sostituisci nel file centro-usato.css
   ======================================== */

.bg-primary {
	position: relative;
	background-image: url('../images/peragnoli-centro-usato-showroom.jpg');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	overflow: hidden;
	min-height: 500px; /* Altezza minima per impatto */
}

/* Overlay scuro con gradient */
.bg-primary::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(24, 63, 114, 0.6) 100%);
	z-index: 1;
}

/* Contenuto sopra overlay */
.bg-primary > * {
	position: relative;
	z-index: 2;
}

/* Titolo Hero con animazione */
.hero-title {
	text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
	animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
	text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
	animation: fadeInUp 1s ease-out;
	font-weight: 300;
}

/* Badge con shadow più pronunciato */
.bg-primary .badge {
	animation: fadeInUp 1.2s ease-out;
	transition: transform 0.3s ease;
}

.bg-primary .badge:hover {
	transform: translateY(-5px);
}

/* CTA Button */
.bg-primary .btn-warning {
	animation: fadeInUp 1.4s ease-out;
	font-weight: 700;
	letter-spacing: 0.5px;
	transition: all 0.3s ease;
}

.bg-primary .btn-warning:hover {
	transform: scale(1.05);
	box-shadow: 0 10px 30px rgba(255, 193, 7, 0.4) !important;
}

/* Smooth scroll */
html {
	scroll-behavior: smooth;
}

/* Animazione fadeInUp */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Responsive */
@media (max-width: 768px) {
	.bg-primary {
		min-height: 400px;
	}
	
	.hero-title {
		font-size: 2.5rem !important;
	}
	
	.hero-subtitle {
		font-size: 1.1rem !important;
	}
	
	.bg-primary .btn-warning {
		font-size: 1rem;
		padding: 0.75rem 2rem !important;
	}
}

@media (max-width: 576px) {
	.hero-title {
		font-size: 2rem !important;
	}
	
	.hero-subtitle {
		font-size: 1rem !important;
	}
	
	.bg-primary .badge {
		font-size: 0.75rem !important;
		padding: 0.5rem 1rem !important;
	}
}

/* ========================================
   CAROUSEL MARCHI - CORRETTO
   ======================================== */

.carousel-marchi-usato {
	   position: relative !important;
	   width: 1376px !important; /* LARGHEZZA FISSA! */
	   max-width: 100% !important;
	   min-height: 150px !important;
	   overflow: hidden !important;
	   padding: 20px 0 !important;
	   display: block !important;
	   margin: 0 auto !important; /* Centra */
   }
   
.carousel-marchi-usato:active {
	cursor: grabbing !important;
}

.carousel-track {
	display: flex !important;
	flex-direction: row !important;
	gap: 30px !important;
	will-change: transform;
	flex-wrap: nowrap !important;
	align-items: center !important;
	width: max-content !important; /* CHIAVE: espande automaticamente */
	min-width: 100% !important;
}

.carousel-item {
	flex: 0 0 auto !important;
	width: 150px !important;
	min-width: 150px !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	gap: 10px !important;
	padding: 15px !important;
	background: white !important;
	border-radius: 12px !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
	transition: all 0.3s ease !important;
	text-decoration: none !important;
	color: inherit !important;
}

.carousel-item:hover {
	transform: translateY(-5px) !important;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.carousel-item.active {
	background: linear-gradient(135deg, #183F72 0%, #2a5a8f 100%) !important;
	color: white !important;
	box-shadow: 0 8px 25px rgba(24, 63, 114, 0.3) !important;
}

/* .carousel-logo {
	width: 100px !important;
	height: 60px !important;
	object-fit: contain !important;
	transition: filter 0.3s ease !important;
	display: block !important;
	filter: grayscale(100%) brightness(0.7) contrast(1.1);
} */

.carousel-logo {
	/* DIMENSIONI FISSE FORZATE */
	width: 120px !important;
	height: 80px !important;
	min-width: 120px !important;
	min-height: 80px !important;
	max-width: 120px !important;
	max-height: 80px !important;
	
	/* FORZA SCALING UNIFORME */
	object-fit: contain !important;
	object-position: center !important;
	
	/* SOVRASCRIVI dimensioni intrinseche SVG */
	display: block !important;
	margin: 0 auto !important;
	
	/* NERO */
	filter: grayscale(100%) brightness(0.5) contrast(1.1);
	
	transition: filter 0.3s ease !important;
}

/* FORZA anche sui tag <svg> inline se presenti */
.carousel-logo svg,
.carousel-item svg {
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
}


.carousel-item:hover .carousel-logo,
.carousel-item.active .carousel-logo {
	/* Colore on hover/active */
	filter: grayscale(0%) brightness(1) contrast(1);
}

.carousel-brand-name {
	font-size: 14px !important;
	font-weight: 600 !important;
	text-align: center !important;
	white-space: nowrap !important;
	display: block !important;
}

.carousel-brand-count {
	font-size: 12px !important;
	font-weight: 500 !important;
	opacity: 0.8 !important;
}

/* ========================================
   BADGE CENTRO USATO (su card auto)
   ======================================== */

.badge-centro-usato {
	position: absolute;
	top: 10px;
	left: 10px;
	background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
	color: white;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	z-index: 2;
	box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* ========================================
   VANTAGGI SECTION
   ======================================== */

.vantaggi-card {
	transition: all 0.3s ease;
}

.vantaggi-card:hover {
	transform: translateY(-10px);
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

.vantaggi-card i {
	font-size: 3rem;
	margin-bottom: 1rem;
}

/* ========================================
   PAGINAZIONE CUSTOM
   ======================================== */

.pagination .page-item.active .page-link {
	background-color: #183F72;
	border-color: #183F72;
}

.pagination .page-link {
	color: #183F72;
}

.pagination .page-link:hover {
	color: #0d2847;
	background-color: #e9ecef;
}

/* ========================================
   FILTRO ATTIVO
   ======================================== */

.filtro-attivo {
	background: #fff3cd;
	border-left: 4px solid #ffc107;
	padding: 15px;
	margin-bottom: 20px;
	border-radius: 8px;
}

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

@media (max-width: 768px) {
	.carousel-item {
		width: 120px !important;
		padding: 10px !important;
	}
	
	.carousel-logo {
		width: 80px !important;
		height: 50px !important;
	}
	
	.carousel-brand-name {
		font-size: 12px !important;
	}
	
	.badge-centro-usato {
		font-size: 10px;
		padding: 4px 8px;
	}
}

@media (max-width: 576px) {
	.carousel-item {
		width: 100px !important;
		gap: 5px !important;
	}
	
	.carousel-logo {
		width: 60px !important;
		height: 40px !important;
	}
	
	.carousel-track {
		gap: 15px !important;
	}
}

/* ========================================
   ANIMAZIONI
   ======================================== */

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.fade-in-up {
	animation: fadeInUp 0.6s ease-out;
}

/* ========================================
   FIX COMPATIBILITÀ BOXAUTO
   ======================================== */

/* Assicura che le card auto abbiano lo stesso stile del catalogo */
.centro-usato-grid .boxauto-card {
	height: 100%;
}

.centro-usato-grid .card-body {
	display: flex;
	flex-direction: column;
}

.centro-usato-grid .box-auto-info {
	margin-top: auto;
}

/* ========================================
   UTILITIES
   ======================================== */

.text-primary-dark {
	color: #183F72 !important;
}

.bg-primary-dark {
	background-color: #183F72 !important;
}

.bg-primary-gradient {
	background: linear-gradient(135deg, #183F72 0%, #2a5a8f 100%) !important;
}

@media (max-width: 768px) {
	.bg-primary {
		background-position: center center;
		background-size: cover;
	}
}


/* ========================================
   FILTRI ORIZZONTALI - Centro Usato
   Aggiungi al file esistente centro-usato.css
   ======================================== */

/* Barra Filtri Orizzontale Desktop */
.filtri-barra-orizzontale .card {
	background: white;
	transition: box-shadow 0.3s ease;
}

.filtri-barra-orizzontale .card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.filtri-barra-orizzontale .form-select-sm,
.filtri-barra-orizzontale .btn-sm {
	font-size: 0.875rem;
	padding: 0.375rem 0.75rem;
}

.filtri-barra-orizzontale .form-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 0.25rem;
}

/* Button Group Filtri */
.filtri-barra-orizzontale .btn-group .btn-check:checked + label {
	background-color: #183F72;
	border-color: #183F72;
	color: white;
}

.filtri-barra-orizzontale .btn-group .btn-check:checked + label.btn-outline-success {
	background-color: #28a745;
	border-color: #28a745;
}

/* Accordion Filtri Mobile */
#filtriCollapseMobile .card {
	border-radius: 12px;
}

#filtriCollapseMobile .form-label {
	color: #183F72;
	font-size: 0.95rem;
}

#filtriCollapseMobile .form-check-input:checked {
	background-color: #183F72;
	border-color: #183F72;
}

/* Empty State */
.empty-state {
	background: #f8f9fa;
	border-radius: 12px;
	padding: 3rem 1.5rem;
}

.empty-state i {
	opacity: 0.3;
}

.empty-state h3 {
	color: #183F72;
	font-weight: 700;
}

.empty-state .suggestions {
	background: white;
	border-radius: 8px;
	padding: 1.5rem;
	border-left: 4px solid #183F72;
}

.empty-state .suggestions h5 {
	color: #183F72;
	font-weight: 700;
	margin-bottom: 1rem;
}

.empty-state .suggestions li {
	color: #6c757d;
	padding: 0.5rem 0;
	border-bottom: 1px solid #e9ecef;
}

.empty-state .suggestions li:last-child {
	border-bottom: none;
}

.empty-state .suggestions strong {
	color: #183F72;
}

/* Contatore Auto */
#contatore-auto {
	color: #183F72;
}

#contatore-auto strong {
	font-weight: 700;
}

/* Animazioni */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.filtri-barra-orizzontale,
#filtriCollapseMobile {
	animation: fadeIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 991px) {
	.filtri-barra-orizzontale {
		display: none !important;
	}
}

@media (min-width: 992px) {
	#filtriCollapseMobile {
		display: none !important;
	}
}

/* Loading State */
.spinner-border {
	width: 3rem;
	height: 3rem;
	border-width: 0.3em;
}

/* Focus States */
.form-select:focus,
.form-check-input:focus {
	border-color: #183F72;
	box-shadow: 0 0 0 0.25rem rgba(24, 63, 114, 0.25);
}

/* Button Hover Effects */
.btn-outline-primary:hover,
.btn-outline-success:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
	transition: all 0.3s ease;
}

/* Compact Layout */
.filtri-barra-orizzontale .col-auto {
	padding-left: 0.5rem;
	padding-right: 0.5rem;
}

/* Badge Badge filtri attivi */
.badge-filtro-attivo {
	background: #183F72;
	color: white;
	font-size: 0.7rem;
	padding: 0.25rem 0.5rem;
	border-radius: 12px;
	margin-left: 0.25rem;
}

/* ========================================
   STICKY SOLO DESKTOP (SAFARI COMPATIBLE)
   ======================================== */

@supports (position: sticky) {
	.filtri-barra-orizzontale {
		position: -webkit-sticky; /* Safari */
		position: sticky;
		top: 100px;
		z-index: 999;
		background: white;
	}
}

/* Mobile NON sticky - lascia tutto normale */
@media (max-width: 991px) {
	.filtri-barra-orizzontale {
		position: relative !important;
	}
}


/* ========================================
   FIX VISUAL FILTRI - 15/01/2026
   ======================================== */

/* Fix allineamento barra filtri */
.filtri-barra-orizzontale .row {
	align-items: flex-end !important; /* Allinea in basso */
}

/* Select Anno più larga */
#filtro-anno {
	min-width: 160px !important; /* Più spazio per "Prima del 2011" */
}

/* Select Prezzo più larga */
#filtro-prezzo {
	min-width: 180px !important;
}

/* Select Km più larga */
#filtro-km {
	min-width: 180px !important;
}

/* Fix badge contatore - usa bg-dark invece di bg-primary */
#contatore-auto {
	background-color: #000 !important; /* NERO */
	background-image: none !important; /* RIMUOVI immagine hero */
	color: white !important;
	padding: 0.5rem 1rem !important;
	font-size: 0.9rem !important;
}

/* Fix badge contatore - alternativa con classe esistente */
.badge-black {
	background-color: #000 !important;
	background-image: none !important;
	color: white !important;
}

/* Assicura che label siano allineate */
.filtri-barra-orizzontale .form-label {
	display: block !important;
	margin-bottom: 0.5rem !important;
	min-height: 18px !important; /* Spazio fisso per label */
}

/* Compatta button group alimentazione */
.filtri-barra-orizzontale .btn-group .btn-sm {
	padding: 0.25rem 0.5rem !important;
	font-size: 0.8rem !important;
}

/* Responsive: wrap su schermi medi */
@media (max-width: 1400px) {
	.filtri-barra-orizzontale .row {
		row-gap: 1rem !important;
	}
}
/* ========================================
   AGGIUNTE CSS - 09/02/2026
   Aggiungere IN FONDO a centro-usato.css
   NON sostituire il file, solo append!
   ======================================== */

/* ========================================
   CAROUSEL SCROLLBAR INDICATORE
   ======================================== */

.carousel-scrollbar-container {
	position: relative;
	width: 80%;
	max-width: 400px;
	height: 4px;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	margin: 12px auto 0;
	overflow: hidden;
}

.carousel-scrollbar-thumb {
	position: absolute;
	top: 0;
	left: 0;
	width: 25%;
	height: 100%;
	background: #183F72;
	border-radius: 4px;
	transition: none; /* No transition per smooth tracking */
	will-change: transform;
}

.carousel-scrollbar-container:hover .carousel-scrollbar-thumb {
	background: #2a5a8f;
	height: 6px;
	top: -1px;
}

/* Cursor grab per carousel */
.carousel-marchi-usato {
	cursor: grab !important;
}

.carousel-marchi-usato:active {
	cursor: grabbing !important;
}

/* Responsive scrollbar */
@media (max-width: 768px) {
	.carousel-scrollbar-container {
		width: 60%;
		max-width: 250px;
		height: 3px;
		margin-top: 8px;
	}
	
	.carousel-scrollbar-thumb {
		width: 30%;
	}
}

@media (max-width: 576px) {
	.carousel-scrollbar-container {
		width: 50%;
		max-width: 180px;
	}
	
	.carousel-scrollbar-thumb {
		width: 35%;
	}
}

/* ========================================
   FILTRI MARCA / MODELLO
   ======================================== */

/* Riga marca/modello nella barra filtri */
.filtri-barra-orizzontale .row + .row {
	border-top: 1px solid #e9ecef;
	padding-top: 0.75rem;
}

/* Select modello disabilitata - stile */
#filtro-modello:disabled,
#filtro-modello-mobile:disabled {
	background-color: #f8f9fa;
	color: #adb5bd;
	cursor: not-allowed;
}

/* Select modello attiva */
#filtro-modello:not(:disabled),
#filtro-modello-mobile:not(:disabled) {
	border-color: #183F72;
	background-color: #fff;
}