.brand-button { height: 64px; overflow: hidden; gap: 7px; }
.official-logo-crop { display: grid; place-items: center; width: 56px; height: 56px; overflow: hidden; flex: 0 0 56px; transform: translate(4px,-5px); }
.official-logo-crop img { display: block; width: 54px; height: 54px; object-fit: contain; }
.official-wordmark { display: flex; flex-direction: column; line-height: 1; }
.official-wordmark { transform: translateY(-1px); }
.official-wordmark b { color: #0754a1; font-size: 18px; }
.official-wordmark small { color: #555; font-size: 9px; font-weight: 850; letter-spacing: 1px; margin-top: 3px; }
.official-wordmark i { color: #666; font-size: 8px; font-style: normal; margin-top: 3px; }
@media (max-width: 620px) {
  .official-logo-crop { width: 46px; height: 46px; flex-basis: 46px; }
  .official-logo-crop img { width: 44px; height: 44px; }
  .official-wordmark b { font-size: 15px; }
  .official-wordmark small { font-size: 7px; }
  .official-wordmark i { font-size: 7px; }
  .brand-button { gap: 6px; }
  .official-logo-crop { transform: translate(4px,-4px); }
}

/* Dimensionamento finale: immagini grandi, intere e mai tagliate. */
.mini-thumb {
  height: 210px;
  padding: 8px;
  box-sizing: border-box;
}

.mini-product .mini-thumb img {
  width: 96% !important;
  height: 96% !important;
  max-width: 96% !important;
  max-height: 96% !important;
  object-fit: contain !important;
  object-position: center !important;
}

.mini-product.fit-inset .mini-thumb img {
  width: 86% !important;
  height: 86% !important;
  max-width: 86% !important;
  max-height: 86% !important;
}

#productDialog .detail > img {
  width: 100% !important;
  height: min(62vh, 620px) !important;
  min-height: 460px;
  object-fit: contain !important;
  object-position: center !important;
  background: #fff;
  padding: 14px 16px;
  box-sizing: border-box;
}

@media (max-width: 620px) {
  .mini-thumb {
    height: 190px;
    padding: 7px;
  }

  .mini-product .mini-thumb img {
    width: 96% !important;
    height: 96% !important;
    max-width: 96% !important;
    max-height: 96% !important;
  }

  .mini-product.fit-inset .mini-thumb img {
    width: 84% !important;
    height: 84% !important;
    max-width: 84% !important;
    max-height: 84% !important;
  }

  #productDialog .detail > img {
    height: 350px !important;
    min-height: 350px !important;
    object-fit: contain !important;
    object-position: center !important;
    padding: 10px 12px !important;
  }
}

/* Priorità finale: anche nel dialog mobile le due immagini restano sempre intere. */
#productDialog .detail .gallery-slide img {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Galleria completa: prima sagoma su bianco, poi immagine ambientata. */
.product-gallery {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #fff;
}
.product-card .product-gallery {
  aspect-ratio: 1 / 1;
  border-bottom: 1px solid #eef2f6;
}
.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  background: #f7f8fa;
}
.gallery-slide.white-slide { background: #fff; }
.gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain !important;
  object-position: center !important;
  background: transparent !important;
}
.gallery-slide.full-model {
  padding: 8px 14px 26px;
}
.gallery-slide.full-model img {
  width: 96% !important;
  height: 96% !important;
  max-width: 100%;
  max-height: 100%;
}
.gallery-slide.zoom-model {
  padding: 10px 12px 24px;
}
.gallery-slide.zoom-model img {
  width: 108% !important;
  height: 108% !important;
  max-width: 108%;
  max-height: 108%;
}
.gallery-slide figcaption {
  position: absolute;
  left: 12px;
  bottom: 11px;
  padding: 5px 9px;
  border: 1px solid rgba(7,84,161,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  color: #0754a1;
  font-size: 10px;
  font-weight: 800;
}
.gallery-arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 34px;
  height: 34px;
  border: 1px solid #dce5ed;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: #0754a1;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(16,36,59,.12);
  transform: translateY(-50%);
}
.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }
.gallery-dots {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 12px;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
}
.gallery-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b9c7d4;
}
.gallery-dots span.active { background: #0754a1; }

#productDialog .detail > .product-gallery {
  height: min(66vh, 640px);
  min-height: 480px;
}
#productDialog .detail .gallery-slide { padding: 28px; }
#productDialog .detail .gallery-arrow { width: 40px; height: 40px; }

