/* =============================================
   DBS AUTO — Pagina Dettaglio Veicolo
   ============================================= */

/* ── Fix card cliccabile in index ── */
.auto-body-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.auto-body-link:hover .auto-cta-link {
  color: var(--purple);
  gap: 8px;
}
.auto-body-link:hover {
  background: rgba(204,18,18,.03);
}

/* ── BODY ── */
.dettaglio-page {
  background: var(--white);
}

/* ── BREADCRUMB ── */
.det-breadcrumb {
  background: var(--dark);
  padding: 14px 0;
  margin-top: 80px;
}
.det-breadcrumb .container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.det-breadcrumb a {
  color: rgba(255,255,255,.6);
  font-size: .8rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}
.det-breadcrumb a:hover { color: var(--white); }
.det-breadcrumb .fa-chevron-right { color: rgba(255,255,255,.3); font-size: .65rem; }
.det-breadcrumb span {
  color: var(--purple);
  font-size: .8rem;
  font-weight: 600;
}

/* ── MAIN ── */
.det-main {
  padding: 40px 0 80px;
  background: #F7F7F8;
  min-height: 80vh;
}

/* ── LOADING / ERROR ── */
.det-loading-state,
.det-error-state {
  text-align: center;
  padding: 80px 20px;
}
.det-loading-state i,
.det-error-state i {
  font-size: 3rem;
  color: var(--purple);
  display: block;
  margin-bottom: 16px;
}
.det-error-state h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--dark);
}
.det-error-state p {
  color: #666;
  margin-bottom: 24px;
}

/* ── MOBILE HEADER ── */
.det-mobile-header {
  display: none;
  margin-bottom: 20px;
}
.det-title-mobile {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark);
  margin-top: 8px;
  line-height: 1.2;
}

/* ── LAYOUT PRINCIPALE ── */
.det-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 32px;
  align-items: start;
}

/* ── GALLERIA ── */
.det-gallery-col {
  position: sticky;
  top: 90px;
}

.det-main-photo {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--dark);
  aspect-ratio: 16/10;
  cursor: zoom-in;
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
}
.det-main-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.det-main-photo:hover img { transform: scale(1.02); }

.det-photo-counter {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  backdrop-filter: blur(8px);
}

.det-zoom-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  transition: background .2s;
  backdrop-filter: blur(8px);
}
.det-zoom-btn:hover { background: var(--purple); }

.det-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  transition: background .2s, transform .2s;
  backdrop-filter: blur(8px);
  z-index: 2;
}
.det-arrow:hover { background: var(--purple); transform: translateY(-50%) scale(1.1); }
.det-prev { left: 12px; }
.det-next { right: 12px; }

/* ── THUMBNAILS ── */
.det-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.det-thumb {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
  flex-shrink: 0;
  background: #ddd;
}
.det-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.det-thumb:hover { border-color: var(--purple); transform: translateY(-2px); }
.det-thumb.active { border-color: var(--purple); }

/* ── INFO COLONNA ── */
.det-info-col {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

/* ── BADGE ── */
.det-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.det-badge-cat {
  background: var(--dark);
  color: var(--white);
  font-size: .72rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 50px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.det-badge-special {
  font-size: .72rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 50px;
  letter-spacing: .5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}

/* ── TITOLO ── */
.det-title {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 10px;
}

/* ── DESCRIZIONE ── */
.det-desc {
  font-size: .9rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #EBEBED;
}

/* ── SPECIFICHE ── */
.det-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.det-spec-item {
  background: #F7F7F8;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #EBEBED;
}
.det-spec-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}
.det-spec-value {
  font-size: .95rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.1;
}
.det-spec-label {
  font-size: .72rem;
  color: #999;
  font-weight: 500;
  margin-top: 2px;
}

/* ── PREZZO ── */
.det-price-box {
  background: linear-gradient(135deg, var(--dark) 0%, #1A1A1A 100%);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.det-price-label {
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.det-price-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}
.det-price-iva {
  font-size: .78rem;
  color: var(--purple);
  font-weight: 600;
  margin-top: 4px;
}

/* ── CTA ── */
.det-cta-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.det-cta-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .25s ease;
}
.det-cta-wa:hover { background: #1EB95A; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,211,102,.3); }
.det-cta-wa .fa-whatsapp { font-size: 1.2rem; }

.det-cta-tel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  color: var(--dark);
  border: 2px solid var(--dark);
  padding: 13px 20px;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .25s ease;
}
.det-cta-tel:hover { background: var(--dark); color: var(--white); }

/* ── NOTE ── */
.det-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .78rem;
  color: #777;
  font-weight: 500;
}
.det-notes .fa-circle-check { color: var(--purple); margin-right: 3px; }

