.b2bhg-gallery {
  padding: 0;
}

.b2bhg-slider {
  display: flex;
  height: 500px;
  gap: 0;
}

/* Blocchi base: ogni slot è un contenitore relativo */
.b2bhg-slide {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 1.2rem;
  border-radius: 0;
  overflow: hidden;
  background-color: #F5F5F5;
}

/* Hero: riempie lo spazio residuo */
.b2bhg-left {
  flex: 1;
  height: 500px;
}

/* Due blocchi centrali 9:16 */
.b2bhg-center-1,
.b2bhg-center-2 {
  flex: 0 0 281.25px;
  height: 500px;
}

/* Colonna destra: due quadrati 250x250 */
.b2bhg-right {
  display: flex;
  flex-direction: column;
  flex: 0 0 250px;
  height: 500px;
}

.b2bhg-top-right,
.b2bhg-bottom-right {
  width: 250px;
  height: 250px;
}

/* Mobile: slider orizzontale */
@media (max-width: 768px) {
  .b2bhg-slider {
    height: auto;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  /* I quadrati diventano elementi diretti dello slider */
  .b2bhg-right {
    display: contents;
  }

  .b2bhg-slide,
  .b2bhg-left,
  .b2bhg-center-1,
  .b2bhg-center-2,
  .b2bhg-top-right,
  .b2bhg-bottom-right {
    flex: 0 0 80%;
    width: auto;
    height: 420px;
    scroll-snap-align: start;
  }
}

/* Slide: occupa tutto lo slot */
.b2bhg-slide-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Immagine di sfondo su layer dedicato */
.b2bhg-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}

/* Card cliccabile */
a.b2bhg-slide-item {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.b2bhg-slide-item:hover .b2bhg-bg {
  transform: scale(1.05);
}

a.b2bhg-slide-item:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* La nuova slide entra sopra */
.b2bhg-slide-item.slide-in-right {
  z-index: 2;
  animation: slideRight 0.6s ease forwards;
}

@keyframes slideRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Sfumatura separata, sotto */
.b2bhg-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 250px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Contenuto sopra la sfumatura */
.b2bhg-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  color: #fff;
  text-align: center;
  font-family: 'Inclusive Sans', sans-serif;
  box-sizing: border-box;
  z-index: 2;
}

.b2bhg-content h2,
.b2bhg-content h3,
.b2bhg-content h4 {
  margin: 0 0 0.5rem 0;
  font-weight: bold;
}

.b2bhg-content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* CTA: piccolo pulsante vuoto con bordino bianco */
.b2bhg-cta {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid #fff;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 0.8rem;
  font-weight: normal;
  line-height: 1.2;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a.b2bhg-slide-item:hover .b2bhg-cta,
a.b2bhg-slide-item:focus-visible .b2bhg-cta {
  background: #fff;
  color: #000;
}

@media (prefers-reduced-motion: reduce) {
  .b2bhg-slide-item.slide-in-right {
    animation: none;
  }

  .b2bhg-bg,
  .b2bhg-cta {
    transition: none;
  }

  a.b2bhg-slide-item:hover .b2bhg-bg {
    transform: none;
  }
}