/* Dopo il caricamento resta solo l'area utile della simulazione. */
.sim-layout.has-photo { grid-template-columns: minmax(0,1fr); }
.sim-layout.has-photo .sim-sidebar { display: none; }
.sim-layout.has-photo .preview-wrap { grid-column: 1 / -1; }
.sim-layout.has-photo .model-step { grid-column: 1 / -1; }

@media (max-width: 620px) {
  .product-card .gallery-slide { padding: 14px; }
  .product-card .gallery-arrow { width: 30px; height: 30px; font-size: 22px; }
  .gallery-slide figcaption { left: 8px; bottom: 8px; padding: 4px 7px; font-size: 9px; }
  .gallery-dots { bottom: 9px; }
  #productDialog .detail > .product-gallery {
    height: min(48vh, 420px);
    min-height: 330px;
  }
  #productDialog .detail .gallery-slide { padding: 18px; }
}

/* Allineamento definitivo del marchio */
.brand-button { height: 64px; gap: 10px; align-items: center; overflow: visible; }
.official-logo-crop { position: relative; width: 58px; height: 58px; flex: 0 0 58px; overflow: hidden; transform: none; }
.official-logo-crop img { position: absolute; left: 50%; top: 50%; width: 345%; height: auto; max-width: none; transform: translate(-50%,-50%); object-fit: initial; }
.official-wordmark { transform: none; justify-content: center; }

