.header {
  width: 100%;
  z-index: 10;
  background: #000; /* Fondo negro para el header */
  height: 110px; /* Altura fija del header */
  position: relative;
}

.hero-container {
  position: relative;
  margin-left: 2%;
  margin-right: 2%;
}

.hero {
  position: relative;
  width: 100%;
  height: calc(100vh - 80px); /* Ocupa el 100vh menos el alto del header */
  display: flex;
  flex-direction: column;
  color: #fff;
  background: #000;
  z-index: 0;
  overflow: hidden;
}

/*Sobreescribimos el hero d emóvil que por defecto lo coge*/
@media (max-width: 766px) {
  .hero {
      top: 2%;
      left: 0;
      right: 0;
      margin: 0 auto;
      width: 96%;
      height: auto;
      border-radius: 50px;
      color: #fff;
      overflow: hidden;
      text-align: center;
  }
}
.hero-content {
  width: 100%;
  height: 100%;
  background: url(../assets/img/nosotros_hero_background.webp) center center / cover no-repeat;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 4vw;
  border-top-left-radius: 50px;
  border-top-right-radius: 50px;
}

.left-side {
  width: 100%;
  text-align: left;
}

.left-side h1 {
  font-size: 3.5rem;
  font-weight: bold;
  margin: 0;
}

.left-side p {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(64px);
  -webkit-backdrop-filter: blur(64px);
  border-radius: 6vw;
  font-size: 1.5rem;
  opacity: 0.9;
  padding: 7px 15px;
  margin: 0;
}

/* Se establece que la parte derecha es un contenedor en columna de altura completa */
.right-side {
  width: 100%;
  height: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Distribución vertical en .right-side:
   - stats: 33.33%
   - content-wrapper: 58.33%
   - button-container: 8.33% */
.right-side > .stats {
  flex: 0 0 33.33%;
  min-height: 0;
  overflow: hidden;
}

.right-side > .content-wrapper {
  
  overflow: hidden;
  display: flex; /* Para que su hijo (content-box) se adapte */
}

.right-side > .button-container {
  flex: 8.33%;
  min-height: 0;
  overflow: hidden;
}

.stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-box {
  width: 100%;
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-radius: 20px;
  overflow: hidden;
}

.stat-left {
  width: 33%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(64px);
  -webkit-backdrop-filter: blur(64px);
  padding: 3%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-left-radius: 1vw;
  border-bottom-left-radius: 1vw;
}

.stat-left h2 {
  font-size: 4.5vh;
  color: #ff9900;
  margin: 0;
}

.stat-right {
  width: 75%;
  display: flex;
  align-items: center;
  padding: 3%;
  text-align: left;
  color: #fff;
  font-weight: bold;
  border-top-right-radius: 1vw;
  border-bottom-right-radius: 1vw;
}

.stat-right p {
  font-size: 100%;
  margin: 0;
}

.content-wrapper {
  width: 100%;
  margin-top: 1vh;
}

/* Se modifica el content-box para que ocupe el 100% del alto disponible en su contenedor */
.content-box {
  display: flex;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(104px);
  -webkit-backdrop-filter: blur(104px);
  border-radius: 20px;
  padding: 7% 5%;
  text-align: left;
}
.content-box p{
  margin-top: 0;
}
.content-box p:last-of-type {
  margin-bottom: 0;
}

.button-container {
  width: 100%;
  text-align: center;
  /* padding: 3vw; */
}

.button-container button {
  padding: 4% 10%;
  font-size: 70%;
  margin-top: 1vh;
  border-radius: 8vw;
}

.scroll-indicator {
  display: block;
  width: fit-content;
  margin: 0 auto;
  transform: translateY(-1px);
}

.carousel {
  max-width: 1540px;
  margin: 5rem auto;
  overflow: hidden;
  position: relative;
}

.carousel h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

/* 
  Se usa .carousel-wrapper para contener el track y aplicar los gradientes en
  los extremos izquierdo y derecho, de modo que se difuminen la aparición y desaparición.
*/
.carousel-wrapper {
  position: relative; /* Necesario para posicionar los pseudo-elementos */
  width: 100%;
  overflow: hidden;
}

.carousel-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5%; /* Ajusta este valor según el efecto deseado */
  height: 100%;
  background: linear-gradient(to right, white, transparent);
  pointer-events: none;
  z-index: 2;
}

