* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

body {
  background-color: #e5d3b3;
  color: #fff
}

.main-container {
  max-width: 950px;
  margin: 0 auto;
  padding: 0 20px
}

.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center
}

#gallery {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 20px;
  padding: 20px 0;
  scrollbar-width: none
}

#gallery::-webkit-scrollbar {
  display: none
}

.gallery-item {
  flex: 0 0 280px;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .1);
  transition: transform .3s
}

.gallery-item:hover {
  transform: translateY(-5px)
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block
}

.gallery-item-title {
  padding: 15px;
  text-align: center;
  font-weight: bold;
  color: #333
}

.nav-btn-gallery {
  width: 35px;
  height: 35px;
  min-width: 35px;
  background: rgba(255, 255, 255, .572);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  position: absolute;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .3)
}

.nav-btn-gallery.prev {
  left: -25px
}

.nav-btn-gallery.next {
  right: -25px
}

#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .9);
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility .4s ease
}

#lightbox.active {
  opacity: 1;
  visibility: visible
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 50px;
  color: white;
  cursor: pointer;
  z-index: 10001;
  line-height: 1;
  user-select: none;
  transition: transform .2s
}

.close-btn:hover {
  transform: scale(1.2);
  color: #ffcc00
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, .2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg)
  }
}

#lightboxImg {
  max-width: 90%;
  max-height: 80vh;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity .5s ease-in-out
}

#lightboxImg.loaded {
  opacity: 1
}

#lightboxTitle {
  margin-top: 15px;
  font-size: 1.2rem;
  font-weight: bold
}

#counter {
  margin-top: 5px;
  opacity: .7
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, .1);
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, .678);
  font-size: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center
}

.prev-btn {
  left: 30px
}

.next-btn {
  right: 30px
}

.close-btn {
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer
}

@media (max-width:768px) {
  .nav-btn-gallery.prev {
    left: -15px
  }

  .nav-btn-gallery.next {
    right: -15px
  }

  .nav-btn {
    top: auto;
    bottom: 30px
  }

  .prev-btn {
    left: 20%
  }

  .next-btn {
    right: 20%
  }
}