.car-detail-hero {
   background: url('images/car/01.jpg') center/cover no-repeat;
   padding: 80px 0;
   text-align: center;
   color: white;
   /*box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.5);*/
   min-height: 500px;
   min-width: 100%;
   background-size: cover;
   background-position: center;
   background-attachment: fixed;
   min-height: 500px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.car-detail-hero h1 {
   font-size: 48px;
   font-weight: 700;
   margin: 0;
   text-transform: uppercase;
}

.car-detail-section {
   padding: 60px 0;
}

.car-detail-main {
   display: flex;
   gap: 40px;
   align-items: flex-start;
}

.car-detail-image {
   flex: 1;
   position: relative;
   overflow: hidden;
   cursor: grab;
   touch-action: pan-y;
   /* IMPORTANTE: Taglia i bordi sfocati che escono fuori */
   display: flex;
   justify-content: center;
   align-items: center;
   min-height: 500px;
   /* Assicura un'altezza minima se l'immagine non carica subito */
}

.car-detail-image.dragging {
   cursor: grabbing;
}

/* Lo pseudo-elemento ora eredita lo sfondo dall'HTML e lo sfoca */
.car-detail-image::before {
   content: "";
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;

   /* Eredita l'immagine inserita nell'attributo style dell'HTML */
   background-image: inherit;
   background-size: cover;
   background-position: center;

   /* Applica l'effetto */
   filter: blur(20px);
   transform: scale(1.1);
   /* Rimuove l'alone bianco ai bordi causato dal blur */
   z-index: 1;

   /* Mantiene la tua transizione fluida quando cambi immagine */
   transition: background-image 0.6s ease-in-out;
}

/* L'immagine in primo piano resta nitida */
.car-detail-image img {
   position: relative;
   z-index: 2;
   /* Spinge l'immagine sopra lo sfondo sfocato */
   height: auto;
   max-height: 500px;
   max-width: 90%;
   /* Evita che l'immagine esca dai bordi sui telefoni */
   border-radius: 4px;
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.car-detail-image .gallery-nav {
   position: absolute;
   top: 50%;
   z-index: 3;
   width: 42px;
   height: 42px;
   padding: 0;
   border: 0;
   background: transparent;
   color: #fff;
   font-size: 24px;
   line-height: 42px;
   text-align: center;
   transform: translateY(-50%);
   cursor: pointer;
   box-shadow: none;
}

.car-detail-image .gallery-nav:hover,
.car-detail-image .gallery-nav:focus {
   background: transparent;
   outline: none;
}

.car-detail-image .gallery-nav.prev {
   left: 2px;
}

.car-detail-image .gallery-nav.next {
   right: 2px;
}

.car-detail-sidebar {
   flex: 0 0 320px;
}

.detail-info-box {
   background: #f6f8f9;
   padding: 20px;
   margin-bottom: 20px;
   border-radius: 4px;
}

.detail-info-row {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 12px 0;
   border-bottom: 1px solid #e0e0e0;
}

.detail-info-row:last-child {
   border-bottom: none;
}

.detail-info-label {
   font-weight: 600;
   color: #666;
   font-size: 13px;
   text-transform: uppercase;
}

.detail-info-value {
   color: #333;
   font-weight: 600;
   font-size: 14px;
}

.price-section {
   background: #f6f8f9;
   padding: 20px;
   border-radius: 4px;
   margin-bottom: 20px;
   text-align: center;
}

.price-label {
   font-size: 12px;
   color: #999;
   text-transform: uppercase;
   margin-bottom: 8px;
}

.price-amount {
   font-size: 32px;
   font-weight: 700;
   color: #c00000;
}

.btn-group {
   display: flex;
   flex-direction: column;
   gap: 10px;
   margin-bottom: 20px;
}

.btn-primary {
   background: #c00000;
   color: white;
   padding: 12px 20px;
   border: none;
   border-radius: 3px;
   font-size: 14px;
   font-weight: 600;
   cursor: pointer;
   text-decoration: none;
   display: block;
   text-align: center;
   transition: background 0.3s ease;
}

.btn-primary:hover {
   background: #900000;
   color: white;
   text-decoration: none;
}

.btn-secondary {
   background: #fff;
   color: #c00000;
   padding: 12px 20px;
   border: 1px solid #c00000;
   border-radius: 3px;
   font-size: 14px;
   font-weight: 600;
   cursor: pointer;
   text-decoration: none;
   display: block;
   text-align: center;
   transition: all 0.3s ease;
}

.btn-secondary:hover {
   background: #c00000;
   color: white;
   text-decoration: none;
}

.thumbnail-gallery {
   display: flex;
   gap: 10px;
   margin: 40px 0;
   overflow-x: hidden;
   overflow-y: hidden;
   padding: 0 10px;
   scroll-behavior: smooth;
   user-select: none;
   -webkit-overflow-scrolling: touch;
}

.thumbnail-gallery.dragging {
   scroll-behavior: auto;
}

.thumbnail-item {
   flex: 0 0 auto;
   width: 100px;
   height: 100px;
   border: 2px solid transparent;
   border-radius: 4px;
   overflow: hidden;
   cursor: grab;
   transition: all 0.3s ease;
   background: #f5f5f5;
}

.thumbnail-gallery.dragging .thumbnail-item {
   cursor: grabbing;
}

.thumbnail-item:hover,
.thumbnail-item.active {
   border-color: #c00000;
   transform: scale(1.05);
}

.thumbnail-item img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   pointer-events: none;
   user-select: none;
}

.detail-tabs {
   border-bottom: 2px solid #f0f0f0;
   display: flex;
   gap: 0;
   margin-bottom: 30px;
}

.detail-tab {
   padding: 15px 20px;
   border: none;
   background: none;
   color: #666;
   font-size: 14px;
   font-weight: 600;
   cursor: pointer;
   border-bottom: 3px solid transparent;
   transition: all 0.3s ease;
   text-transform: uppercase;
}

.detail-tab.active {
   color: #c00000;
   border-bottom-color: #c00000;
}

.detail-tab:hover {
   color: #333;
}

.tab-content {
   display: none;
}

.tab-content.active {
   display: block;
}

.description-text {
   color: #666;
   line-height: 24px;
   margin-bottom: 20px;
   text-align: justify;
}

.specifications-table {
   width: 100%;
   border-collapse: collapse;
   margin-bottom: 20px;
}

.specifications-table td {
   padding: 12px;
   border-bottom: 1px solid #f0f0f0;
   font-size: 14px;
}

.specifications-table td:first-child {
   font-weight: 600;
   color: #333;
   width: 40%;
}

.specifications-table td:last-child {
   color: #666;
}

.features-list {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 15px;
   margin-bottom: 20px;
}

.feature-item {
   display: flex;
   align-items: center;
   gap: 10px;
   color: #666;
   font-size: 14px;
}

.feature-item:before {
   content: '✓';
   color: #c00000;
   font-weight: bold;
   font-size: 18px;
   flex-shrink: 0;
}

.modal {
   display: none;
   position: fixed;
   z-index: 1000;
   left: 0;
   top: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, 0.8);
   padding: 20px;
}