/* ── SPECS RAPIDE ── */
.det-specs-quick {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid #EBEBED;
  border-radius: 12px;
  overflow: hidden;
}
.det-sq-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 8px;
  font-size: .78rem;
  color: var(--dark);
  border-right: 1px solid #EBEBED;
  text-align: center;
}
.det-sq-item:last-child { border-right: none; }
.det-sq-item i { color: var(--purple); font-size: .9rem; }
.det-sq-item span { font-weight: 800; font-size: .82rem; }
.det-sq-item small { color: #999; font-size: .68rem; font-weight: 500; }

/* ── SEZIONE TECNICA DARK ── */
.det-tech-section {
  background: #111111;
  border-radius: 20px;
  margin-top: 40px;
  padding: 32px;
  overflow: hidden;
}

/* ── GRIGLIA SPECS PRINCIPALE ── */
.det-tech-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 36px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  overflow: hidden;
}
.det-tech-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  border-right: 1px solid rgba(255,255,255,.06);
}
.det-tech-row:nth-child(even) { border-right: none; }
.det-tech-row:nth-last-child(-n+2) { border-bottom: none; }
.det-tech-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.5);
  font-size: .82rem;
  font-weight: 500;
}
.det-tech-left i { color: var(--purple); width: 16px; text-align: center; }
.det-tech-right {
  font-size: .88rem;
  font-weight: 800;
  color: var(--white);
  text-align: right;
}

/* ── TABS EQUIPAGGIAMENTI ── */
.det-tabs-wrap {
  margin-bottom: 32px;
}
.det-tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(255,255,255,.08);
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.det-tabs-nav::-webkit-scrollbar { display: none; }
.det-tab-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  font-size: .82rem;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s ease;
  font-family: var(--font);
}
.det-tab-btn:hover { color: rgba(255,255,255,.8); }
.det-tab-btn.active {
  color: var(--white);
  border-bottom-color: var(--purple);
}

.det-tab-content {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 24px;
}
.det-tab-panel { display: none; }
.det-tab-panel.active { display: block; }

/* ── LISTA EQUIPAGGIAMENTI ── */
.det-equip-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}
.equip-col { display: contents; }
.det-equip-list li {
  color: rgba(255,255,255,.8);
  font-size: .85rem;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.det-equip-list li::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
  flex-shrink: 0;
}

/* ── DATA GRID (emissioni, dettagli, motore, esterni) ── */
.det-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.det-data-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding-right: 24px;
}
.det-data-label {
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  font-weight: 500;
}
.det-data-val {
  font-size: .92rem;
  font-weight: 800;
  color: var(--white);
}

/* ── DESCRIZIONE COMPLETA ── */
.det-full-desc {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.det-full-desc-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.det-full-desc-title i { color: var(--purple); }
.det-full-desc-text {
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  line-height: 1.85;
  white-space: pre-line;
}
.det-full-desc-text .desc-check { color: #22C55E; }
.det-full-desc-text .desc-bullet { color: var(--purple); }

/* ── ALTRE AUTO ── */
.det-other-section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid #EBEBED;
}
.det-other-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 24px;
}
.det-other-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.det-other-card {
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  border: 1px solid #EBEBED;
  transition: all .25s ease;
  display: block;
}
.det-other-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  border-color: var(--purple);
}
.det-other-img {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--dark);
}
.det-other-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.det-other-card:hover .det-other-img img { transform: scale(1.05); }
.det-other-body {
  padding: 14px;
}
.det-other-cat {
  font-size: .68rem;
  font-weight: 800;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: block;
  margin-bottom: 4px;
}
.det-other-title {
  font-size: .9rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
  line-height: 1.3;
}
.det-other-specs {
  display: flex;
  gap: 10px;
  font-size: .72rem;
  color: #888;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.det-other-specs i { color: var(--purple); margin-right: 3px; }
.det-other-price {
  font-size: .95rem;
  font-weight: 900;
  color: var(--dark);
}
.det-other-cta { text-align: center; }

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.95);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}
.lightbox.open { display: flex; }
.lb-inner {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}
.lb-close {
  position: fixed; top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%; background: rgba(255,255,255,.1);
  color: #fff; border: none; cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 9001;
}
.lb-close:hover { background: var(--purple); }
.lb-arrow {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff; border: none;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 9001;
}
.lb-arrow:hover { background: var(--purple); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-counter {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.6); font-size: .85rem; font-weight: 600;
  background: rgba(0,0,0,.5); padding: 6px 16px; border-radius: 50px;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .det-layout { grid-template-columns: 1fr; }
  .det-gallery-col { position: static; }
  .det-other-grid { grid-template-columns: repeat(2, 1fr); }
  .det-mobile-header { display: block; }
  .det-badges:first-child, .det-title { display: none; }
  .det-tech-grid { grid-template-columns: 1fr; }
  .det-tech-row { border-right: none; }
  .det-tech-row:nth-last-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.06); }
  .det-tech-row:last-child { border-bottom: none; }
  .det-data-grid { grid-template-columns: 1fr; }
  .det-equip-list { grid-template-columns: 1fr; }
  .det-tech-section { padding: 20px; border-radius: 12px; }
}

@media (max-width: 600px) {
  .det-main { padding: 24px 0 60px; }
  .det-info-col { padding: 20px; border-radius: 12px; }
  .det-title { font-size: 1.4rem; }
  .det-price-value { font-size: 1.6rem; }
  .det-specs-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .det-other-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .det-thumbs { gap: 7px; }
  .det-thumb { width: 64px; height: 48px; }
  .det-cta-group { flex-direction: column; }
}