/* Sei immagini pilota del catalogo */
.product-photo.context::before, .product-photo.cutout::before { display: none; }
.product-photo.context { background: #eef3f6; }
.product-photo.context .product-image { object-fit: cover !important; background: transparent; }
.product-photo.cutout { background: #fff; padding: 10px; }
.product-photo.cutout .product-image { object-fit: contain !important; background: #fff; }

/* Nuovo percorso del simulatore */
.sim-layout { grid-template-columns: 360px minmax(0,1fr); align-items: start; }
.sim-sidebar { order: 1; }
.preview-wrap { order: 2; }
.model-step { grid-column: 1 / -1; order: 3; margin-top: 12px; padding: 28px; border: 1px solid #dce5ed; border-radius: 22px; background: #fff; }
.model-step .sim-note { font-size: 15px; margin: 0 0 20px; color: #52657a; }
.mini-products { grid-template-columns: repeat(4,minmax(0,1fr)); max-height: none; gap: 14px; }
.mini-product { min-width: 0; padding: 10px; }
.mini-product img { width: 100%; height: 165px; object-fit: contain !important; background: #fff; border-radius: 10px; }

@media (max-width: 950px) {
  .sim-layout { grid-template-columns: 1fr; }
  .sim-sidebar { order: 1; }
  .preview-wrap { order: 2; }
  .model-step { grid-column: 1; order: 3; }
}
@media (max-width: 620px) {
  .brand-button { gap: 7px; }
  .official-logo-crop { width: 48px; height: 48px; flex-basis: 48px; transform: none; }
  .official-logo-crop img { width: 345%; height: auto; }
  .model-step { padding: 18px; }
  .mini-products { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .mini-product img { height: 140px; }
}
.catalog-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.catalog-row .search { flex: 1; }
.sort-control { display: flex; align-items: center; gap: 10px; color: #657487; font-size: 13px; font-weight: 700; }
.sort-control select { min-width: 210px; padding: 12px 38px 12px 13px; border: 1px solid #dce5ed; border-radius: 12px; background: white; color: #10243b; }
.product-image, .mini-product img { object-fit: contain; }
.search, .search input { background: #fff !important; }
.product-image, .mini-product img, .detail img, .hero-visual > img { object-fit: contain !important; background: #fff; }

/* Correzione definitiva marchio e miniature */
.brand-button { height:64px; gap:9px; align-items:center; overflow:visible; }
.official-logo-crop { position:static; display:grid; place-items:center; width:48px; height:52px; flex:0 0 48px; overflow:visible; transform:none; }
.official-logo-crop img { position:static; display:block; width:100%; height:100%; max-width:100%; object-fit:contain; object-position:center; transform:none; }
.mini-product { padding:10px; }
.mini-thumb { display:grid; place-items:center; width:100%; height:190px; overflow:hidden; background:#fff; border-radius:10px; }
.mini-product .mini-thumb img { display:block; width:100% !important; height:100% !important; max-width:none !important; object-fit:contain !important; object-position:center !important; opacity:1 !important; }
@media (max-width:620px){
  .brand-button{gap:8px}
  .official-logo-crop{width:44px;height:48px;flex-basis:44px}
  .mini-thumb{height:180px}
}
.product-photo { position: relative; aspect-ratio: 1; overflow: hidden; background: #eef3f6; }
.product-photo::before { content: ""; position: absolute; inset: -16px; background-image: var(--photo); background-size: cover; background-position: center; filter: blur(13px); opacity: .30; }
.product-photo .product-image { position: relative; width: 100%; height: 100%; aspect-ratio: auto; background: transparent; }
.product-card .heart { z-index: 4; display: grid; place-items: center; box-shadow: 0 3px 12px rgba(16,36,59,.18); }
.hero-visual > img { object-fit: cover !important; }
.icon-button.saved { background: #0754a1; color: white; }
.empty-favorites { grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: #657487; }
.empty-favorites span { display: block; font-size: 52px; color: #0754a1; }
.empty-favorites h3 { color: #10243b; margin-bottom: 6px; }
.empty-favorites p { margin-top: 0; }
@media (max-width: 620px) {
  .catalog-row { align-items: stretch; flex-direction: column; }
  .sort-control { justify-content: space-between; }
  .sort-control select { min-width: 0; flex: 1; }
}

.installations { padding: 90px max(6vw, 28px); background: #f3f8fc; text-align: center; }
.installations h2 { font-size: 42px; margin: 10px 0 8px; }
.installations > p { color: #657487; margin: 0 0 35px; }
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1180px; margin: auto; text-align: left; }
.video-card { background: white; border: 1px solid #dce5ed; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(16,36,59,.07); }
.video-card video { display: block; width: 100%; aspect-ratio: 9 / 14; max-height: 520px; object-fit: cover; background: #fff; }
.video-card > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px; }
.video-card h3 { margin: 0; font-size: 20px; }
.video-card .secondary { padding: 10px 13px; }
.google-review { margin: 80px max(6vw, 28px); padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border-radius: 24px; background: linear-gradient(125deg,#e8f4ff,#fff); border: 1px solid #cfe1f1; }
.google-review h2 { font-size: 32px; margin: 9px 0; }
.google-review p { margin: 0; color: #657487; }
.google-review a { text-decoration: none; white-space: nowrap; }
.sim-note { font-size: 12px; line-height: 1.4; color: #657487; }
.preview #overlayImage.realistic-overlay { mix-blend-mode: normal; opacity: 1; border-radius: 0; box-shadow: none; filter: drop-shadow(0 14px 12px rgba(0,0,0,.22)); }
.preview #overlayImage.blend-overlay { mix-blend-mode: multiply; border-radius: 0; box-shadow: none; filter: drop-shadow(0 12px 9px rgba(0,0,0,.18)) contrast(1.02); }
.preview #overlayImage.photo-overlay { mix-blend-mode: normal; opacity: 1; border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.18); filter: none; }
.preview #overlayImage.full-model-overlay { object-fit: contain; object-position: center; }
.simulation-pending { padding: 11px 13px; border-radius: 10px; background: #eef3f6; color: #657487; text-align: center; font-weight: 750; }

.contact-strip { margin: 0 max(6vw,28px) 90px; display: grid; grid-template-columns: 1.55fr .75fr; gap: 20px; }
.location-card, .social-card { background: #fff; border: 1px solid #dce5ed; border-radius: 22px; padding: 28px; box-shadow: 0 10px 30px rgba(16,36,59,.06); }
.location-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; }
.location-card h2 { margin: 5px 0; font-size: 24px; }
.location-card p, .social-card p { margin: 0; color: #657487; }
.location-card a { text-decoration: none; text-align: center; }
.contact-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #e8f4ff; color: #0754a1; font-size: 28px; }
.contact-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.social-card { text-align: center; }
.social-actions { display: flex; gap: 10px; margin-top: 18px; }
.social { flex: 1; padding: 12px; border-radius: 12px; color: #fff; font-weight: 800; text-decoration: none; }
.social { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.social svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.social svg .fill { fill: currentColor; stroke: none; }
.tiktok svg { fill: currentColor; stroke: none; }
.instagram { background: linear-gradient(135deg,#8a3ab9,#e95950); }
.tiktok { background: #111; }

@media (max-width: 820px) {
  .contact-strip { grid-template-columns: 1fr; }
  .location-card { grid-template-columns: auto 1fr; }
  .location-card a { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .hero { padding-top: 64px; }
  .hero-visual { margin-top: 8px; }
  .hero-visual > img { height: 370px; object-position: center; }
  .hero-visual { margin-bottom: 28px; }
  .floating-card { bottom: -18px; padding: 11px 20px; }
  .installations { padding: 65px 18px; }
  .installations h2 { font-size: 34px; }
  .video-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; padding: 2px 2px 15px; }
  .video-card { min-width: 82vw; scroll-snap-align: center; }
  .video-card video { max-height: 440px; }
  .google-review { margin: 55px 18px; padding: 28px 22px; display: block; text-align: center; }
  .google-review h2 { font-size: 27px; }
  .google-review .primary { display: block; margin-top: 23px; white-space: normal; }
  .controls { display: flex !important; flex-wrap: wrap; }
  .controls label { min-width: 42%; }
  .contact-strip { margin: 0 18px 70px; }
  .location-card, .social-card { padding: 22px 18px; }
  .location-card { grid-template-columns: 1fr; text-align: center; }
  .contact-icon { margin: auto; }
  .social-actions { flex-direction: column; }
  #productDialog { max-height: calc(100dvh - 22px); overflow: auto; border-radius: 19px; }
  #productDialog .detail img { height: 255px; object-fit: cover !important; object-position: center; }
  #productDialog .detail-copy { padding: 13px 19px 16px; }
  #productDialog .detail-copy h2 { font-size: 25px; margin: 4px 0; }
  #productDialog .detail-price { font-size: 25px; }
  #productDialog .detail-list { margin: 6px 0 9px; font-size: 12.5px; line-height: 1.45; }
  #productDialog .detail-actions { gap: 7px; }
  #productDialog .detail-actions .large, #productDialog .detail-actions .secondary { padding: 12px 13px; }
  #productDialog .dialog-close { position: fixed; }
  .heart { right: 8px; top: 8px; width: 34px; height: 34px; }
}

/* Dimensionamento finale: immagini grandi, intere e mai tagliate. */
.mini-thumb {
  height: 210px;
  padding: 8px;
  box-sizing: border-box;
}

.mini-product .mini-thumb img {
  width: 96% !important;
  height: 96% !important;
  max-width: 96% !important;
  max-height: 96% !important;
  object-fit: contain !important;
  object-position: center !important;
}

.mini-product.fit-inset .mini-thumb img {
  width: 86% !important;
  height: 86% !important;
  max-width: 86% !important;
  max-height: 86% !important;
}
.mini-product.fit-zoom .mini-thumb img {
  width: 112% !important;
  height: 112% !important;
  max-width: 112% !important;
  max-height: 112% !important;
}
.mini-product.fit-zoom.fit-inset .mini-thumb img {
  width: 104% !important;
  height: 104% !important;
  max-width: 104% !important;
  max-height: 104% !important;
}

#productDialog .detail > img {
  width: 100%;
  height: min(62vh, 620px);
  min-height: 460px;
  object-fit: contain !important;
  object-position: center;
  background: #fff;
  padding: 14px 16px;
  box-sizing: border-box;
}

@media (max-width: 620px) {
  .mini-thumb { height: 190px; }

  .mini-product .mini-thumb img {
    width: 96% !important;
    height: 96% !important;
    max-width: 96% !important;
    max-height: 96% !important;
  }

  .mini-product.fit-inset .mini-thumb img {
    width: 84% !important;
    height: 84% !important;
    max-width: 84% !important;
    max-height: 84% !important;
  }

  .mini-product.fit-zoom .mini-thumb img {
    width: 114% !important;
    height: 114% !important;
    max-width: 114% !important;
    max-height: 114% !important;
  }

  #productDialog .detail > img {
    height: min(54vh, 430px);
    min-height: 350px;
    object-fit: contain !important;
    padding: 10px 12px;
  }
}

/* Ritocco finale: modelli piu presenti, sempre interi. */
.product-card .gallery-slide.white-slide {
  padding: 8px 8px 22px !important;
}
.product-card .gallery-slide.zoom-model {
  padding: 3px 4px 20px !important;
}
.product-card .gallery-slide.zoom-model img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}
.product-card .gallery-slide.full-model {
  padding: 5px 10px 22px !important;
}
.product-card .gallery-slide.full-model img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}
.mini-product.fit-zoom .mini-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}
.mini-product.fit-inset .mini-thumb img {
  width: 96% !important;
  height: 96% !important;
  max-width: 96% !important;
  max-height: 96% !important;
}
.mini-thumb {
  padding: 4px !important;
}

@media (max-width: 620px) {
  .product-card .gallery-slide.white-slide {
    padding: 5px 5px 20px !important;
  }
  .product-card .gallery-slide.zoom-model {
    padding: 2px 3px 18px !important;
  }
  .product-card .gallery-slide.zoom-model img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }
  .product-card .gallery-slide.full-model {
    padding: 3px 7px 20px !important;
  }
  .product-card .gallery-slide.full-model img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }
  .mini-product.fit-zoom .mini-thumb img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }
}

#productDialog .detail .gallery-slide img {
  object-fit: contain !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Prova: ogni modello deve essere sempre visibile per intero. */
.mini-thumb {
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  background: #fff !important;
  padding: 8px !important;
}
.mini-product .mini-thumb img,
.mini-product.fit-inset .mini-thumb img,
.mini-product.fit-zoom .mini-thumb img,
.mini-product.fit-zoom.fit-inset .mini-thumb img {
  display: block !important;
  width: 92% !important;
  height: 92% !important;
  max-width: 92% !important;
  max-height: 92% !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform: none !important;
}
@media (max-width: 620px) {
  .mini-thumb { height: 190px !important; padding: 8px !important; }
  .mini-product .mini-thumb img,
  .mini-product.fit-inset .mini-thumb img,
  .mini-product.fit-zoom .mini-thumb img,
  .mini-product.fit-zoom.fit-inset .mini-thumb img {
    width: 90% !important;
    height: 90% !important;
    max-width: 90% !important;
    max-height: 90% !important;
  }
}

/* FINAL FIX — sezione Prova: il modello deve essere sempre interamente visibile. */
.mini-products .mini-product .mini-thumb {
  width: 100% !important;
  height: 190px !important;
  min-height: 190px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 10px !important;
  background: #fff !important;
}
.mini-products .mini-product .mini-thumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
@media (max-width: 620px) {
  .mini-products .mini-product .mini-thumb {
    height: 178px !important;
    min-height: 178px !important;
    padding: 8px !important;
  }
}
