/* File: c/* 概覽區：圖片 + 資訊 */
.prdSummary {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem; /* 增加間距以利用剩餘的10%空間 */
  margin-bottom: 2rem;
}hop-product_detail.css */

/* 全站容器 */
.prdDetailWrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  font-family: sans-serif;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden; /* 防止水平溢出 */
}

/* 概覽區：圖片 + 資訊 */
.prdSummary {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem; /* 減少間距以確保兩欄能完美平分 */
  margin-bottom: 2rem;
}


.imageGallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 0 0 45%; /* 桌機版佔45%寬度 */
  max-width: 45%;
}

.mainImg {
  position: relative;
  width: 100%;
  max-width:500px;
  max-height: 500px; 
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-product-image {
  width: 100%;
  height: 100%;
  object-fit: contain; 
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}

.main-product-image.fading {
  opacity: 0;
  transform: scale(0.95);
}

.image-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 2;
}

.image-loading.show {
  display: block;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.thumbList {
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.thumb-item {
  width: 80px;
  height: 80px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: #f8f9fa;
}

.thumb-item:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.thumb-item.active {
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.thumb-item:hover .thumb-image {
  transform: scale(1.05);
}

/* 響應式設計 */
@media (max-width: 768px) {
  .mainImg {
    height: 300px;
  }
  
  .thumb-item {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 480px) {
  .mainImg {
    height: 250px;
  }
  
  .thumb-item {
    width: 50px;
    height: 50px;
  }
  
  .thumbList {
    gap: 0.25rem;
  }
} 

/* 商品資訊 */
.prdInfo {
  flex: 0 0 45%; /* 改為45%寬度 */
  max-width: 45%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prdTitle {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.prdCode {
  color: #666;
  font-size: 0.9rem;
}

.prdPrice {
  font-size: 2rem;
  color: #c00;
  font-weight: 700;
}

.prdActions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

.btn-primary {
  background-color: #f60;
  color: #fff;
}

.btn-secondary {
  background-color: #fff;
  color: #333;
  border: 1px solid #ccc;
}

/* 追蹤按鈕樣式已移至 product-tracking.css */

/* 購物車訊息 */
.cart-message {
  margin-top: 15px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
}

.cart-message-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.cart-message-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.cart-message-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 詳細導覽（置頂黏附） */
.detailNav {
  position: sticky;
  top: 50px; /* 根據主選單高度調整 */
  background: #fff;
  border-bottom: 1px solid #eee;
  z-index: 5;
}

.detailNav ul {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
  margin: 0;
  list-style: none;
}

.detailNav a {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  padding: 0.5rem;
}

.detailNav a.active {
  border-bottom: 2px solid #f60;
  color: #f60;
}

/* 詳細內容區 */
.detailArea {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.detailSection h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* 商品特色 */
.feature-content {
  font-size: 1rem;
  line-height: 1.6;
}

/* 商品規格表 */
.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table th,
.specs-table td {
  padding: 0.75rem;
  border: 1px solid #eee;
}

.specs-table th {
  background: #f9f9f9;
  text-align: left;
  width: 30%;
}

/* 商品評價 */
.review-item {
  border-bottom: 1px solid #eee;
  padding: 1rem 0;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.review-header .author {
  font-weight: 600;
}

.review-header .rating {
  color: #f60;
}

.comment {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* 退換貨須知 */
.return-list {
  list-style: disc inside;
  padding-left: 1rem;
}

.return-list li {
  margin-bottom: 0.5rem;
}

/* 取代原本的 radio 顯示，讓整個區塊可點擊並有選取效果 */
.spec-container {
  margin-bottom: 1rem;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.spec-container label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.spec-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spec-option {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1rem;
  margin: 0.2rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.spec-option input[type="radio"] {
  display: none; /* 隱藏預設 radio 圖示 */
}

.spec-option label {
  margin: 0;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
}

/* 選中後的樣式 */
.spec-option.active,
.spec-option input[type="radio"]:checked + label {
  border-color: #f60;
  background-color: rgba(246, 96, 0, 0.1);
}

/* 未選擇規格時的警告樣式 */
.spec-container.spec-required {
  background-color: #fff5f5;
  border: 2px solid #fed7d7;
  animation: shake 0.5s ease-in-out;
}

.spec-container.spec-required label {
  color: #c53030;
  font-weight: bold;
}

.spec-container.spec-required .spec-option {
  border-color: #feb2b2;
}

/* 搖動動畫 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
  20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* 購物車訊息樣式 */
.cart-message {
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  animation: slideIn 0.3s ease-out;
}

.cart-message-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.cart-message-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.cart-message-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #b8daff;
}


/* ===== 合併後的 評價與統計 區塊 美化 ===== */
.review-summary {
  background: #fafafa;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
}
.review-summary h1 {
  font-size: 2.2rem;
  color: #e65;
  margin-bottom: 0.5rem;
}
.review-summary .ratings-bar {
  display: flex;
  align-items: center;
  margin: 0.75rem 0;
}
.review-summary .ratings-bar .label {
  flex: 1;
  font-weight: 600;
  color: #333;
}
.review-summary .ratings-bar .bar {
  flex: 3;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  margin: 0 0.5rem;
  overflow: hidden;
}
.review-summary .ratings-bar .bar span {
  display: block;
  height: 100%;
  background: #e65;
}
.review-summary .ratings-bar .value {
  width: 2rem;
  text-align: right;
  font-weight: 600;
  color: #e65;
}

/* 評價列表 */
.review-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.review-item {
  padding: 1rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.review-item:last-child {
  border-bottom: none;
}
.reviewer {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}
.reviewer .review-date {
  margin-left: auto;
  font-size: 0.85rem;
  color: #888;
}
.review-stars {
  margin-left: 1rem;
  font-size: 1.2rem;
}
.review-comment {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #444;
  margin-top: 0.5rem;
}
/* 預設只顯示桌機版 */
.mobile-link {
  display: none;
  text-align: center;
  width: 100%;
}

.gallery-item {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  padding: 8px;
  text-align: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 18px auto;
}

.gallery-item img {
  max-width: 90%;
  object-fit: contain;
  border-radius: 8px;
  background: #fafafa;
  transition: transform 0.2s;
}

.gallery-item:hover {
  box-shadow: 0 4px 18px rgba(25,118,210,0.13);
  transform: translateY(-4px) scale(1.03);
}

.gallery-item img:hover {
  transform: scale(1.08);
}

/* 手機滿版 */
@media (max-width: 768px) {
  .mainImg {
    width: 100%; /* 小螢幕時回復 100% 寬度 */
    max-width: 400px; /* 設定最大寬度限制 */
  }
  
  .gallery-item {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .gallery-item img {
    max-width: 100%;
  }
}
/* 回應式微調 */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  
  .prdDetailWrap {
    padding: 0.5rem; /* 減少手機版的 padding */
    overflow-x: hidden; /* 確保防止水平溢出 */
  }
  
  .prdSummary {
    flex-direction: column;
    gap: 1rem; /* 手機版減少間距 */
  }
  
  /* 手機版時圖片和資訊各自佔滿寬度 */
  .imageGallery {
    flex: 1 1 100%;
    max-width: 100%;
  }
  
  .prdInfo {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .thumbList img {
    width: 100%; /* 填滿手機版的thumb-item容器 */
    height: 100%; /* 填滿手機版的thumb-item容器 */
  }
  
  /* 手機版縮圖容器也要同步調整 */
  .thumb-item {
    width: 50px;
    height: 50px;
  }
  .desktop-link {
    display: none;
  }
  .mobile-link {
    display: inline-block;
    text-align: center;
  }  
  
  /* 詳細導覽（置頂黏附） */
  .detailNav {
    top: 50px;
  }
  .detailNav ul {
    display: flex;
    justify-content: space-between;
    padding: 0 0.5rem; /* 減少手機版 padding */
    margin: 0;
    list-style: none;
  }
  .detailNav li {
    flex: 1;
    text-align: center;      /* 讓 li 內所有文字都置中 */
  }
  .detailNav a.desktop-link {
    display: none;           /* 隱藏桌機版文字 */
  }
  .detailNav a.mobile-link {
    display: block;          /* 顯示手機版文字 */
    line-height: 1.2;        /* 控制行高，讓<br/>看起來不會太擠 */
  }  
}

@media (max-width: 480px) {
  .prdDetailWrap {
    padding: 0.25rem; /* 極小螢幕更少的 padding */
  }
  
  .prdSummary {
    gap: 0.5rem; /* 極小螢幕最小間距 */
  }
  
  .mainImg {
    max-width: 300px; /* 更小螢幕的最大寬度限制 */
  }
  
  .detailNav ul {
    padding: 0 0.25rem; /* 極小螢幕減少 padding */
  }
}

/* 推薦通知樣式 */
.referral-notice {
  background: linear-gradient(135deg, #52d9ff,#a0edf6 );
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.referral-notice i {
  font-size: 16px;
  color: #fff;
}

.referral-notice span {
  flex: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 影片區塊樣式 */
.video-block {
  margin: 20px 0;
  text-align: center;
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 56.25%; /* 16:9 寬高比 */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* 庫存相關樣式 */
.spec-option label.out-of-stock {
    color: #999;
    text-decoration: line-through;
    cursor: not-allowed;
}

.spec-option input:disabled + label {
    opacity: 0.5;
    pointer-events: none;
}

.stock-status {
    font-size: 0.8em;
    margin-left: 5px;
    padding: 2px 6px;
    border-radius: 3px;
    background-color: #dc3545;
    color: white;
}

.stock-status.low-stock {
    background-color: #ffc107;
    color: #000;
}

.stock-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    display: none;
}

.quantity-selector input:invalid {
    border-color: #dc3545;
}