.carousel-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 5%; /* Ajusta este valor según el efecto deseado */
  height: 100%;
  background: linear-gradient(to left, white, transparent);
  pointer-events: none;
  z-index: 2;
}

.carousel-track {
  display: flex;
  animation: scroll 20s linear infinite;
}

.carousel-item {
  flex: 0 0 calc(100% / 6);
  width: 200px;
  margin-right: 20px;
}

/* Las imágenes se muestran sin efectos individuales */
.carousel-item img {
  width: 100%;
  height: 70%;
  border-radius: 50px;
  object-fit: cover;
  display: block;
  margin-bottom: 1rem;
}

.work-container {
  width: 100%;
  max-width: 1300px;
  margin: 2rem auto;
  background-color: #0e0e0e;
  color: #fff;
  border-radius: 30px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.work-left {
  width: 60%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.work-left h2 {
  font-size: 3.5rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
}

.work-left p {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 2.5rem;
  width: 75%;
}

.bold {
  font-weight: bold;
}

.work-left button {
  display: flex;
  width: 50%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ff9900 0%, #cc3300 100%);
  margin-top: 30px;
  padding: 25px 30px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
  text-decoration: none;
  outline: none;
}

.work-left button:hover {
  box-shadow: 0 0 30px #ff9900;
}

.work-right {
  width: 40%;
  border-radius: 30px;
  overflow: hidden;
  display: flex;
}

.work-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes scroll {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(calc(-200px * 6));
  }
}

@media (min-width: 1024px) and (max-width: 1170px) {
  .hero-content {
    background-position: calc(100% - 70%) center;
  }
}

@media (max-width: 1023px) {
  .hero-content {
    background: url(../assets/img/nosotros_hero_background_mobile.png) center center / cover no-repeat;
    background-position: 10% center;
  }
  .left-side {
    display: none;
  }
  .stat-box {
    flex-direction: column;
    padding: 2% 2% 4% 4%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .stat-left {
    justify-content: left;
    background: none;
    backdrop-filter: none;
  }
  .stat-right {
    padding: 0;
  }
  .stat-right p {
    white-space: normal;
  }
  /* Reasignación de altura en móviles/tablets */
  .right-side > .stats {
    flex: 0 0 40%;
  }
  .right-side > .content-wrapper {
    flex: 0 0 40%;
  }
  .right-side > .button-container {
    flex: 0 0 20%;
  }
}

@media (max-width: 900px) {
  .carousel {
    max-width: 85%;
  }
  .carousel h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  .carousel-wrapper {
    width: 100%;
    overflow: hidden;
  }
  .carousel-track {
    display: flex;
    animation: scroll 20s linear infinite;
  }
  .carousel-item {
    flex: 0 0 calc(100% / 3);
    width: 150px;
    margin-right: 10px;
  }
  .carousel-item img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    display: block;
    margin-bottom: 0.5rem;
  }
  .work-container {
    flex-direction: column;
  }
  .work-left {
    order: 1;
    width: 100%;
    text-align: center;
    font-size: calc(14px + 1vw);
  }
  .work-left p {
    width: 100%;
  }
  .work-left button {
    width: 90%;
    margin: 0 auto;
    white-space: nowrap;
    padding: 1rem 2rem;
    font-size: 0.8rem;
  }
  .work-right {
    order: 2;
    margin: 0 auto;
    margin-bottom: 3rem;
    height: 100%;
    width: 90%;
    object-fit: cover;
  }
}

@media (min-width: 1024px) {
  .right-side > .content-wrapper {
    margin-top: 0;
  }

  .content-box {
    height: 100%;
    /* max-height: 100%; */
    box-sizing: border-box;
    /* padding-bottom: 3%; */ /* reducido para ajustarse mejor */
  }
}
