/* ==========================================================================
   PRODUCT IMAGE GALLERY — STANDALONE STYLES
   (Kept separate from custom.css as requested — do not merge the two files.
   Reuses the site's existing CSS variables, e.g. --color-primary, which are
   declared in custom.css and are available globally once that file loads.)
   ========================================================================== */

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Main preview image */
.product-gallery-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-light-bg, #f5f7fa);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  min-height: 320px;
}

.gallery-main-img {
  width: 100%;
  height: 100%;
  max-height: 440px;
  object-fit: contain;
  padding: 1.5rem;
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.gallery-main-img:focus-visible {
  outline: 3px solid var(--color-primary-light, #274a86);
  outline-offset: 2px;
}

/* Prev / next arrows */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  color: var(--color-primary, #002f6b);
  font-size: 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  z-index: 2;
}

.gallery-arrow:hover,
.gallery-arrow:focus-visible {
  background-color: var(--color-white, #ffffff);
  transform: translateY(-50%) scale(1.08);
  outline: none;
}

.gallery-arrow-prev {
  left: 12px;
}

.gallery-arrow-next {
  right: 12px;
}

/* Thumbnail strip */
.product-gallery-thumbs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.gallery-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm, 4px);
  overflow: hidden;
  background: none;
  cursor: pointer;
  opacity: 0.7;
  transition: border-color 0.3s ease, opacity 0.3s ease;
}

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

.gallery-thumb:hover {
  opacity: 1;
}

.gallery-thumb.active {
  border-color: var(--color-primary, #002f6b);
  opacity: 1;
}

.gallery-thumb:focus-visible {
  outline: 3px solid var(--color-primary-light, #274a86);
  outline-offset: 2px;
}

/* Lightbox modal (Bootstrap modal, styled dark) */
.gallery-lightbox .modal-content {
  background-color: rgba(10, 10, 15, 0.95);
  border: none;
  border-radius: var(--radius-md, 8px);
}

.gallery-lightbox-img {
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.gallery-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  opacity: 1;
}

@media (max-width: 575.98px) {
  .product-gallery-main {
    min-height: 240px;
  }

  .gallery-thumb {
    width: 64px;
    height: 64px;
  }
}
