.product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

/* ヘッダーより前面に表示 */
.fancybox__container {
  z-index: 10001;
}

@media (min-width: 1024px) {
  .product-layout {
    grid-template-columns: minmax(0, 720px) minmax(320px, 1fr);
    align-items: start;
  }
}

/* ===== ギャラリーコンテナ ===== */
.product-gallery {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}

@media (max-width: 991px) {
  .product-gallery {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ===== メインギャラリー ===== */
.product-gallery-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
}

.product-gallery-main .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  min-height: 360px !important;
}

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

@media (max-width: 991px) {
  .product-gallery-main {
    border-radius: 8px;
  }

  .product-gallery-main .swiper-slide {
    min-height: 250px !important;
  }

  .product-gallery-main img {
    max-height: auto;
  }
}

/* ===== サムネイルギャラリー ===== */
.product-gallery-thumbs {
  width: 60px;
  max-height: 500px;
  flex-shrink: 0;
}

.product-gallery-thumbs .swiper-wrapper {
  flex-direction: column;
  align-items: center;
}

.product-gallery-thumbs .swiper-slide {
  width: 100% !important;
  height: auto !important;
  margin-bottom: 0.5rem !important;
  margin-right: 0 !important;
  max-width: 100% !important;
}

.product-gallery-thumbs img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  border: solid 1px #ddd;
}

.product-gallery-thumbs .swiper-slide-thumb-active img {
  border: solid 1px #222;
}

@media (max-width: 991px) {
  .product-gallery-thumbs {
    width: 100%;
    max-height: none;
    flex-shrink: auto;
  }

  .product-gallery-thumbs .swiper-wrapper {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }

  .product-gallery-thumbs .swiper-slide {
    width: auto !important;
    max-width: none !important;
    height: 60px !important;
    margin-bottom: 0 !important;
    margin-right: 0.5rem !important;
    flex-shrink: 0;
  }

  .product-gallery-thumbs img {
    width: 60px;
    height: 60px;
  }
}

/* ===== 空のギャラリー状態 ===== */
.product-gallery--empty {
  padding: 40px 20px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fafafa;
  text-align: center;
  color: #666;
}
