/* ===== Product Gallery ===== */
.kw-product-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

/* --- Cột thumbnail dọc --- */
.kw-gallery-thumb-col {
  width: 90px;
  flex-shrink: 0;
  position: relative;
}

.kw-thumb-swiper {
  max-height: 391px;
  /* khớp chiều cao ảnh chính */
  overflow: hidden;
}

.kw-thumb-swiper .swiper-slide {
  cursor: pointer;
  border: 2px solid transparent;
  overflow: hidden;
  transition: border-color 0.2s;
}

.kw-thumb-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kw-thumb-swiper .swiper-slide.is-active {
  border-color: #e2001a;
  /* màu đỏ như theme */
}

/* Nút điều hướng thumbnail */
.kw-thumb-prev,
.kw-thumb-next {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 32px;
  height: 32px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: #333;
  display: none;
}

.kw-thumb-prev {
  top: 0;
}

.kw-thumb-next {
  bottom: 0;
}

/* --- Cột ảnh chính --- */
/* --- Cột ảnh chính --- */
.kw-gallery-main-col {
  flex: 1;
  position: relative;
  max-width: calc(100% - 102px);
  /* trừ đi width thumb + gap */
}

.kw-main-swiper {
  overflow: hidden;
  aspect-ratio: 4/3;
}

.kw-main-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}
.kw-main-slide-link{
  width: 100%;
  height: 100%;
}

.kw-main-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  /* bỏ height cố định */
  object-fit: cover;
  display: block;
}

/* --- Cột thumbnail --- */

/* Nút prev/next ảnh chính */
.kw-main-prev,
.kw-main-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  /* bên dưới ảnh chính */
  z-index: 10;
  width: 40px;
  height: 40px;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  color: #222;
  transition: background 0.2s;
}

.kw-main-prev:hover,
.kw-main-next:hover {
  background: #e2001a;
  color: #fff;
}

.kw-main-prev {
  left: 0;
}

.kw-main-next {
  right: 0;
}
.fancybox__container {
    z-index: 10000 !important;
}


@media (max-width: 820px) {
  .woocommerce div.product .kw-product-layout__left {
    width: 100%;
  }

  .kw-gallery-thumb-col {
    order: 2;
    width: 100%;
  }

  .kw-gallery-main-col {
    order: 1;
    width: 100%;
    max-width: unset;
  }

  .single-pro-row {
    padding-bottom: 30px;
  }

  .kw-main-prev,
  .kw-main-next,
  .kw-thumb-next,
  .kw-thumb-prev {
    display: none !important;
  }
}

/* --- Zoom Icon on Main Image --- */
.kw-main-slide-link {
  display: block;
  position: relative;
  cursor: zoom-in;
}

.kw-zoom-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #333;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.kw-main-slide-link:hover .kw-zoom-icon {
  opacity: 1;
}
