/* ==========================================
   쿠팡 스타일 상품 상세 페이지 CSS (완전판)
========================================== */

/* ==========================================
   전체 컨테이너
========================================== */
.product-detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ==========================================
   좌측 이미지 영역
========================================== */
.image-section {
  display: flex;
  gap: 12px;
}

/* 썸네일 세로 목록 */
.thumbnail-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
}

.thumbnail-column::-webkit-scrollbar {
  width: 4px;
}

.thumbnail-column::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

.thumb-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.thumb-img:hover {
  border-color: #ff6b00;
}

.thumb-img.active {
  border-color: #ff6b00;
  box-shadow: 0 0 0 1px #ff6b00;
}

/* 메인 이미지 컨테이너*/
.main-image-container {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  position: relative;
  overflow: hidden;
}

.main-image {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  transition: transform 0.1s ease-out;
  transform-origin: center center;
}

/* ==========================================
   이미지 확대 기능
========================================== */
/* 확대 렌즈 (마우스 위치 표시) */
.zoom-lens {
  position: absolute;
  width: 150px;
  height: 150px;
  display: none;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.445);
  z-index: 10;
}


/* 확대된 이미지 표시 창 - 이미지 오른쪽에 표시 */
.zoom-result {
  position: absolute;
  left: 100%; /* 이미지 오른쪽 */
  top: 0;
  width: 400px; /* 고정 너비 */
  height: 400px;
  margin-left: 20px; /* 이미지와 간격 */
  border-radius: 12px;
  display: none;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  background-repeat: no-repeat;
}

/* 이미지 섹션에 relative 추가 */
.image-section {
  display: flex;
  gap: 12px;
  position: relative; /* 🆕 추가 */
}

/* ==========================================
   우측 상품 정보
========================================== */
.product-info-section {
  padding-left: 40px;
  position: relative;
}

/* 확대 창이 떠 있을 때 상품 정보 클릭 방지 */
.product-info-section.zooming {
  pointer-events: none;
}

/* 상품명 */
.product-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  color: #111;
  margin-bottom: 12px;
}

/* 별점 + 리뷰 */
.rating-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.stars {
  color: #ff6b00;
  font-size: 18px;
  letter-spacing: 2px;
}

.rating-score {
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

.review-count {
  font-size: 14px;
  color: #767676;
  text-decoration: none;
}

.review-count:hover {
  text-decoration: underline;
}

/* 가격 */
.price-section {
  padding: 20px 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.discount-rate {
  font-size: 28px;
  font-weight: 700;
  color: #ef4444;
  margin-right: 8px;
}

.product-price {
  font-size: 28px;
  font-weight: 700;
  color: #111;
}

.price {
  font-size: 1.8rem;
}

.original-price {
  font-size: 16px;
  color: #767676;
  text-decoration: line-through;
  margin-left: 8px;
}

/* 상품 정보 테이블 */
.info-table {
  width: 100%;
  margin-bottom: 24px;
}

.info-table tr {
  border-bottom: 1px solid #f3f4f6;
}

.info-table th {
  font-size: 14px;
  color: #767676;
  font-weight: 500;
  padding: 12px 0;
  text-align: left;
  width: 100px;
}

.info-table td {
  font-size: 14px;
  color: #111;
  padding: 12px 0;
}

/* 수량 선택 */
.quantity-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.quantity-label {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  min-width: 60px;
}

.quantity-control {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.quantity-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #f9fafb;
  color: #767676;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.quantity-btn:hover {
  background: #e5e7eb;
}

.quantity-input {
  width: 50px;
  height: 32px;
  border: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

/* 총 가격 */
.total-price-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 16px;
}

.total-label {
  font-size: 14px;
  color: #767676;
}

.total-price {
  font-size: 24px;
  font-weight: 700;
  color: #ef4444;
}

/* 버튼 영역 */
.button-section {
  display: flex;
  gap: 8px;
}

.btn-cart {
  flex: 1;
  height: 52px;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid #3b82f6;
  background: white;
  color: #3b82f6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cart:hover {
  background: #eff6ff;
}

.btn-buy {
  flex: 1;
  height: 52px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  background: #3b82f6;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-buy:hover {
  background: #2563eb;
}

/* ==========================================
   하단 탭
========================================== */
.product-tabs {
  margin-top: 60px;
}

.product-tabs .nav-tabs {
  border: none;
  border-top: 2px solid #333;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f9fa;
  display: flex;
  justify-content: stretch;
  gap: 0;
  width: 100%;
  border-radius: 0 !important;
}

.product-tabs .nav-item {
  flex: 1;
  position: relative;
  margin: 0;
  border-radius: 0 !important;
}

/* 탭 구분선 */
.product-tabs .nav-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background-color: #e0e0e0;
}

.product-tabs .nav-link {
  border: none;
  background-color: #f5f5f5;
  color: #666;
  font-size: 16px;
  font-weight: 600;
  padding: 16px 24px;
  text-align: center;
  border-radius: 0 !important;
  transition: all 0.2s;
  width: 100%;
  white-space: nowrap;
}

.product-tabs .nav-link:hover {
  background-color: #e8e8e8;
  color: #333;
}

.product-tabs .nav-link.active {
  background-color: #fff;
  color: #000;
  font-weight: 700;
  border-bottom: 3px solid #ff6b00;
  border-radius: 0 !important;
}

/* 탭 컨텐츠 */
.tab-content {
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 !important;
  background-color: #fff;
  min-height: 400px;
  padding: 40px;
}

.tab-pane {
  border-radius: 0 !important;
}

/* 필수 표기 정보 테이블 */
.tab-content table {
  margin-bottom: 2rem;
  border-radius: 0 !important;
}

.tab-content table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #333;
}

