/* Theme-wide controls and the native product-image thumbnail carousel. */

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #143d33;
  --bs-btn-border-color: #143d33;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0f3028;
  --bs-btn-hover-border-color: #0f3028;
  --bs-btn-focus-shadow-rgb: 20, 61, 51;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #0f3028;
  --bs-btn-active-border-color: #0f3028;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #143d33;
  --bs-btn-disabled-border-color: #143d33;
}

.btn-outline-primary {
  --bs-btn-color: #143d33;
  --bs-btn-border-color: #143d33;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #143d33;
  --bs-btn-hover-border-color: #143d33;
  --bs-btn-focus-shadow-rgb: 20, 61, 51;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #0f3028;
  --bs-btn-active-border-color: #0f3028;
  --bs-btn-disabled-color: #143d33;
  --bs-btn-disabled-border-color: #143d33;
}

.page-product .product__thumbnails {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
}

.page-product .product__thumbnails-viewport {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.page-product .product__thumbnails-list {
  display: flex;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  overflow-x: auto;
  padding: 0.125rem 0.125rem 0.375rem;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.page-product .product__thumbnails-list::-webkit-scrollbar {
  height: 0.35rem;
}

.page-product .product__thumbnails-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #bfd0c8;
}

.page-product .product__thumbnails-item {
  min-width: 0;
  flex: 0 0 clamp(4.5rem, 13vw, 6.25rem);
  scroll-snap-align: center;
}

.page-product .product__thumbnail {
  display: block;
  width: 100%;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.page-product .product__thumbnail:hover {
  transform: translateY(-1px);
}

.page-product .product__thumbnail-image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Use clear LTR controls for the main product image instead of the broken RTL icon backgrounds. */
.page-product .product__carousel > .carousel-control-prev,
.page-product .product__carousel > .carousel-control-next,
.page-product .product__carousel > .carousel-control-prev:hover,
.page-product .product__carousel > .carousel-control-next:hover,
.page-product .product__carousel > .carousel-control-prev:focus,
.page-product .product__carousel > .carousel-control-next:focus {
  bottom: auto;
  top: 50%;
  width: 2rem;
  height: 2rem;
  border: 1px solid #143d33;
  border-radius: 50%;
  background-color: #fff;
  color: #143d33;
  opacity: 1;
  outline: 0;
  transform: translateY(-50%);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.page-product .product__carousel > .carousel-control-prev {
  left: 0.75rem;
  right: auto;
}

.page-product .product__carousel > .carousel-control-next {
  right: 0.75rem;
  left: auto;
}

.page-product .product__carousel > .carousel-control-prev:hover,
.page-product .product__carousel > .carousel-control-next:hover,
.page-product .product__carousel > .carousel-control-prev:focus-visible,
.page-product .product__carousel > .carousel-control-next:focus-visible {
  border-color: #143d33;
  background-color: #eef4f1;
  color: #143d33;
  opacity: 1;
}

.page-product .product__carousel > .carousel-control-prev:focus-visible,
.page-product .product__carousel > .carousel-control-next:focus-visible {
  outline: 0.125rem solid #143d33;
  outline-offset: 0.125rem;
}

.page-product .product__carousel > .carousel-control-prev .carousel-control-prev-icon,
.page-product .product__carousel > .carousel-control-next .carousel-control-next-icon {
  display: inline-flex;
  width: auto;
  height: auto;
  align-items: center;
  justify-content: center;
  background-image: none;
  background-color: transparent;
  background-size: auto;
  border-radius: 0;
  color: inherit;
  font-size: 1.6rem;
  line-height: 1;
}

.page-product .product__carousel > .carousel-control-prev .carousel-control-prev-icon::before {
  content: "\2039";
  display: block;
  line-height: 1;
  transform: translateY(-0.18em);
}

.page-product .product__carousel > .carousel-control-next .carousel-control-next-icon::before {
  content: "\203A";
  display: block;
  line-height: 1;
  transform: translateY(-0.18em);
}

.page-product .product__thumbnails-nav {
  display: flex;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #d8e2dd;
  border-radius: 50%;
  background: #fff;
  color: #0f3028;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.page-product .product__thumbnails-nav:hover,
.page-product .product__thumbnails-nav:focus-visible {
  border-color: #143d33;
  background: #eef4f1;
  color: #143d33;
}

.page-product .product__thumbnails-nav:focus-visible {
  outline: 0.125rem solid #143d33;
  outline-offset: 0.125rem;
}

.page-product .product__thumbnails-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Keep the modal arrows at their fixed carousel positions on hover. */
.page-product .product-images-modal__carousel .carousel-control-prev,
.page-product .product-images-modal__carousel .carousel-control-next,
.page-product .product-images-modal__carousel .carousel-control-prev:hover,
.page-product .product-images-modal__carousel .carousel-control-next:hover,
.page-product .product-images-modal__carousel .carousel-control-prev:focus,
.page-product .product-images-modal__carousel .carousel-control-next:focus {
  transform: none !important;
}

.page-product .product-images-modal__carousel .carousel-control-prev-icon,
.page-product .product-images-modal__carousel .carousel-control-next-icon {
  transform: none !important;
}

/* The zoom gallery uses the 720 px product_main image size. Keep its modal
 * close to that width so the image fills the carousel without upscaling. */
#product .product-images-modal .modal-dialog {
  max-width: 46rem;
}

#product .product-images-modal__carousel .carousel-item > picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#product .product-images-modal__carousel .carousel-item img {
  display: block;
  max-width: 100%;
  height: auto;
}

@media (max-width: 575.98px) {
  .page-product .product__thumbnails {
    gap: 0.375rem;
  }

  .page-product .product__thumbnails-nav {
    width: 1.875rem;
    height: 1.875rem;
    flex-basis: 1.875rem;
  }

  .page-product .product__thumbnails-list {
    gap: 0.625rem;
  }

  .page-product .product__thumbnails-item {
    flex-basis: 4.75rem;
  }

  .page-product .product__carousel > .carousel-control-prev,
  .page-product .product__carousel > .carousel-control-next {
    width: 1.875rem;
    height: 1.875rem;
  }
}

@media (max-width: 767.98px) {
  /* Keep the thumbnail strip swipeable without showing a scrollbar below it. */
  .page-product .product__thumbnails-list {
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-x;
  }

  .page-product .product__thumbnails-list::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-product .product__thumbnails-list {
    scroll-behavior: auto;
  }

  .page-product .product__thumbnail:hover {
    transform: none;
  }
}
