/* ============================================================
   Packagly — product/gallery.css
   Depends on: common.css (variables, reset, icon helpers)
   Responsive @media rules live in responsive.css
   ============================================================ */

/* ============================================================
   GALLERY
   ============================================================ */
.gallery {
  display: flex;
  gap: 14px;
  min-width: 0;
}

/* vertical thumbnail rail */
.gallery-thumbs {
  flex: 0 0 86px;
  width: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.thumb-nav {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    filter 0.2s ease,
    transform 0.2s ease;
}
.thumb-nav:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.thumb-nav img {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
}
.thumb-nav.is-up img {
  transform: rotate(180deg);
}
.thumb-strip {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-height: 400px; /* ~4 thumbs */
  overflow-y: auto;
  scrollbar-width: none;
}
.thumb-strip::-webkit-scrollbar {
  display: none;
}
.thumb {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f4f6f4;
  border: 2px solid #e7ebe7;
  cursor: pointer;
  padding: 0;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb:hover {
  transform: translateY(-2px);
}
.thumb.is-active {
  border-color: var(--green);
}

/* big main image */
.gallery-main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: #f5f6f5;
  border: 1px solid #e7ebe7;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-main img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
}
.gallery-icon-btn {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2b3a30;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
  z-index: 2;
}
.gallery-icon-btn:hover {
  background: var(--green);
  color: #fff;
  transform: scale(1.06);
}
.gallery-icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}
.gallery-icon-btn img {
  width: 18px;
  height: 18px;
}
.gallery-icon-btn:hover img {
  filter: brightness(0) invert(1);
}
.gallery-expand {
  top: 14px;
  right: 14px;
}
.gallery-arrow {
  top: 50%;
  transform: translateY(-50%);
}
.gallery-arrow:hover {
  transform: translateY(-50%) scale(1.06);
}
.gallery-arrow.prev {
  left: 14px;
}
.gallery-arrow.next {
  right: 14px;
}
.gallery-arrow.prev img {
  transform: rotate(180deg);
}
.gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 2;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c7cfc7;
  padding: 0;
  transition:
    background 0.2s ease,
    width 0.2s ease;
}
.dot.is-active {
  background: var(--green);
  width: 22px;
  border-radius: 5px;
}

/* ============================================================
   IMAGE LIGHTBOX (expand)
   ============================================================ */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 14, 9, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.img-lightbox img {
  max-width: 90vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 12px;
}
.img-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.img-lightbox-close:hover {
  background: var(--green);
}
