.carousel-wrap {
  position: relative;
}

.item {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.item img {
  display: block;
  width: 100%;
  height: 250px;
  transition: opacity 0.3s ease;
}

.item:hover {
  background-color: #f6dcc6;
}

.item>img:hover {
  opacity: 0.4;
}

.overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: black;
  font-size: 3em;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  background: none;
}

.item:hover .overlay {
  opacity: 1;
}

/* Responsive styling for screens between 1024px and 1366px in portrait orientation */
@media only screen and (min-device-width: 1024px) and (max-device-width: 1366px) and (orientation: portrait) {
  .item img {
      height: 400px; /* Adjust height for larger devices */
  }

  .overlay {
      font-size: 2.5em; /* Adjust the overlay size for better visibility */
  }

  .next-button, .prev-button {
      font-size: 2em; /* Resize the next/prev buttons */
  }

  .next-button {
      right: 10px; /* Adjust positioning for larger screens */
      top: 50%;
  }

  .prev-button {
      left: 10px;
      top: 50%;
  }

  .carousel-wrap {
      max-width: 90%; /* Adjust the carousel container width for this screen size */
      margin: 0 auto; /* Center the carousel */
  }
}

/* For smaller screens (max-width: 768px) */
@media (max-width: 768px) {
  .next-button {
      right: -34px;
      top: 47%;
  }

  .prev-button {
      left: -29px;
  }
}