.tab-content table td {
  color: #666;
}

.tab-content table th:first-child,
.tab-content table td:first-child {
  border-radius: 0 !important;
}

.tab-content table th:last-child,
.tab-content table td:last-child {
  border-radius: 0 !important;
}

/* 상품 상세 이미지 */
.desc-images {
  text-align: center;
}

.desc-images img {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 20px;
  display: block;
  border-radius: 8px;
}

/* ==========================================
   리뷰 섹션
========================================== */
.review-summary {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  margin-bottom: 32px;
}

.review-summary-title {
  font-size: 18px;
  font-weight: 600;
  color: #111;
  margin-bottom: 16px;
}

.review-summary-stars {
  font-size: 48px;
  color: #ff6b00;
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.review-summary-score {
  font-size: 32px;
  font-weight: 700;
  color: #111;
}

/* 리뷰 테이블 */
.review-table {
  width: 100%;
  border-collapse: collapse;
}

.review-table thead {
  background: #f9fafb;
  border-top: 2px solid #111;
  border-bottom: 1px solid #e5e7eb;
}

.review-table th {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  padding: 16px 12px;
  text-align: center;
}

.review-table td {
  font-size: 14px;
  color: #111;
  padding: 16px 12px;
  border-bottom: 1px solid #f3f4f6;
  text-align: center;
}

.review-table tbody tr:hover {
  background: #fafafa;
}

.review-content {
  text-align: left !important;
}

.review-rating {
  color: #ff6b00;
  font-size: 16px;
}

/* ==========================================
   배송/교환 안내
========================================== */
.shipping-info h6 {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin-top: 24px;
  margin-bottom: 12px;
}

.shipping-info p {
  font-size: 14px;
  color: #767676;
  line-height: 1.6;
}

/* ==========================================
   반응형
========================================== */
@media (max-width: 991px) {
  .product-info-section {
    padding-left: 0;
    margin-top: 32px;
  }
  
  .image-section {
    flex-direction: column-reverse;
  }
  
  .thumbnail-column {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }
  
  /* 모바일에서 확대 기능 숨김 */
  .zoom-result,
  .zoom-lens {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .product-tabs .nav-link {
    font-size: 14px;
    padding: 12px 8px;
  }
  
  .product-tabs .nav-item::after {
    display: none;
  }
  
  .product-title {
    font-size: 20px;
  }
  
  .product-price,
  .discount-rate {
    font-size: 24px;
  }
  
  .button-section {
    flex-direction: column;
  }
  
  .thumb-img {
    width: 50px;
    height: 50px;
  }
  
  .tab-content {
    padding: 20px;
  }

  .product-detail-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  .image-section {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  .main-image-container {
    margin: 0 auto !important;
    padding: 0 !important;
    max-width: 90%;
    min-height: auto !important;
    margin-top: 20px !important;
  }

  .main-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }
}
/* ✅ 버튼 스타일은 별도 블록으로 분리 */
@media (max-width: 768px) {
  .btn-cart,
  .btn-buy {
    height: 68px !important;  /* 세로폭 확실히 증가 */
    padding: 16px 0 !important;  /* 안쪽 여백으로 더 높이 보이게 */
    font-size: 18px !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
  }

  .button-section {
    flex-direction: column;
    gap: 14px !important;
  }
}
