/* =========================================================
   PRODOTTO — scheda singolo prodotto
   ========================================================= */

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--linea);
}

/* galleria: rail di miniature + immagine principale */
.product-gallery {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  min-width: 0;
  background: var(--carta);
}
.thumbs { display: flex; flex-direction: column; border-right: 1px solid var(--linea); }
.thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--linea);
  background: var(--bianco);
  padding: 0;
  cursor: pointer;
  opacity: .55;
  transition: opacity .2s, box-shadow .2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: .85; }
.thumb.is-active { opacity: 1; box-shadow: inset -4px 0 0 var(--rosso); }
.product-main { position: relative; min-height: 560px; overflow: hidden; }
.product-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.product-main .product__flag { font-size: 1rem; padding: .6rem .9rem; }
.avail-badge {
  position: absolute; left: 1rem; bottom: 1rem;
  background: var(--bianco);
  padding: .45rem .75rem;
  font-size: .85rem;
}

/* info */
.product-info {
  padding: clamp(2rem, 4vw, 3.5rem) var(--gutter) clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.product-info__brand { font-weight: 700; color: var(--rosso); }
.product-info__brand small { color: var(--fumo); font-weight: 400; margin-left: .6rem; }
.product-info h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); }
.product-info__code { color: var(--fumo); font-size: .9rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--linea); }
.product-info .lead { font-size: 1.05rem; }
.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--linea);
}
.highlights div { padding: 1rem 1.1rem; border-right: 1px solid var(--linea); }
.highlights div:last-child { border-right: 0; }
.highlights strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 2.1rem; line-height: 1; }
.highlights span { font-size: .8rem; color: var(--fumo); }
.product-cta {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--linea);
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.product-cta__row { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.product-cta .form-note { text-align: center; }

/* tab */
.tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 var(--gutter);
  background: var(--bianco);
  border-bottom: 1px solid var(--linea);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 1.05rem 0;
  margin-right: 2rem;
  font-weight: 700;
  font-size: .95rem;
  color: var(--fumo);
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--nero); }
.tab.is-active { color: var(--nero); border-bottom-color: var(--rosso); }

.tab-panel { display: none; padding: clamp(2.5rem, 5vw, 4.5rem) var(--gutter); border-bottom: 1px solid var(--linea); }
.tab-panel.is-active { display: block; }
.tab-panel__inner { max-width: 1320px; margin: 0 auto; }
.tab-panel h2 { font-size: clamp(1.8rem, 2.6vw, 2.4rem); margin-bottom: 1.6rem; }

.desc { display: grid; grid-template-columns: 1fr 360px; gap: clamp(2rem, 4vw, 4rem); }
.desc__text p { margin-bottom: 1.1rem; line-height: 1.75; }
.desc__text h3 { font-size: 1.5rem; margin: 1.6rem 0 .6rem; }
.aside-block { background: var(--carta); padding: 1.4rem; margin-bottom: 1.2rem; }
.aside-block h4 { font-size: 1.3rem; margin-bottom: .7rem; }
.aside-block ul { list-style: none; }
.aside-block li { position: relative; padding: .3rem 0 .3rem 1.1rem; font-size: .93rem; }
.aside-block li::before {
  content: '';
  position: absolute; left: 0; top: .75rem;
  border-style: solid; border-width: 0 8px 8px 0;
  border-color: transparent var(--rosso) transparent transparent;
}
.energy { display: flex; flex-direction: column; gap: 4px; }
.energy div { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; }
.energy b { width: 44px; text-align: center; color: var(--bianco); font-size: .75rem; padding: 2px 4px; }
.energy i { height: 14px; display: block; }
.energy small { color: var(--verde); font-weight: 700; }

.spec-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.spec-group h3 { font-size: 1.3rem; padding-bottom: .55rem; border-bottom: 2px solid var(--nero); margin-bottom: .4rem; }
.spec-group table { width: 100%; border-collapse: collapse; }
.spec-group td { padding: .55rem 0; font-size: .92rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
.spec-group td:first-child { color: var(--fumo); width: 50%; padding-right: .75rem; }
.spec-group tr:last-child td { border-bottom: 0; }

.pgallery { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 250px; gap: 6px; }
.pgallery figure { position: relative; overflow: hidden; background: var(--carta-2); margin: 0; }
.pgallery img { width: 100%; height: 100%; object-fit: cover; }
.pgallery figcaption { position: absolute; left: 0; bottom: 0; background: rgba(15,15,15,.78); color: var(--bianco); font-size: .8rem; padding: .35rem .65rem; }
.p1 { grid-column: span 5; } .p2 { grid-column: span 4; } .p3 { grid-column: span 3; }
.p4 { grid-column: span 3; } .p5 { grid-column: span 5; } .p6 { grid-column: span 4; }
.pgallery + .form-note { margin-top: 1rem; text-align: center; }

.docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.doc {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.2rem;
  border: 1px solid var(--linea);
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, background .2s;
}
.doc:hover { border-color: var(--nero); background: var(--carta); }
.doc__icon {
  flex-shrink: 0;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--nero);
  color: var(--bianco);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9rem;
}
.doc__name { font-weight: 700; }
.doc__size { font-size: .82rem; color: var(--fumo); }

.related__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 1100px) {
  .spec-groups { grid-template-columns: repeat(2, 1fr); }
  .related__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .product-hero { grid-template-columns: 1fr; }
  .product-gallery { grid-template-columns: 1fr; }
  .thumbs { flex-direction: row; order: 2; border-right: 0; border-top: 1px solid var(--linea); }
  .thumb { flex: 1 1 0; min-width: 0; border-bottom: 0; border-right: 1px solid var(--linea); }
  .thumb.is-active { box-shadow: inset 0 4px 0 var(--rosso); }
  .product-main { min-height: 0; aspect-ratio: 4 / 3; }
  .product-info { padding: 2rem var(--gutter); }
  .desc { grid-template-columns: 1fr; }
  .docs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .spec-groups, .docs, .related__grid { grid-template-columns: 1fr; }
  .pgallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 170px; }
  .p1, .p2, .p3, .p4, .p5, .p6 { grid-column: span 1; }
  .highlights strong { font-size: 1.6rem; }
  .product-cta__row { grid-template-columns: 1fr; }
}
