.reviews-section {
  text-align: center;
  width: 100%;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
  min-height: 400px;
  z-index: 0;
}

.reviews-section .form-group label {
  position: absolute;
  top: 50%;
  left: 12px;
  font-size: 1rem;
  color: #32758f;
  pointer-events: none;
  transition: 0.3s ease;
  transform: translateY(-50%);
}

.reviews-title {
  position: absolute;
  top: 1.3em;
  left: 15%;
  font-size: clamp(24px, 2.2vw, 42px);
  font-weight: 600;
  padding: 14px 24px;
  color: #01406c;
  border-radius: 60px;
  background: #a2deffbc;
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  border: 1px solid #dcf3ffb9;
  white-space: nowrap;
  z-index: 12;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reviews-title.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reviews-background-cropper {
  position: absolute;
  top: 80px;
  left: 0;
  width: 100%;
  height: 400px;
  overflow: hidden;
  z-index: 0;
}

.reviews-background {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 600px;
  background: url('/static/static_media/reviews.jpg') center/cover no-repeat fixed;
  will-change: transform;
  transform: translateZ(0);
  pointer-events: none;
}

.reviews-wrapper {
  position: relative;
  box-shadow: inset 0 1px 4px #00000034, inset 0 -1px 4px #00000034;
  height: 400px;
  border: 1px solid #ffffffd6;
  width: 102%;
  left: -2px;
}

.reviews-container {
  width: 100%;
  height: 400px;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  background-color: transparent;
  transition: transform 1s ease;
  margin-bottom: 50px;
  position: relative;
  box-sizing: border-box;
  justify-content: flex-start;
  align-items: center;
  scroll-behavior: smooth;
  padding: 0 40px;
  z-index: 2;
}


.reviews-container::-webkit-scrollbar {
  display: none;
}

.review-card {
  flex: 0 0 auto;
  will-change: transform, opacity, scale, box-shadow;
  margin-top: 20px;
  margin-bottom: 20px;
  min-width: 350px;
  height: 270px;
  border-radius: 65px;
  aspect-ratio: 1/5;
  scroll-snap-align: center;
  opacity: 0;
  transform: translateY(30px) translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
  transition: opacity 0.5s ease, transform 0.35s ease, scale 0.35s ease-in-out, box-shadow 0.5s ease-in-out;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
  background: #a2deffbc;
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  border: 1px solid #dcf3ffb9;
  z-index: 2;
  text-decoration: none;
  color: inherit;
}

.reviews-container .review-card:last-child {
  margin-left: 20px;
}

.review-card.show {
  opacity: 1;
  transform: translateY(0);
}

.review-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.017);
}

.review-card:active {
  transform: translateY(-4px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 8px;
}

.review-header::after {
  content: "";
  position: absolute;
  margin-top: 80px;
  left: 10%;
  width: 80%;
  height: 1px;
  background: #d7f4ff73;
}

.review-logo {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background-color: #fff;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-name {
  color: #01406c;
  font-weight: 600;
  font-size: 1.8rem;
  padding: 6px 8px;
  border-radius: 25px;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.review-title {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  font-size: 1.05rem;
  font-style: italic;
  color: #335380;
  margin-top: -20px;
  white-space: nowrap;
}

.review-card:hover .review-title {
  opacity: 1;
  transform: translateY(0);
}


.review-text-box {
  background-color: #d7f4ff73;
  border-radius: 35px;
  padding: 14px 18px;
  color: #32758f;
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.5;
  text-align: left;
  margin-top: auto;
  height: 60%;
  overflow: auto;
}

@media (orientation: portrait) {
  .reviews-section {
    position: relative;
  }

  .reviews-wrapper {
    position: relative;
    width: 100%;
    left: 0;
    height: auto;
    height: 90%;
    overflow: hidden !important;
    box-shadow: none;
    border: 0 solid #ffffffd6;
    background-clip: padding-box;
    z-index: 2;
  }

  .reviews-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    z-index: 3;
    box-shadow:
      inset 0 18px 40px rgba(0, 0, 0, 0.18),
      inset 0 -14px 36px rgba(0, 0, 0, 0.12);
  }

  .reviews-title {
    position: absolute;
    top: 2em;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 60px;
    backdrop-filter: blur(10px) saturate(1.3);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    border: 1px solid #dcf3ffb9;
    white-space: nowrap;
    z-index: 12;
    opacity: 0;
    transition: none !important;
  }

  .reviews-background-cropper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    border-radius: inherit;
  }

  .reviews-background {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    height: 450px;
    background-image: url('/static/static_media/reviews.jpg');
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
    background-attachment: scroll !important;
    background-position: center center !important;
    background-size: cover !important;
  }

  .reviews-container {
    width: 100%;
    display: flex;
    gap: 14px;
    padding: 18px 14px;
    box-sizing: border-box;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    z-index: 5;
  }

  .reviews-container::-webkit-scrollbar {
    display: none;
  }

  .review-card {
    margin-top: 10px;
    margin-bottom: 10px;
    height: 250px;
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
    opacity: 1;
    border-radius: 35px;
    min-width: none;
    width: 250px;
  }


  .review-text-box {
    border-radius: 30px;
    padding: 14px 18px;
    color: #32758f;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
    margin-top: auto;
    height: 80%;
    overflow: auto;
  }

  .reviews-container .review-card:last-child {
    margin-right: 18px;
  }

  .review-card.show {
    opacity: 1;
    transform: none;
  }

  .review-card:hover,
  .review-card:active {
    transform: none;
    box-shadow: 0 8px 26px rgba(0,0,0,0.08);
  }

  .review-title {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    font-size: 1.0rem;
    font-style: italic;
    color: #335380;
    margin-top: 6px;
    white-space: normal;
  }

  .review-header {
    gap: 8px;
    margin-bottom: 6px;
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .review-name {
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 1.2rem;
    color: #01406c;
    font-weight: 600;
    padding: 6px 8px;
  }

  .review-header::after {
    display: none;
  }
}
