/* ===========================
   Product Page (FutureHost Color System)
   =========================== */

.product-page {
  color: var(--text-default);
  font-size: 15px;
  margin-bottom: 40px;
}

.product-layout {
  margin-top: 10px;
}

.product-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 50px;
}

/* ===========================
   左側圖片區
   =========================== */
.product-gallery .main-image {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  transition: 0.3s;
}
.product-gallery .main-image img {
  width: 100%;
  display: block;
}
.product-gallery .main-image:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* ===========================
   縮圖列（滑動 + 箭頭）
   =========================== */
.thumb-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
  padding: 5px 36px;
}
.thumb-track::-webkit-scrollbar {
  display: none;
}

.thumb-item {
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  border: 2px solid transparent;
  object-fit: cover;
  transition: 0.25s;
}
.thumb-item:hover,
.thumb-item.active {
  border-color: var(--color-primary);
  /*box-shadow: 0 0 4px rgba(78, 122, 148, 0.3);*/
}
.thumb-track.dragging {
  cursor: grabbing;
}

/* 左右箭頭 */
.thumb-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  background: rgba(0,0,0,0.25);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: 0.25s;
  z-index: 2;
  display: none;
}
.thumb-slider:hover .thumb-nav {
  display: block;
}
.thumb-nav:hover {
  background: var(--color-secondary);
}
.thumb-nav.prev {
  left: 0;
  border-radius: 5px 0 0 5px;
}
.thumb-nav.next {
  right: 0;
  border-radius: 0 5px 5px 0;
}
.thumb-nav i {
  font-size: 20px;
}

/* 手機：隱藏箭頭，用滑動操作 */
@media (max-width: 767px) {
  .thumb-nav { display: none !important; }
  .thumb-track { padding: 5px 0; }
}

/* ===========================
   右側商品資訊
   =========================== */
.product-info {
  padding: 10px 20px;
}
.product-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}
.product-meta {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.6;
}
.product-price {
  margin: 15px 0;
}
.price-current {
  color: var(--color-accent);
  font-size: 28px;
  font-weight: 700;
}
.price-old {
  color: var(--text-muted);
  text-decoration: line-through;
  margin-right: 10px;
}

/* 評價 */
.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 15px;
}
.product-rating .fa-star {
  color: var(--color-warning);
}
.product-rating .review-text {
  color: var(--text-muted);
  font-size: 14px;
}

/* ===========================
   數量與按鈕
   =========================== */
.quantity-box {
  margin: 20px 0 10px;
  gap: 10px;
}
.quantity-box label {
    font-size: 14px;
}
.quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border, #e6e6e6);
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-card-default, #ffffff);

}
.quantity-controls input {
  width: 100%;
  border: none;
  text-align: center;
  height: 40px;
  outline: none;
}
.qty-btn {
  background: #f8f9fa;
  border: none;
  width: 35px;
  height: 35px;
  font-size: 18px;
  cursor: pointer;
  transition: 0.25s;
}
.qty-btn:hover {
  background: #e9ecef;
}

/* === 按鈕組 === */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.action-buttons .btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  outline: none !important;
}

/* === 主按鈕（行動主色）=== */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--btn-primary-text);
}
.btn-primary:active, .btn-primary:focus, .btn-primary:hover{
  filter: brightness(1.05);
  background-color: var(--color-secondary);
  color: var(--btn-primary-text);
}

/* === 次要按鈕（主題輔助色）=== */
.btn-tertiary {
  background-color: var(--color-tertiary);
  color: var(--btn-primary-text);
}
.btn-tertiary:active, .btn-tertiary:hover, .btn-primary:focus {
  filter: brightness(1.1);
  color: var(--btn-primary-text);
}

/* =========================================================
   FutureHost — Nav Tabs 商品詳情 (平均寬度 + 無邊框)
   ========================================================= */
.nav-tabs {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  border: none;
  border-bottom: 2px solid var(--color-border);
  background: transparent;
  margin: 30px auto 25px;
  max-width: 100%;
}

.nav-tabs > li {
  flex: 1;
  text-align: center;
  list-style: none;
  margin: 0;
  position: relative;
}

.nav-tabs > li > a {
  display: block;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 0;
  border: none;
  background: transparent;
  transition: color 0.25s ease;
}

/* hover 效果 */
.nav-tabs > li > a:hover {
  color: var(--color-secondary);
}

