.product-media-button {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  height: 100%;
  padding: 0;
  position: relative;
  width: 100%;
}

.product-media-button .product-image {
  transition: transform 220ms ease;
}

.product-media-button:hover .product-image,
.product-media-button:focus-visible .product-image {
  transform: scale(1.035);
}

.product-image-count,
.product-image-expand {
  backdrop-filter: blur(8px);
  background: rgb(255 250 242 / 88%);
  border: 1px solid rgb(104 31 50 / 18%);
  border-radius: 999px;
  color: #681f32;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.48rem 0.65rem;
  position: absolute;
  z-index: 2;
}

.product-image-count {
  bottom: 0.8rem;
  left: 0.8rem;
}

.product-image-expand {
  bottom: 0.8rem;
  opacity: 0;
  right: 0.8rem;
  transform: translateY(5px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.product-media-button:hover .product-image-expand,
.product-media-button:focus-visible .product-image-expand {
  opacity: 1;
  transform: translateY(0);
}

body.lightbox-open {
  overflow: hidden;
}

.product-lightbox {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 2rem);
  position: fixed;
  z-index: 1000;
}

.product-lightbox-backdrop {
  background: rgb(22 12 15 / 88%);
  border: 0;
  cursor: default;
  inset: 0;
  position: absolute;
}

.product-lightbox-panel {
  background: #fffaf2;
  border-radius: 1.25rem;
  box-shadow: 0 28px 80px rgb(0 0 0 / 35%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  max-height: calc(100vh - 2rem);
  max-width: 1180px;
  overflow: hidden;
  position: relative;
  width: min(100%, 1180px);
  z-index: 1;
}

.product-lightbox-panel header {
  align-items: center;
  border-bottom: 1px solid rgb(104 31 50 / 12%);
  display: flex;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
}

.product-lightbox-panel header div {
  display: grid;
  gap: 0.15rem;
}

.product-lightbox-panel header span {
  color: #8a6f63;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-lightbox-panel header strong {
  color: #2c171d;
  font-family: "Fraunces", serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.product-lightbox-close {
  align-items: center;
  background: transparent;
  border: 1px solid rgb(104 31 50 / 20%);
  border-radius: 50%;
  color: #681f32;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.7rem;
  height: 2.6rem;
  justify-content: center;
  line-height: 1;
  width: 2.6rem;
}

.product-lightbox-stage {
  align-items: center;
  background: #efe5d6;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: min(68vh, 760px);
  overflow: hidden;
}

.product-lightbox-stage.single-image {
  grid-template-columns: minmax(0, 1fr);
}

.product-lightbox-stage.single-image .product-zoom-frame {
  width: 100%;
}

.product-zoom-frame {
  align-items: center;
  align-self: stretch;
  cursor: zoom-in;
  display: flex;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.product-zoom-frame img {
  height: 100%;
  max-height: min(68vh, 760px);
  object-fit: contain;
  transition: transform 140ms ease-out;
  user-select: none;
  width: 100%;
}

.product-zoom-frame.is-zoomed img {
  transform: scale(2.5);
}

.product-zoom-hint {
  background: rgb(40 23 28 / 75%);
  border-radius: 999px;
  bottom: 1rem;
  color: #fff;
  font-size: 0.75rem;
  left: 50%;
  padding: 0.45rem 0.7rem;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity 120ms ease;
}

.product-zoom-frame.is-zoomed .product-zoom-hint {
  opacity: 0;
}

.gallery-arrow {
  align-items: center;
  align-self: center;
  background: rgb(255 250 242 / 92%);
  border: 1px solid rgb(104 31 50 / 16%);
  border-radius: 50%;
  color: #681f32;
  cursor: pointer;
  display: flex;
  font-size: 2.2rem;
  height: 3rem;
  justify-content: center;
  margin: 0 0.75rem;
  position: relative;
  width: 3rem;
  z-index: 3;
}

.product-lightbox-meta {
  color: #765e54;
  font-size: 0.85rem;
  padding: 0.55rem 1rem 0;
  text-align: center;
}

.product-gallery-thumbnails {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.7rem 1rem 1rem;
}

.product-gallery-thumbnail {
  background: #efe5d6;
  border: 2px solid transparent;
  border-radius: 0.7rem;
  cursor: pointer;
  flex: 0 0 68px;
  height: 68px;
  overflow: hidden;
  padding: 0;
}

.product-gallery-thumbnail.active {
  border-color: #681f32;
}

.product-gallery-thumbnail img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

@media (max-width: 700px) {
  .product-lightbox {
    padding: 0;
  }

  .product-lightbox-panel {
    border-radius: 0;
    height: 100dvh;
    max-height: none;
  }

  .product-lightbox-stage {
    grid-template-columns: 3rem minmax(0, 1fr) 3rem;
    min-height: 0;
  }

  .gallery-arrow {
    font-size: 1.7rem;
    height: 2.4rem;
    margin: 0 0.3rem;
    width: 2.4rem;
  }

  .product-zoom-frame {
    cursor: default;
  }

  .product-zoom-hint {
    display: none;
  }

  .product-image-expand {
    opacity: 1;
    transform: none;
  }
}

@media (hover: none) {
  .product-zoom-frame.is-zoomed img {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-media-button .product-image,
  .product-zoom-frame img,
  .product-image-expand {
    transition: none;
  }
}

