/**
 * VIBA — Sección Bambú (port 1:1 de LS-Plantilla .ls-developer)
 * Variables: --bambu-bg (fondo de la sección)
 */

.viba-developer {
  background: var(--bambu-bg, #454139);
  color: #fff;
  padding: clamp(2.75rem, 5.5vw, 4.5rem) 0;
}

.viba-developer__inner {
  display: flex;
  flex-direction: column;
  gap: clamp(2.25rem, 4.5vw, 3.5rem);
}

.viba-developer__highlight {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
}

.viba-developer__highlight-copy {
  display: grid;
  grid-template-columns: minmax(0, max-content);
  justify-content: start;
  justify-items: stretch;
  width: 100%;
  min-width: 0;
}

.viba-developer__title {
  margin: 0 0 1.35rem;
  color: #fff;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
}

.viba-developer__stats {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.viba-developer__stat {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
}

.viba-developer__stat-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  color: #fff;
}

.viba-developer__stat-label {
  font-size: clamp(0.92rem, 1.6vw, 1.05rem);
  font-weight: 500;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

.viba-developer__mosaic {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 5px;
  background: #111;
}

.viba-developer__tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #111;
}

.viba-developer__tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transform-origin: center;
  transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) and (pointer: fine) {
  .viba-developer__tile:hover img {
    transform: scale(1.06);
  }
}

.viba-developer__brands-title {
  margin: 0 0 1.35rem;
  text-align: center;
  color: #fff;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.viba-developer__presence {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.45rem 0 0;
}

.viba-developer__countries {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0.85rem 1.05rem;
  width: 100%;
}

.viba-developer__country {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
  min-width: 3.55rem;
}

.viba-developer__flag {
  display: block;
  width: 2.15rem;
  height: 1.42rem;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  background: #fff;
}

.viba-developer__flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.viba-developer__country-name {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.01em;
}

.viba-developer__brand-viewport {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  cursor: grab;
}

.viba-developer__brand-viewport:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 4px;
}

.viba-developer__brand-viewport::-webkit-scrollbar {
  display: none;
}

.viba-developer__brand-track {
  margin: 0;
  padding: 0.15rem 1.25rem;
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.85rem;
  width: max-content;
}

.viba-developer__brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: 3.35rem;
}

.viba-developer__brand--emblem {
  width: 4.15rem;
}

.viba-developer__brand--wordmark {
  width: 8.4rem;
}

.viba-developer__brand img {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.viba-developer__brand--emblem img {
  max-height: 2.85rem;
  max-width: 3.6rem;
}

.viba-developer__brand--wordmark img {
  max-height: 1.5rem;
  max-width: 8.2rem;
}

.viba-developer__panels {
  display: grid;
  gap: 1rem;
}

.viba-developer__panel {
  position: relative;
  min-height: clamp(14rem, 32vw, 18rem);
  overflow: hidden;
  border-radius: 5px;
  background-color: #111;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}

.viba-developer__panel-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.72) 100%);
  pointer-events: none;
}

.viba-developer__panel-copy {
  position: relative;
  z-index: 1;
  padding: clamp(1.25rem, 3vw, 1.85rem);
  max-width: 42rem;
}

.viba-developer__panel-copy h3 {
  margin: 0 0 0.55rem;
  color: #fff;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.viba-developer__panel-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.92rem, 1.5vw, 1.02rem);
  line-height: 1.55;
  text-wrap: pretty;
  max-width: 65ch;
}

@media (min-width: 768px) {
  .viba-developer__brand-viewport {
    overflow: visible;
    mask-image: none;
    cursor: default;
  }

  .viba-developer__brand-track {
    --viba-brand-gap-x: clamp(0.85rem, 1.6vw, 1.45rem);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: clamp(1.15rem, 2.2vw, 1.7rem) var(--viba-brand-gap-x);
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .viba-developer__brand,
  .viba-developer__brand--emblem,
  .viba-developer__brand--wordmark {
    flex: 0 0 calc((100% - (var(--viba-brand-cols, 7) - 1) * var(--viba-brand-gap-x)) / var(--viba-brand-cols, 7));
    width: auto;
    max-width: calc((100% - (var(--viba-brand-cols, 7) - 1) * var(--viba-brand-gap-x)) / var(--viba-brand-cols, 7));
    height: 3.1rem;
  }

  .viba-developer__brand--clone {
    display: none;
  }

  .viba-developer__brand img,
  .viba-developer__brand--emblem img,
  .viba-developer__brand--wordmark img {
    max-width: 100%;
    max-height: 2.7rem;
  }
}

@media (min-width: 900px) {
  .viba-developer__highlight {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: clamp(2rem, 4vw, 3rem);
    align-items: center;
  }

  .viba-developer__countries {
    gap: 0.75rem 0.95rem;
  }

  .viba-developer__panels {
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .viba-developer__tile img,
  .viba-developer__tile:hover img {
    transform: none;
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 767px) {
  .viba-developer__brand-viewport {
    scroll-snap-type: x mandatory;
  }

  .viba-developer__brand {
    scroll-snap-align: center;
  }
}