.modal.active {
   display: flex;
   align-items: center;
   justify-content: center;
}

.modal-content {
   max-width: 90%;
   max-height: 90%;
   position: relative;
}

.modal-content img {
   width: 100%;
   height: auto;
   max-height: 80vh;
   object-fit: contain;
   user-select: none;
   -webkit-user-select: none;
   -moz-user-select: none;
   -ms-user-select: none;
   draggable: false;
}

.modal-close {
   position: absolute;
   top: -40px;
   right: 0;
   color: white;
   font-size: 28px;
   font-weight: bold;
   cursor: pointer;
}

.modal-close:hover {
   color: #ccc;
}

.modal-nav {
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
   background: rgba(0, 0, 0, 0.5);
   color: white;
   border: none;
   padding: 15px 20px;
   font-size: 24px;
   cursor: pointer;
   border-radius: 4px;
   transition: background 0.3s ease;
   z-index: 1001;
   user-select: none;
   -webkit-user-select: none;
   -moz-user-select: none;
   -ms-user-select: none;
}

.modal-nav:hover {
   background: rgba(0, 0, 0, 0.8);
}

.modal-nav.prev {
   left: 20px;
}

.modal-nav.next {
   right: 20px;
}

.modal-counter {
   position: absolute;
   bottom: -40px;
   left: 50%;
   transform: translateX(-50%);
   color: white;
   font-size: 14px;
   white-space: nowrap;
}

@media (max-width: 768px) {
   .car-detail-main {
      flex-direction: column;
   }

   .car-detail-sidebar {
      flex: 1;
      width: 100%;
   }

   .car-detail-hero h1 {
      font-size: 32px;
   }

   .detail-tabs {
      flex-wrap: wrap;
   }

   .detail-tab {
      flex: 1;
      padding: 12px;
   }

   .features-list {
      grid-template-columns: 1fr;
   }
}

.text-limousine {
   color: #666;
   text-align: justify;
}