.hidden {
  display: none;
}

.gallery {
  margin: auto;
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.banner,
.gallery-intro {
  display: flex;
  flex-direction: column;
  text-align: left;
  width: 85%;
  max-width: 1920px;
  color: #000;
  margin: auto;
  margin-top: 2.5rem;
}

.gallery-intro h1,
.banner h1 {
  margin: auto 0;
  line-height: 2;
  color: #333333;
}

.gallery-intro p,
.banner p {
  margin: auto 0;
  line-height: 1.5;
  color: #555555;
}

.grid {
  width: 96%;
  max-width: 1920px;
  margin: 0 auto;
  margin-top: 3rem;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.grid-sizer,
.grid-item {
  width: 30%;
  box-sizing: border-box;
}

.grid-item {
  margin: 0 0 3% 2%;
  background: #fff;
  border-radius: 10px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.grid-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
}

.grid-placeholder {
  width: 100%;
  height: 50px;
}

.spacer {
  width: 100%;
  height: 50px;
  visibility: hidden;
}

#loader {
  position: fixed;
  top: 95%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #000;
  padding: 5px;
  z-index: 1000;
  width: 30%;
  border-radius: 10px;
}

#loader span {
  display: flex;
  height: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  text-align: center;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
  0% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}

.grid-item {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.grid-item.is-loaded {
  opacity: 1;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  display: flex;
  background-color: #fff;
  width: 90%;
  max-width: 1920px;
  height: auto;
  max-height: 65vh;
  border-radius: 10px;
  overflow: auto;
  margin: 0 auto;
}

.description {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-height: 65vh;
  overflow: auto;
}

.description h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  line-height: 1.5;
  color: #333;
}

.description p {
  max-width: 90%;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #555;
}

.description ol {
  display: flex;
  flex-direction: column;
  margin: auto;
  align-items: left;
  font-size: 0.8rem;
  max-width: 80%;
  padding: 0;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  color: #555;
}

.description li {
  line-height: 2;
  margin-bottom: 0.5rem;
  text-align: left;
}

.description button {
  background-color: #000000;
  color: #ffffff;
  border: none;
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 1rem;
  margin: auto;
  cursor: pointer;
  border-radius: 10px;
  width: 40%;
  white-space: nowrap;
  margin-top: 0;
  margin-bottom: 3rem;
}

.modal-image-container {
  width: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.modal-info {
  width: 50%;
  height: auto;
  padding: 1rem;
  margin: 1rem auto;
  font-size: 1rem;
  line-height: 1;
  color: #333;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-y: auto;
}

.modal-info h2 {
  font-size: 1.5rem;
  line-height: 1.5;
  margin: 1rem auto;
  text-align: center;
  max-width: 90%;
  color: #333;
}

.buy-button {
  background-color: #000000;
  color: #ffffff;
  border: none;
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 1rem;
  margin: auto;
  cursor: pointer;
  border-radius: 10px;
  width: 90%;
  white-space: nowrap;
}

.button-container {
  display: flex;
  justify-content: center;
  width: 90%;
  margin: 0 auto;
  margin-top: 0.8rem;
  margin-bottom: 0.5rem;
}

.button-container p {
  text-align: center;
  color: #777;
  font-size: 0.8rem;
  font-weight: 500;
  max-width: 90%;
  display: flex;
  letter-spacing: 1px;
}

.button-container p span {
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.3rem;
  text-decoration-thickness: 0.8px;
  color: #000;
  cursor: pointer;
}

#purchaseForm {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.form-item {
  width: 90%;
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  border-bottom: 1px solid #ccc;
}

#purchaseForm label {
  width: 100%;
  margin-bottom: 0.2rem;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  text-align: left;
}

.form-size {
  display: flex;
  justify-content: space-between;
}

.form-size span {
  font-size: 0.7rem;
  font-style: italic;
  width: 100%;
  text-align: right;
  color: #777;
  font-family: 'Open Sans', sans-serif;
}

.form-price {
  display: flex;
  text-align: left;
  margin: 1rem 0;
}

.currency-symbol {
  font-size: 1rem;
  vertical-align: middle;
  color: #333;
}

#price {
  font-size: 2rem;
  font-weight: 600;
  color: #333;
  text-align: left;
}

#purchaseForm input,
textarea {
  width: 100%;
  outline: none;
  border: none;
  background: transparent;
  font-size: 1rem;
  line-height: 2rem;
  color: #333;
}

#purchaseForm select {
  width: 100%;
  outline: none;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: #333;
}

#purchaseForm input::placeholder,
textarea::placeholder {
  color: #bdbdbd;
  font-size: 0.9rem;
  font-weight: normal;
  font-family: 'Open Sans', sans-serif;
}

#purchaseForm button[type="submit"] {
  background-color: #000000;
  color: #ffffff;
  border: none;
  padding: 1rem;
  text-align: center;
  display: inline-block;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 10px;
  width: 90%;
}

.gallery-content {
  order: 2;
  width: 100%;
}

.fade-slider {
  position: relative;
  width: 100%;
  max-width: 1920px;
  margin: 3rem auto;
  aspect-ratio: 3.2 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 10px;
}

@media screen and (max-width: 1920px) {
  .fade-slider {
    border-radius: 0px;
  }

}

.slider-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  z-index: 1;
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dots {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 3;
  height: 10%;
  max-width: 1200px;
}

.dot {
  width: 20vw;
  height: 0.2rem;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.3s;
}

.dot.active {
  background: #000;
}

@media (max-width: 575px) {
  .modal-content {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 90%;
    overflow: hidden;
    max-height: 60vh;
  }

  .modal-image-container {
    width: 100%;
    height: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }

  .modal-image-container img {
    width: 100%;
    height: 40vh;
    object-fit: cover;
    display: block;
  }

  .modal-info {
    width: 100%;
    height: 50%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-y: auto;
    margin: 1rem;
    text-align: center;
  }

  .button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .buy-button {
    width: 80%;
    margin: 0.1rem 0;
    text-align: center;
  }

  .button-container p {
    margin-bottom: 0;
    margin-top: 0.2rem;
  }

  .banner,
  .gallery-intro {
    width: 90%;
    margin-top: 2.5rem;
  }

  .loader {
    top: 80%;
  }

  .dot {
    height: 0.1rem;
  }
}

@media screen and (max-width: 768px) {

  .grid-sizer,
  .grid-item {
    width: 46%;
  }
}

@media screen and (max-width: 480px) {

  .grid-sizer,
  .grid-item {
    width: 46%;
    border-radius: 15px;
  }

  .grid-item img {
    border-radius: 10px;
  }
}

@media (prefers-color-scheme: dark) {

  .gallery-intro h1,
  .banner h1,
  .description h2,
  .modal-info h2 {
    color: #ddd;
  }

  .description p,
  .description ol,
  .gallery-intro p,
  .banner p,
  .form-item span,
  #price {
    color: #bbb;
  }

  .grid-item,
  .modal-content {
    background: #2a2a2a;
  }

  #loader {
    background: #333;
  }

  .modal {
    background: rgba(0, 0, 0, 0.8);
  }

  #purchaseForm label,
  #purchaseForm input,
  #purchaseForm select {
    color: #ddd;
  }

  #purchaseForm input,
  textarea::placeholder {
    color: #888;
  }

  .form-item {
    border-bottom: 1px solid #555;
  }

  .button-container p {
    color: #aaa;
  }

  .button-container p span {
    color: #fff;
  }

  .modal-info {
    color: #ddd;
  }

  .dot {
    background: rgba(255, 255, 255, 0.5);
  }

  .dot.active {
    background: #ddd;
  }
}