/* Reset + box model coerente */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f8f8f8;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 10px 70px 10px;
}

.main-title {
  text-align: center;
  font-family: Arial, Times, serif;
  font-size: 25pt;
  font-weight: 800;
  margin: 10px 10px 10px 10px;
  line-height: 5;     /* ⬅ ALTEZZA RIGA */
  margin-bottom: 30px;
}

.subtitle {
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 18pt;
  color: blue;
  margin: 25px 0 75px 0;
}

.main-image {
  display: block;
  margin: 3rem auto 30px auto;
  width: 80%;
  max-width: 600px;
  height: auto;
}

/* GRIGLIA: 3 colonne desktop */
.cards {
  display: grid;
  gap: 32px;
  justify-content: center;
  grid-template-columns: repeat(3, 340px);
}

/* NISSAN: rosso, Arial bold, contorno nero */
.nissanred{
  font-family: Arial, sans-serif;
  font-weight: 900;
  color: red;
  font-size: 40px;
  line-height: 1;
  margin: 20px 0 20px 0;
}

/* CUBE: compatta distanza da NISSAN */
.cube-title{
  font-family: Arial, sans-serif;
  font-size: 60px;
  font-weight: 900;
  line-height: 1;
  margin: 0;                   /* niente spazi extra */
  margin-top: 6px;            /* AVVICINA NISSAN e CUBE (regola fine) */
}


/* CARD */
.card {
  background: #fff;
  border: 4px solid #111;
  border-radius: 16px;
  padding: 24px 20px 16px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Immagine “singola” (card senza galleria) */
.card > img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  border-radius: 8px;
  background: #eee;
  margin-bottom: 16px;
  border: 2px solid #c4c4c4;
}

/* Testi */
.card .label {
  font-size: 20px;
  font-weight: bold;
  text-align: left;
  width: 100%;
  margin-bottom: 0;
  color: #222;
}

.card .code,
.card .desc {
  font-size: 18px;
  text-align: left;
  width: 100%;
  margin-bottom: 10px;
  color: #2c2c2c;
}

.card hr {
  width: 100%;
  border: 0;
  border-top: 2px solid #bbb;
  margin: 10px 0;
}

/* BACKLINKS */
.backlinks {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  margin-bottom: 0;
}

.backlinks a {
  font-family: "Times New Roman", Times, serif;
  color: #111;
  font-size: 27px;
  font-weight: bold;
  text-decoration: none;
  margin: 0 22px;
  transition: color 0.15s;
}

.backlinks a:hover {
  color: #4682B4;
  text-decoration: underline;
}

/* HOVER/ZOOM hint */
img.zoomable {
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

img.zoomable:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* OVERLAY */
.image-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.image-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.image-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
  cursor: zoom-out;
}

/* Frecce overlay */
.image-overlay .overlay-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: rgba(0,0,0,0.35);
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.image-overlay .overlay-nav.prev { left: 18px; }
.image-overlay .overlay-nav.next { right: 18px; }

.image-overlay .overlay-nav:hover {
  background: rgba(0,0,0,0.55);
}

/* PREZZI */
.price {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.old-price {
  color: #c00000;
  text-decoration: line-through;
  font-size: 20px;
  font-weight: 700;
  opacity: 0.85;
}

.new-price {
  color: #0a8a0a;
  font-size: 22px;
  font-weight: 800;
}

/* =========================
   GALLERIA (desktop/tablet)
   ========================= */
.gallery {
  width: 100%;
  position: relative;
}

/* Immagine principale in galleria (miniatura) */
.gallery .main-photo {
  width: 100%;
  height: 160px;
  object-fit: contain;
  border-radius: 8px;
  background: #eee;
  border: 2px solid #c4c4c4;
  margin-bottom: 16px;
  cursor: zoom-in;
  display: block;
}

/* NASCONDI SEMPRE le altre immagini */
.thumbs {
  display: none !important;
}

/* Contatore sopra la miniatura (non deve andare nel testo) */
.gallery .counter {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  z-index: 2;
  pointer-events: none;
  display: inline-block;
}


/* TABLET: 2 colonne */
@media (max-width: 1100px) {
  
  .cards {
    gap: 16px;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

/* MOBILE: 1 colonna + nascondi thumbnails */
@media (max-width: 600px) {

    .main-image { width: 70%; max-width: 99vw; height: auto; }
    
    .main-title {
     text-align: center;
     font-family: Arial, Times, serif;
     font-size: 20pt; /* ⬅ ADIMENSIONE SCRITTA ULTIMI RICAMBI SU MOBILE */
     margin: 5px 10px 1px 10px;
     line-height: 5;     /* ⬅ ALTEZZA RIGA */
    }

    .subtitle {
      text-align: center;
      font-family: "Times New Roman", Times, serif;
      font-size: 18pt;
      color: blue;
      margin: 25px 0 75px 0;
    }

    /* NISSAN: rosso, Arial bold, contorno nero */
    .nissanred{
      font-family: Arial, sans-serif;
      font-weight: 900;
      color: red;
      font-size: 40px;
      
      line-height: 1;
      margin: 20px 0 10px 0;
    }

    .cube-title {
        font-family: "Arial Black", Arial, sans-serif;
        line-height: 1;
        font-size: 45px;
        font-weight: 900;
        margin: 0 0 20px 0;
        text-shadow:
          1px 0 0 #000,
         -1px 0 0 #000,
          0 1px 0 #000,
          0 -1px 0 #000;
          
  }
    
  .subtitle { font-size: 13pt; }

  .cards { gap: 8px; grid-template-columns: 1fr; }
  .card { padding: 7px 2vw 10px 2vw; }

  .backlinks { flex-direction: column; gap: 10px; align-items: center; }
  .backlinks a { font-size: 19px; }

  .thumbs { display: none !important; }
}