/* active 狀態：顏色與底線 */
.nav-tabs > li.active > a {
  color: var(--color-primary);
  background: transparent;
}

/* 下方底線 */
.nav-tabs > li.active > a::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
}

/* 取消 Bootstrap 預設邊框 */
.nav-tabs > li > a,
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
  border: none !important;
}

/* RWD 手機版：橫向滑動 */
@media (max-width: 768px) {
  .nav-tabs > li > a {
      font-size: 14px;
      padding: 5px 0;
    }
}

/* ===========================
   RWD
   =========================== */
@media (max-width: 767px) {
  .product-main {
    flex-direction: column;
    gap: 25px;
    padding: 0 15px;
  }
  .product-gallery, .product-info {
    width: 100%;
  }
  .product-info {
    padding: 0 10px;
  }
  .action-buttons {
    flex-direction: column;
  }
}

/* =========================================================
   FutureHost — 評論表單美化 + 星星互動樣式
   ========================================================= */
#tab-review {
  margin-top: 25px;
  padding: 20px 15px;
}

/* 標題 */
#tab-review h4 {
  font-size: 17px;
  color: var(--text-default);
  margin-bottom: 20px;
  letter-spacing: 0.3px;
}

/* 表單容器 */
#form-review {
  background: var(--bg-light);
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 12px;
  padding: 24px 28px 60px; /* 下方留空間給按鈕 */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  position: relative;
  transition: box-shadow 0.3s ease;
}

/* 標籤 */
#form-review label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-default);
  margin-bottom: 6px;
  display: inline-block;
}

/* 輸入框、文字框 */
#form-review input.form-control,
#form-review textarea.form-control {
  border: 1px solid var(--color-border, #ddd);
  height: 40px;
  border-radius: 8px;
  font-size: 14px;
  padding: 20px 12px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* hover 與 focus 狀態 */
#form-review input.form-control:hover,
#form-review textarea.form-control:hover {
  border-color: var(--color-primary);
}
#form-review input.form-control:focus,
#form-review textarea.form-control:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 3px var(--color-primary);
}

/* 文字框尺寸 */
#form-review textarea {
  min-height: 120px;
  resize: vertical;
}

/* 提示文字 */
#form-review .help-block {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* =========================================================
   星星評價區
   ========================================================= */
.rating-label {
  font-size: 16px;
  color: var(--text-default);
  margin-right: 10px;
}
.rating-stars-label {
    margin-bottom: 0 !important;
}
.rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 28px; /* 星星放大！ */
  cursor: pointer;
  user-select: none;
}
.rating-stars i {
  color: #ddd;
  transition: color 0.25s ease, transform 0.25s ease, text-shadow 0.25s ease;
  font-size: 26px;
}
.rating-stars i:hover {
  color: var(--color-warning);
  transform: scale(1.25);
  text-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
}
.rating-stars i.active {
  color: var(--color-warning);
  transform: scale(1.15);
  text-shadow: 0 0 6px rgba(255, 193, 7, 0.4);
}

/* =========================================================
   提交按鈕（固定在右下角）
   ========================================================= */
#button-review {
  background: var(--color-primary);
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-weight: 600;
  font-size: 14px;
  color: var(--btn-primary-text, #fff);
  transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: absolute;
  bottom: 20px;
  right: 25px;
  outline: none;
}
#button-review:hover {
  background: var(--color-secondary);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}
#button-review:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   Alert 提示樣式（內嵌式）
   ========================================================= */
#review-alert .alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  animation: fadeInDown 0.4s ease;
  margin-bottom: 15px;
}
.alert-success {
  background-color: #f3fff3;
  border: 1px solid #c7e7c7;
  color: var(--color-success);
}
.alert-danger {
  background-color: #fff5f5;
  border: 1px solid #e0b4b4;
  color: var(--color-danger);
}
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =========================================================
   FutureHost — 商品評論樣式
   ========================================================= */
.review-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.review-item {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--bg-light);
  padding: 15px 20px;
  transition: box-shadow 0.25s ease;
}
.review-item:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.review-author {
  font-weight: 600;
  color: var(--color-secondary);
  font-size: 15px;
}
.review-date {
  color: var(--text-muted);
  font-size: 13px;
}

.review-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-default);
}

.review-rating {
  color: var(--color-warning);
  font-size: 15px;
}

.review-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 2px solid var(--color-border);
  font-size: 13px;
}

