/* Product gallery (Amazon-style inline thumbnails + full-screen modal) */

.product-image-column {
  flex: 0 0 42%;
  max-width: 480px;
  min-width: 0;
}

.product-image-gallery {
  width: 100%;
}

.gallery-inline {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

.product-thumbnails-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: 56px;
}

.product-thumbnails-vertical .thumbnail {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid #e3e6e6;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.product-thumbnails-vertical .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-thumbnails-vertical .thumbnail:hover,
.product-thumbnails-vertical .thumbnail:focus {
  border-color: #007185;
  outline: none;
}

.product-thumbnails-vertical .thumbnail.active {
  border-color: #007185;
  box-shadow: 0 0 0 1px #007185;
}

.product-thumbnails-vertical .thumbnail-more {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7fafa;
}

.product-thumbnails-vertical .thumbnail-more .thumbnail-more-label {
  font-size: 14px;
  font-weight: 600;
  color: #0f1111;
  line-height: 1;
}

.product-image-gallery .main-image {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

.main-image-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

.product-image-gallery .main-image img {
  max-height: 420px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.main-image-zoom-hint {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #565959;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(15, 17, 17, 0.15);
}

.main-image-trigger:hover .main-image-zoom-hint,
.main-image-trigger:focus .main-image-zoom-hint {
  opacity: 1;
}

body.gallery-modal-open {
  overflow: hidden;
}

.product-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: stretch;
  justify-content: center;
}

.product-gallery-modal.open {
  display: flex !important;
}

.product-gallery-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 17, 0.6);
}

.product-gallery-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  background: #fff;
  margin: 0;
}

.product-gallery-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #0f1111;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 17, 17, 0.15);
  transition: background-color 0.15s ease;
}

.product-gallery-modal-close:hover {
  background: #f7fafa;
}

.product-gallery-modal-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.gallery-modal-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 24px;
  min-width: 0;
  background: #fff;
}

.gallery-modal-main img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
}

.gallery-modal-sidebar {
  flex: 0 0 320px;
  max-width: 360px;
  border-left: 1px solid #e3e6e6;
  padding: 48px 20px 24px;
  overflow-y: auto;
  background: #fff;
}

.gallery-modal-title {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: #0f1111;
  margin: 0 0 16px;
}

.gallery-modal-thumbnails {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.gallery-modal-thumb {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid #e3e6e6;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.gallery-modal-thumb:hover,
.gallery-modal-thumb:focus {
  border-color: #007185;
  outline: none;
}

.gallery-modal-thumb.active {
  border-color: #007185;
  box-shadow: 0 0 0 1px #007185;
}

@media screen and (max-width: 768px) {
  .product-image-column {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .product-thumbnails-vertical {
    width: 48px;
  }

  .product-thumbnails-vertical .thumbnail {
    width: 48px;
    height: 48px;
  }

  .product-image-gallery .main-image {
    min-height: 260px;
  }

  .product-image-gallery .main-image img {
    max-height: 320px;
  }

  .product-gallery-modal-layout {
    flex-direction: column;
  }

  .gallery-modal-main {
    flex: 1;
    padding: 56px 16px 16px;
  }

  .gallery-modal-sidebar {
    flex: 0 0 auto;
    max-width: none;
    border-left: none;
    border-top: 1px solid #e3e6e6;
    max-height: 40vh;
    padding: 16px;
  }

  .gallery-modal-thumbnails {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media screen and (max-width: 480px) {
  .gallery-inline {
    gap: 8px;
  }

  .product-thumbnails-vertical {
    width: 44px;
  }

  .product-thumbnails-vertical .thumbnail {
    width: 44px;
    height: 44px;
  }

  .product-image-gallery .main-image img {
    max-height: 280px;
  }

  .gallery-modal-thumbnails {
    grid-template-columns: repeat(4, 1fr);
  }
}
