.product-detail {
  font-size: 18px;
}
.slide-product-detail .type {
  position: relative;
}
.slide-product-detail .type:hover {
  color: #ea0029;
  transition: 0.3s ease-in-out;
}
.slide-product-detail .type .hover-img {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
}
.slide-product-detail .type:hover .img {
  opacity: 0;
}
.slide-product-detail .type:hover .hover-img {
  opacity: 1;
}
.product-detail .slide {
  padding: 0 4rem 0 8rem;
}
.product-detail .slide .item {
  font-size: 14px;
}
.owl-carousel.slide-product-detail .owl-nav button.owl-next:hover,
.owl-carousel.slide-product-detail .owl-nav button.owl-prev:hover {
  background-color: unset;
  color: #ea0029;
}
.owl-carousel.slide-product-detail .owl-nav button.owl-next {
  right: -4rem;
  top: 50%;
  background: unset;
  color: gray;
  font-size: 14px;
  width: auto;
  height: auto;
}
.owl-carousel.slide-product-detail .owl-nav button.owl-prev {
  left: -5rem;
  top: 50%;
  background: unset;
  color: gray;
  font-size: 14px;
  width: auto;
  height: auto;
}
.product-detail .preview-set {
  /*   display: flex;
  flex-direction: column;
  gap: 10px; 
  width: 15%;*/
}
.product-detail .preview-img {
  border: 1px #eaeaea solid;
  background-color: black;
}
.product-detail .preview-img:hover,
.product-detail .preview-img.active {
  border-color: #ea0029;
}
.slide-preview .item {
  border: 1px #c3c3c3 solid;
}
.slide-preview .item:hover {
  border: 1px #ea0029 solid;
  transition: 0.3s ease-in-out;
}
.product-detail .main-img {
  width: 100%;
  position: relative;
}
.product-detail .main-img .slide {
  padding: 0 15%;
}

.product-detail .detail-right {
  color: #5e5e5e;
  /*  padding-left: 3vw; */
}
.product-detail .detail-right .box {
  margin-bottom: 2vw;
}
.product-detail .detail-right .box table {
  font-size: 14px;
}
.product-detail .detail-right .box ul {
  list-style-position: unset;
  font-size: 16px;
}
.product-detail h3 {
  font-size: 36px;
  font-weight: 500;
  color: black;
  font-family: "Mitr", sans-serif;
  margin-bottom: 1vw;
}
.product-detail h4 {
  font-size: 20px;
  font-weight: 500;
  color: black;
  font-family: "Mitr", sans-serif;
  margin-bottom: 1vw;
}

.product-detail .box table td {
  vertical-align: baseline;
}
.product-detail .box .tborder th {
  font-weight: 500;
  color: black;
}
.product-detail .box .tborder th,
.product-detail .box .tborder td {
  border: 1px #c3c3c3 solid;
  padding: 0.5rem;
  text-align: center;
}

.product-detail .box .tborder-underline td {
  border-bottom: 1px #c3c3c3 solid;
  padding: 0.5rem;
}
.product-detail .box .icon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5vw;
}
.product-detail .box .icon img {
  height: 50px;
}
.product-detail .menu-content {
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-top: 1rem;
}
.product-detail .menu-card .card-title {
  width: 60%;
}

/* คอลัมน์ซ้าย รวมรูปหลักและแกลเลอรี่พรีวิว */
.left-column {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 5fr;
  gap: 20px;
  width: 100%;
}
.zoom-container {
  position: relative;
  width: 430px;
  height: 430px;
  overflow: hidden;
  cursor: none;
  border: 1px solid #ddd;
  background: #fff;
  isolation: isolate;
}

.zoom-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* โปร่งใสตอน hover */
.hover-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
  --mask-x: 50px;
  --mask-y: 50px;
}

.hover-overlay::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  top: calc(var(--mask-y) - 60px);
  left: calc(var(--mask-x) - 60px);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  mix-blend-mode: destination-out;
}

.zoom-preview {
  position: absolute;
  left: 580px;
  top: 0;
  width: 430px;
  height: 430px;
  overflow: hidden;
  border: 1px solid #ddd;
  background: #fff;
  display: none;
}
    .zoom-preview img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transform-origin: top left;
      transition: transform 0.05s ease-out;
      will-change: transform;
      pointer-events: none;
    }
/* .zoom-preview img {
  position: absolute;
  top: 0;
  left: 0;
  width: 800px;
  height: 800px;
  object-fit: cover;
  pointer-events: none;
  will-change: transform, left, top;
  
} */
/* .zoom-container {

  cursor: none;
  isolation: isolate;
}

.zoom-image {
  object-fit: cover;
  display: block;
}

.hover-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;

  --mask-x: 50px;
  --mask-y: 50px;
}

.hover-overlay::before {
  content: "";
  position: absolute;
  width: 100px;
  height: 150px;
  top: calc(var(--mask-y) - 75px);
  left: calc(var(--mask-x) - 50px);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  mix-blend-mode: destination-out;
  pointer-events: none;
}
.zoom-preview {
  position: absolute;
  right: -540px;
  top: 0;
  width: 550px;
  height: 550px;
  overflow: hidden;
  display: none;
  border: 1px solid #efefef;
      background-color: #fff;
}

.zoom-preview img {
  position: absolute;
  width: 1000px;
  height: 1000px;
  object-fit: cover;
  will-change: transform, left, top;
  transition: none;
} */

