.second-block {
  background-color: #fcfcfc;
  width: 100%;
  box-sizing: border-box;
  padding-block: 14.0625rem;
  overflow-x: hidden;
}

.second-block-title-container {
  display: flex;
  justify-content: flex-start;
  position: relative;
  padding: 2rem 5%;

  margin-top: clamp(-200px, -13vh, -140px);

  width: 100%;
}

.second-block-title {
  font-family: "KingRichard-Italic", sans-serif;
  font-size: clamp(2rem, 6vw, 6.4375rem);
  font-style: normal;
  font-weight: 400;
  line-height: 1.05;
  color: #381809;
  text-transform: uppercase;
  text-align: left;

  opacity: 0;

   will-change: transform, opacity;
}

.second-block-subtitle-container {
  display: flex;
  justify-content: flex-start;
  position: relative;
  text-align: left;
  padding-top: clamp(160px, 14.8rem, 237px);
  padding-left: 50%;
  box-sizing: border-box;

}

.second-block-subtitle {
  font-family: "Manrope Medium", sans-serif;

  font-size: clamp(0.875rem, 1vw, 1.125rem);
  font-style: normal;
  font-weight: 500;
  line-height: normal;

   will-change: transform, opacity;
}

:root {
  --block-width: 580px;
  --block-gap: 45px;
  --items-to-show: 4;
  --total-items: 8;

  --start-offset: 50vw;
  --slide-distance: calc(
    var(--items-to-show) * (var(--block-width) + var(--block-gap))
  );
}

.carousel-container {
  display: flex;
  position: relative;
  width: 100%;
  height: 620px;
  overflow: visible;
  margin: 70px 0;
}

.carousel-track {
  display: flex;
  width: calc(var(--total-items) * (var(--block-width) + var(--block-gap)));
  transform: translateX(50vw);
  will-change: transform;
}

.carousel-block {
  width: 580px !important;
  height: 620px;

  border-radius: 25px;
  margin-right: var(--block-gap);
  flex-shrink: 0;

  overflow: hidden;
  position: relative;
}

@media (min-width: 901px) and (max-width: 1439px) {
  :root {
    --block-width: 480px;
    --block-gap: 32px;
  }
}

@media (min-width: 1440px) {
  :root {
    --block-width: 580px;
    --block-gap: 45px;
  }
}

@media screen and (min-resolution: 120dpi) and (max-width: 1600px) {

  .carousel-block {
     width: 480px !important;
  height: 520px;
  }

}

.carousel-block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 25px;
}

/* --- Dynamic Animations --- */
.carousel-track.animate {
  /* This animation now uses the dynamic --slide-distance variable */
  animation: slide-first-carousel 30s linear 1 forwards;
}

.carousel-track.loop {
  /* This animation also uses the dynamic --slide-distance variable */
  animation: slide-loop 30s linear infinite;
}

@keyframes slide-first-carousel {
  from {
    transform: translate3d(50vw, 0, 0);
  }
  to {
    transform: translate3d(calc(50vw - var(--slide-distance)), 0, 0);
  }
}

@keyframes slide-loop {
  from {
    transform: translate3d(0px, 0, 0);
  }
  to {
    transform: translate3d(calc(-1 * var(--slide-distance)), 0, 0);
  }
}

@media (max-width: 600px) {
  .second-block {
    background: #fcfcfc;
    width: 100%;
    height: auto;
    box-sizing: border-box;
    padding: clamp(2rem, 7vw, 3.5rem) 0 clamp(1.5rem, 6vw, 3rem) 0;
    padding-bottom: 0 !important;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .second-block-title-container {
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 4.375rem;
    padding: 0 clamp(0.6rem, 5vw, 2rem);
  }

  .second-block-title {
    font-family: "KingRichard-Italic", sans-serif;
    font-size: 2.5rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.11;
    color: #381809;
    text-transform: uppercase;
    text-align: center;
    margin: 0 auto;
    width: 100%;
    opacity: 0;
  }

  .second-block-title br {
    display: none;
  }

  .second-block-subtitle-container {
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 clamp(0.7rem, 6vw, 2rem);
    padding-left: 4rem;
    padding-right: 4rem;
    margin-bottom: 3.25rem;
  }

  .second-block-subtitle {
    font-family: "Manrope Medium", sans-serif;
    font-size: clamp(0.92rem, 3vw, 1.08rem);
    line-height: normal;
    font-weight: 500;
    color: #381809;
    text-align: center;
    width: 100%;
    margin: 0;
  }

  .second-block-subtitle br {
    display: none;
  }

  .carousel-container {
    width: 100%;
    height: auto;
    margin: 0;
    margin-top: 0rem;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .carousel-track {
    display: flex;
    gap: 16.5px;
    flex-wrap: nowrap;
    padding: 0;
    margin: 0;
    will-change: transform;
    width: max-content;
  }

  .carousel-block {
    width: 300px !important;
    height: 321.5px !important;
    border-radius: 18px;
    margin: 0;
    overflow: hidden;
    position: relative;
    box-shadow: none;
    flex-shrink: 0;
  }

  .carousel-block img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
    display: block;
  }
}
