/* 사주톡톡 상품 상세 페이지 스타일 - 새로운 디자인 */

/* 폰트 설정 */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap");

/* 전체 컨테이너 */
.sts-product-detail {
  font-family: "Noto Sans KR", sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  overflow-x: hidden;
  width: 100%;
}

.sts-product-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-sizing: border-box;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

/* 모든 자식 요소 overflow 방지 */
.sts-product-container * {
  max-width: 100%;
  box-sizing: border-box;
}

/* 상품 이미지 영역 */
.sts-product-image {
  position: relative;
  max-width: 500px;
  width: 100%;
  box-sizing: border-box;
}

.sts-product-image img.sts-main-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: block;
}

/* 썸네일 이미지 */
.sts-product-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  width: 100%;
  padding-bottom: 10px;
  scroll-behavior: smooth;
  box-sizing: border-box;
}

/* 스크롤바 스타일 */
.sts-product-thumbnails::-webkit-scrollbar {
  height: 8px;
}

.sts-product-thumbnails::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.sts-product-thumbnails::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.sts-product-thumbnails::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.sts-thumbnail {
  min-width: 80px;
  width: 80px;
  height: 80px;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s;
  flex-shrink: 0;
}

.sts-thumbnail:hover,
.sts-thumbnail.active {
  border-color: #8b4513;
}

.sts-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 상품 정보 영역 */

/* 상품명 */
.sts-product-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* 간단 설명 */
.sts-product-excerpt {
  font-size: 16px;
  color: #666;
  margin-bottom: 30px;
  line-height: 1.6;
}

/* 가격 영역 */
.sts-price-wrapper {
  padding: 20px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin-bottom: 30px;
}

.sts-price-regular {
  font-size: 14px;
  color: #999;
  text-decoration: line-through;
  margin-bottom: 5px;
}

.sts-price-sale {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sts-discount-rate {
  font-size: 24px;
  font-weight: 700;
  color: #ff4757;
}

.sts-sale-price {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
}

.sts-price-unit {
  font-size: 20px;
  font-weight: 400;
}

/* 배송 정보 */
.sts-shipping-info {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
}

.sts-shipping-info .info-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
}

.sts-shipping-info .info-row:last-child {
  margin-bottom: 0;
}

.sts-shipping-info .info-label {
  font-size: 14px;
  color: #666;
  min-width: 80px;
}

.sts-shipping-info .info-value {
  font-size: 14px;
  color: #1a1a1a;
  font-weight: 500;
}

/* 카카오톡 채널 추가 버튼 */
.sts-kakao-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fee500;
  color: #000;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 30px;
  transition: background 0.3s;
}

.sts-kakao-channel:hover {
  background: #fad900;
  text-decoration: none;
  color: #000;
}

.sts-kakao-channel img {
  width: 20px;
  height: 20px;
}

/* 옵션 선택 영역 */
.sts-options-section {
  margin-bottom: 30px;
}

.sts-option-group {
  margin-bottom: 20px;
}

.sts-option-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  display: block;
}

.sts-option-select,
.sts-option-input,
.sts-option-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-family: "Noto Sans KR", sans-serif;
  background: #fff;
  transition: border-color 0.3s;
}

.sts-option-select {
  cursor: pointer;
}

.sts-option-textarea {
  resize: vertical;
  min-height: 80px;
}

.sts-option-select:focus,
.sts-option-input:focus,
.sts-option-textarea:focus {
  outline: none;
  border-color: #8b4513;
}

.sts-option-label .required {
  color: #ff4757;
  margin-left: 4px;
}

/* 수량 선택 */
.sts-quantity-section {
  margin-bottom: 30px;
}

.sts-quantity-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  display: block;
}

.sts-quantity-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

.sts-quantity-minus,
.sts-quantity-plus {
  width: 40px;
  height: 44px;
  background: #f8f9fa;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #666;
  transition: background 0.3s;
}

.sts-quantity-minus:hover,
.sts-quantity-plus:hover {
  background: #e9ecef;
}

.sts-quantity-input {
  width: 60px;
  height: 44px;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  text-align: center;
  font-size: 16px;
  font-family: "Noto Sans KR", sans-serif;
}

.sts-quantity-input:focus {
  outline: none;
}

/* 총 금액 표시 */
.sts-total-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 2px solid #1a1a1a;
  margin-bottom: 30px;
}

