.overnight-hotels {
  width: 100%;
  margin: 0 auto;
  text-align: center;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  height: 520px;
}

button {
  background-color: rgb(254, 235, 214);
  border: none;
  border-radius: 50%;
  padding: 13px 20px 13px 20px;
  font-size: 24px;
  cursor: pointer;
  transition: background-color 0.3s;
  z-index: 1;
}

.overnight-hotels button:hover {
  background-color: #aaa;
}

.slider-wrapper {
  overflow: hidden;
  width: 60%;
  height: auto;
}

.overnight-slider {
  display: flex;
  transition: transform 0.8s ease-in-out;
  will-change: transform;
}

.slide {
  min-width: 100%;
  position: relative; /* Ensure text is positioned relative to the slide */
}

.slide-img img {
  width: 100%;
  height: 280px;
  max-width: 100%;
  object-fit: cover;
}

/*.slide-img-2 img {
      position: absolute;
      top: 30%;
      transform: translateY(-50%);
    } */

.prev-button,
.next-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 1024px) {
}

@media (max-width: 768px) {
  .prev-button,
  .next-button {
    top: 60%;
  }
}

@media (max-width: 480px) {
}

@media (max-width: 320px) {
}

.prev-button {
  left: 200px;
}

.next-button {
  right: 200px;
}

.text-overlay h3 {
  margin-bottom: 5px;
}

.text-overlay {
  width: 450px;
  position: absolute;
  top: 20%;
  left: 30%; /* Center horizontally */
  transform: translateX(-50%); /* Adjust for centering */
  color: white;
  padding: 10px;
  font-size: 18px;
  text-align: left;
  font-weight: 400;
  z-index: 2;
  line-height: 25px;
  opacity: 0; /* Initially hidden */
  transform: translate(-50%, 20px); /* Slightly down for animation */
  transition: opacity 1.5s ease, transform 0.5s ease; /* Fade and move transition */
  z-index: 10;
}

.text-overlay.visible {
  opacity: 1; /* Fully visible */
  transform: translate(-50%, 0); /* Back to original position */
}

@media (max-width: 480px) {
  .slide {
    width: 100%;
    height: 100%;
  }

  .overnight-hotels {
    width: 100%;
    height: 60%;
  }

  .text-overlay {
    width: 80%;
    font-size: 14px !important;
    top: 1%;
    left: 40%;
    transform: translateX(-50%);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  }

  .text-overlay p {
    line-height: 1.3;
  }

  button {
    font-size: 18px;
    background-color: rgba(255, 255, 255, 0.5);
  }
}

@media (max-width: 768px) {
  .slide {
    width: 100%;
    height: 100%;
  }

  .overnight-hotels {
    width: 100%;
    height: 60%;
  }

  .text-overlay {
    width: 80%;
    font-size: 14px !important;
    top: 1%;
    left: 40%;
    transform: translateX(-50%);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  }

  .text-overlay p {
    line-height: 1.3;
  }

  button {
    font-size: 18px;
    background-color: rgba(255, 255, 255, 0.5);
  }

  .prev-button {
    left: 100px;
    background-color: rgb(220, 220, 220);
  }

  .next-button {
    right: 100px;
    background-color: rgb(220, 220, 220);
  }
}