.no-review {
  text-align: center;
  padding: 30px 0;
  background: var(--bg-light);
  border-radius: 6px;
  margin-bottom: 30px;
}

/* ===========================
   Related Products — Card Layout
   =========================== */

.related-products {
  margin-top: 40px;
}

.related-products h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 25px;
  text-align: center;
}

.related-products h3::after {
  content: "";
  display: block;
  height: 3px;
  width: 60px;
  background: var(--color-primary);
  margin: 10px auto 0;
  border-radius: 2px;
}

.product-thumb {
  background: var(--product-card-bg, #fff);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-thumb:hover {
  /*box-shadow: 0 6px 16px rgba(0,0,0,0.1);*/
  /*transform: translateY(-4px);*/
}

.product-thumb .image {
  position: relative;
  overflow: hidden;
}

.product-thumb .image img {
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--color-border);
  transition: transform 0.4s ease;
}

.product-thumb:hover .image img {
  transform: scale(1.05);
}

/* 內容區 */
.product-thumb .caption {
  padding: 15px 15px 20px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-thumb .caption h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-default);
  margin-bottom: 10px;
  line-height: 1.4;
}

.product-thumb .caption h4 a {
  color: var(--text-default);
  text-decoration: none;
  transition: color 0.2s;
}

.product-thumb .caption h4 a:hover {
  color: var(--color-secondary);
}

/* 簡短描述 */
.product-thumb .caption p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.4;
  max-height: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 價格區 */
.product-thumb .price {
  font-size: 20px;
  font-weight: 600;
  margin-top: auto;
  color: var(--product-price);
}

.product-thumb .price-old {
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: normal;
  margin-left: 6px;
  font-size: 16px;
}

.product-thumb .price-new {
  color: var(--color-accent);
  font-size: 20px;
}

/* RWD */
@media (max-width: 991px) {
  .product-thumb .caption {
    padding: 12px;
  }
  .product-thumb .caption h4 {
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .product-thumb {
    margin-bottom: 15px;
  }
}

/* ===============================
   Product Options — Blue-White Theme (Refined)
   =============================== */

/* ====== 標題 ====== */
.product-option-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 16px;
  letter-spacing: 0.3px;
}

/* ====== 結構 ====== */
#product-options .form-group {
  margin-bottom: 15px;
}

#product-options .control-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-default);
  margin-bottom: 6px;
  display: block;
}

/* ====== Select 下拉 ====== */
.styled-select {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-size: 16px;
  padding: 8px 12px;
  transition: all 0.25s ease;
  appearance: none;
}

.styled-select:hover {
  border-color: var(--color-secondary);
}

.styled-select:focus {
  border-color: var(--color-primary);
  /*box-shadow: 0 0 0 3px rgba(95, 168, 211, 0.2);*/
  outline: none;
}

/* ====== Input / Textarea ====== */
.styled-input,
.styled-textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--bg-default);
  color: var(--text-default);
  padding: 10px 14px;
  font-size: 16px;
  transition: all 0.25s ease;
}

.styled-input {
  height: 40px;
  line-height: 1.4;
}

.styled-input:focus,
.styled-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(95, 168, 211, 0.2);
  outline: none;
}

/* ===============================
   Radio / Checkbox — 卡片樣式
   =============================== */
.option-card-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.option-card-input {
  display: none;
}

.option-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  min-width: 120px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--bg-default);
  color: var(--text-default);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  text-align: center;
}

.option-card:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
  background: rgba(95,168,211,0.05);
}

.option-card-input:checked + .option-card {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--btn-primary-text, #fff);
  box-shadow: 0 3px 8px rgba(95,168,211,0.25);
}

/* 圖片 + 價格 */
.option-card img {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 4px;
}

.option-card small {
  font-size: 12px;
  color: var(--text-muted);
}

.option-card-input:checked + .option-card small {
  color: rgba(255, 255, 255, 0.85);
}

/* ===============================
   日期與上傳按鈕
   =============================== */
.btn-date,
.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary);
  color: var(--btn-primary-text, #fff);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none !important;
  height: 40px;
}

.btn-date:hover,
.btn-upload:hover {
  background: var(--color-secondary);
  color: var(--btn-primary-text, #fff);
}

/* ===============================
   RWD 響應式
   =============================== */
@media (max-width: 768px) {
  .option-card {
    flex: 1 1 48%;
    font-size: 12px;
  }
}