.sts-total-label {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
}

.sts-total-price {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
}

/* 버튼 영역 */
.sts-button-wrapper {
  display: grid;
  grid-template-columns: 1fr 0fr;
}

.sts-add-to-cart,
.sts-buy-now {
  padding: 16px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  font-family: "Noto Sans KR", sans-serif;
  cursor: pointer;
  transition: all 0.3s;
}

.sts-add-to-cart {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #ddd;
}

.sts-add-to-cart:hover {
  background: #f8f9fa;
}

.sts-buy-now {
  background: #1a1a1a;
  color: #fff;
}

.sts-buy-now:hover {
  background: #000;
}

/* 네이버페이 버튼 */
.sts-naverpay-button {
  margin-top: 10px;
  width: 100%;
  height: 56px;
  background: #03c75a;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: "Noto Sans KR", sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.3s;
}

.sts-naverpay-button:hover {
  background: #02b351;
}

/* 탭 메뉴 */
.sts-tabs {
  margin-top: 80px;
  border-top: 2px solid #1a1a1a;
}

.sts-tab-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #ddd;
}

.sts-tab-menu li {
  flex: 1;
}

.sts-tab-menu a {
  display: block;
  padding: 20px;
  text-align: center;
  color: #666;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s;
  position: relative;
}

.sts-tab-menu a:hover,
.sts-tab-menu a.active {
  color: #1a1a1a;
}

.sts-tab-menu a.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #1a1a1a;
}

.sts-tab-content {
  padding: 40px 0;
}

.sts-tab-pane {
  display: none;
}

.sts-tab-pane.active {
  display: block;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  /* 메인 컨테이너 조정 */
  .sts-product-detail {
    padding: 10px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sts-product-container {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 20px;
    max-width: calc(100vw - 20px);
    margin: 0 auto;
    overflow-x: hidden;
  }

  /* 모든 내부 요소 너비 제한 */
  .sts-product-container > * {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* 모바일에서 이미지 영역 전체 너비 사용 */
  .sts-product-image {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }

  .sts-product-image img,
  .sts-product-image img.sts-main-image {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    display: block;
    box-sizing: border-box;
    object-fit: contain;
  }

  .sts-product-title {
    font-size: 24px;
  }

  .sts-sale-price {
    font-size: 28px;
  }

  .sts-button-wrapper {
    grid-template-columns: 1fr;
  }

  .sts-tab-menu {
    flex-direction: column;
  }

  .sts-tab-menu a {
    border-bottom: 1px solid #eee;
  }

  /* 모바일에서 썸네일 스타일 - 전체 너비 사용 */
  .sts-product-thumbnails {
    max-width: 100% !important;
    width: calc(100% - 10px);
    padding-bottom: 15px;
    padding-left: 5px;
    padding-right: 5px;
    gap: 8px;
    -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
    margin: 0 auto;
    box-sizing: border-box;
  }

  .sts-thumbnail {
    min-width: 60px;
    width: 60px;
    height: 60px;
  }

  /* 모바일 스크롤바 더 얇게 */
  .sts-product-thumbnails::-webkit-scrollbar {
    height: 6px;
  }
}

/* 더 작은 모바일 화면 */
@media (max-width: 480px) {
  .sts-product-detail {
    padding: 5px;
  }

  .sts-product-container {
    padding: 15px;
    gap: 30px;
    max-width: calc(100vw - 10px);
  }

  .sts-product-thumbnails {
    gap: 6px;
    max-width: 100% !important;
  }

  .sts-product-image {
    max-width: 100% !important;
  }

  .sts-thumbnail {
    min-width: 50px;
    width: 50px;
    height: 50px;
  }

  .sts-product-title {
    font-size: 20px;
  }

  .sts-sale-price {
    font-size: 24px;
  }
}

/* 갤러리 스타일 */
.sts-product-gallery {
  margin-top: 60px;
  padding-top: 60px;
  border-top: 1px solid #e0e0e0;
}

.sts-product-gallery h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center;
  color: #333;
}

.sts-gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sts-gallery-item {
  width: 100%;
  position: relative;
  overflow: hidden;
}

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

@media (max-width: 768px) {
  .sts-product-gallery {
    margin-top: 40px;
    padding-top: 40px;
  }

  .sts-product-gallery h3 {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .sts-gallery-grid {
    gap: 10px;
  }
}