.thumbnail-wrapper {
  position: relative;
  overflow: hidden;
  width: 100px; /* กำหนดความกว้าง */
  height: 550px;
}

/* รายการรูปพรีวิวเรียงแถวแนวนอน */
.thumbnail-list {
  display: flex;
  flex-direction: column; /* เปลี่ยนจากแนวนอนเป็นแนวตั้ง */
  gap: 10px;
  transition: transform 0.3s ease;
  will-change: transform;
}

/* รูปพรีวิวขนาดเล็ก */
.thumbnail-list img {
  border: 1px solid #efefef;
  width: 100px;
  height: 100px;
  object-fit: cover;
  cursor: pointer;
  transition: border 0.2s;
  flex-shrink: 0; /* ไม่ให้รูปย่อขนาดเมื่อเลื่อน */
}

/* รูปที่ถูกเลือกจะมีกรอบสีน้ำเงิน */
.thumbnail-list img.active {
  border: 1px solid #ea0029;
}

/* ปุ่มเลื่อนซ้ายขวา */
.btn-scroll {
  position: absolute;
  left: 34px;
  transform: translateY(-50%);
  border: none;
  cursor: pointer;
  user-select: none;
  z-index: 10;
  font-size: 16px;
  background-color: #d52926;
  color: white;
  border-radius: 50px;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-up {
  top: 0;
}

.btn-down {
  bottom: -20px;
}

@media (max-width: 991px) {
  .product-detail {
    font-size: 16px;
  }
  .product-detail h3 {
    font-size: 28px;
    margin-bottom: 0.5rem;
  }
  .product-detail h4 {
    font-size: 20px;
    margin-bottom: 0.5rem;
  }
  .product-detail h5 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: black;
  }
  .product-detail .box ul {
    padding-left: 1.5rem;
  }
  .product-detail .main-img .slide {
    padding: 0 1rem;
  }

  .owl-carousel.slide-preview .owl-nav button.owl-prev {
    background: unset;
    color: rgb(0, 0, 0);
  }
  .owl-carousel.slide-preview .owl-nav button.owl-next {
    background: unset;
    color: rgb(0, 0, 0);
  }
  .owl-carousel.slide-product-detail .owl-nav button.owl-prev {
    left: 0;
    width: 25px;
    height: 25px;
    background: #eb0028;
    color: white;
  }
  .owl-carousel.slide-product-detail .owl-nav button.owl-next {
    right: 0;
    width: 25px;
    height: 25px;
    background: #eb0028;
    color: white;
  }
  .product-detail .detail-right {
    padding: 2rem 0 0 0;
  }
  .product-detail .detail-right .box {
    margin-bottom: 2rem;
  }
  .product-detail .detail-right .collapsed i {
    transform: rotate(180deg);
    transition: 0.3s ease-in-out;
  }
  .product-detail .detail-right .box a:hover {
    color: black;
  }
  .product-detail .product-cat-card .card-text {
    bottom: 0.25rem;
    font-size: 14px;
    line-height: 1.2;
  }
  .product-detail .box .icon {
    gap: 1rem;
  }
  .product-detail .box .icon img {
    height: 60px;
  }
  .product-detail .menu-content {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .product-detail .menu-content .menu-card {
    margin: 0;
  }
  .product-detail .menu-card .seemore {
    display: none;
  }
  .product-detail .menu-card .card-title {
    width: 100%;
    font-size: 14px;
    height: 1.25rem;
    -webkit-line-clamp: 1;
  }
  .product-detail .box .tborder th,
  .product-detail .box .tborder td {
    border: none;
  }
  .tborder tr:nth-child(even) {
    background-color: #f2f2f2; /* สีเทาอ่อน */
  }

  .tborder tr:nth-child(odd) {
    background-color: #ffffff; /* สีขาว */
  }
  .left-column {
    gap: 10px;
  }
  .zoom-container {
    width: auto;
    height: auto;
  }
  .thumbnail-wrapper {
    width: 60px;
    height: 260px;
    margin: 2rem 0;
  }
  .thumbnail-list img {
    width: 60px;
    height: 60px;
  }
  .thumbnail-list {
    gap: 5px;
  }
  .btn-scroll {
    left: 15px;
  }
  .btn-up {
    top: 20px;
  }
  .btn-down {
    bottom: -7px;
  }
  .product-detail .slide {
    padding: 0;
  }
  .btn-scroll {
    font-size: 14px;
    width: 25px;
    height: 25px;
  }
  .hover-overlay::before {
    background: rgba(0, 0, 0, 0);
  }
}
@media (min-width: 768px) and (max-width: 991px) {
  .product-card-list {
    grid-template-columns: 1fr 1fr;
  }
  .product-detail .menu-content {
    grid-template-columns: 1fr 1fr;
  }

  .thumbnail-wrapper {
    height: 500px;
  }
}
@media (min-width: 991px) and (max-width: 1025px) {
  .product-detail .menu-card .card-title {
    width: 100%;
    font-size: 16px;
    height: 3rem;
    -webkit-line-clamp: 2;
  }
  .product-detail .menu-card .seemore {
    display: none;
  }
}
