/* =====================================================
   UTOYIA Product Pages — product.css
   Bootstrap 5.3.8 compatible
   ===================================================== */

/* Google Fonts — 需放在所有 rule 之前 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

/* ─── CSS 自訂變數 (不與 --bs-* 衝突) ─────────────── */
:root {
  --prod-primary: #2B2B2B;
  --prod-accent: #2B2B2B;
  --prod-accent-dark: #4b88c7;
  --prod-accent-aux: #4b88c7;
  --prod-accent-light: #dbdbdb;
  --prod-accent2: #4b88c7;
  --prod-bg: #f8f9fa;
  --prod-card-bg: #ffffff;
  --prod-border: #dbdbdb;
  --prod-shadow: 0 4px 20px rgba(0, 0, 0, .05);
  --prod-shadow-lg: 0 12px 40px rgba(0, 0, 0, .1);
  --prod-radius: 14px;
  --prod-radius-sm: 8px;
  --prod-trans: .3s cubic-bezier(.25, .8, .25, 1);
}

/* ─── Category Sidebar ─────────────────────────────── */
.prod-sidebar {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "微軟正黑體", sans-serif;
  color: var(--prod-primary);
}

.prod-sidebar .sidebar-search {
  position: relative;
  margin-bottom: 1.4rem;
}

/* 避免 BS5 .form-control 干擾：使用獨立 class */
.prod-sidebar .sidebar-search .prod-search-input {
  border: 1.5px solid var(--prod-border);
  border-radius: 30px;
  padding: .55rem 2.8rem .55rem 1.1rem;
  font-size: .88rem;
  width: 100%;
  outline: none;
  transition: border-color var(--prod-trans), box-shadow var(--prod-trans);
  background: #fff;
  color: var(--prod-primary);
  /* 覆蓋 BS5 的 .form-control box-shadow */
  box-shadow: none !important;
}

.prod-sidebar .sidebar-search .prod-search-input:focus {
  border-color: var(--prod-accent-dark) !important;
  box-shadow: 0 0 0 3px rgba(150, 118, 60, 0.20) !important;
}

.prod-sidebar .sidebar-search .btn-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--prod-trans);
}

.prod-sidebar .sidebar-search .btn-search:hover {
  color: var(--prod-accent-dark);
}

.prod-sidebar .cate-title {
  display: flex;
  align-items: center;
  position: relative;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--prod-primary);
  margin: 1.5rem 0 .75rem;
  padding-left: .65rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--prod-border);
}

.prod-sidebar .cate-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: calc(15% + .45rem);
  width: 3.5px;
  background: var(--prod-accent);
  border-radius: 2px;
}

.prod-sidebar .cate1-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .85rem;
  border-radius: var(--prod-radius-sm);
  font-size: .92rem;
  font-weight: 500;
  color: var(--prod-primary);
  text-decoration: none;
  transition: background var(--prod-trans), color var(--prod-trans), border-color var(--prod-trans);
  cursor: pointer;
  border-left: 3px solid transparent;
}

.prod-sidebar .cate1-link:hover {
  background: rgba(226, 186, 126, 0.12);
  color: var(--prod-accent-dark);
}

.prod-sidebar .cate1-link.active {
  background: rgba(226, 186, 126, 0.18);
  color: var(--prod-accent-dark);
  font-weight: 600;
  border-left-color: var(--prod-accent);
}

.prod-sidebar .cate1-link .caret-icon {
  transition: transform .25s ease, color var(--prod-trans);
  font-size: .75rem;
  color: #999;
}

.prod-sidebar .cate1-link:hover .caret-icon,
.prod-sidebar .cate1-link.active .caret-icon {
  color: var(--prod-accent);
}

.prod-sidebar .cate1-link.open .caret-icon {
  transform: rotate(90deg);
}

.prod-sidebar .cate2-list {
  display: none;
  padding-left: .5rem;
  margin-bottom: .3rem;
}

.prod-sidebar .cate2-list.show {
  display: block;
}

.prod-sidebar .cate2-link {
  display: block;
  padding: .4rem .8rem .4rem 1.4rem;
  font-size: .85rem;
  color: #555;
  text-decoration: none;
  border-radius: var(--prod-radius-sm);
  position: relative;
  transition: color var(--prod-trans), background var(--prod-trans);
}

.prod-sidebar .cate2-link::before {
  content: '';
  position: absolute;
  left: .65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ccc;
  transition: background var(--prod-trans), transform var(--prod-trans);
}

.prod-sidebar .cate2-link:hover {
  color: var(--prod-accent-dark);
  background: rgba(226, 186, 126, 0.10);
}

.prod-sidebar .cate2-link:hover::before {
  background: var(--prod-accent-aux);
}

.prod-sidebar .cate2-link.active {
  color: var(--prod-accent-dark);
  background: rgba(226, 186, 126, 0.16);
  font-weight: 600;
}

.prod-sidebar .cate2-link.active::before {
  background: var(--prod-accent);
  transform: translateY(-50%) scale(1.25);
}

/* 使用 prod- 前綴避免與 BS5 的 .form-select 衝突 */
.prod-sort-select {
  border: 1.5px solid var(--prod-border);
  border-radius: var(--prod-radius-sm);
  padding: .48rem .8rem;
  font-size: .85rem;
  width: 100%;
  background: #fff;
  color: var(--prod-primary);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2396763C' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  background-size: 10px;
  transition: border-color var(--prod-trans), box-shadow var(--prod-trans);
  /* 覆蓋 BS5 form-select 樣式 */
  box-shadow: none !important;
}

.prod-sort-select:focus {
  border-color: var(--prod-accent-dark) !important;
  box-shadow: 0 0 0 3px rgba(150, 118, 60, 0.20) !important;
}

/* ─── Product Status & Scroll Progress Toolbar ──────── */
.prod-status-toolbar {
  background: #ffffff;
  border: 1px solid var(--prod-border);
  border-radius: var(--prod-radius-sm);
  padding: .75rem 1rem;
}

.prod-status-badge {
  background-color: #f8f9fa;
  color: var(--prod-primary);
  border: 1px solid var(--prod-border);
  border-radius: 6px;
  padding: .35rem .65rem;
  font-size: .84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.prod-status-badge i {
  color: var(--prod-accent-dark);
}

.prod-progress-track {
  height: 4px;
  background-color: #f1f3f5;
  border-radius: 2px;
  overflow: hidden;
  margin-top: .6rem;
}

.prod-progress-bar {
  height: 100%;
  background-color: #4b88c7;
  border-radius: 2px;
  transition: width .35s ease;
}

/* ─── Grid / List Mode Switcher ─────────────────────── */
.prod-view-switcher {
  display: inline-flex;
  align-items: center;
  background-color: #f1f3f5;
  border: 1px solid var(--prod-border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.view-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: none;
  background: transparent;
  color: #888888;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.view-switch-btn:hover {
  color: #2B2B2B;
}

.view-switch-btn.active {
  background-color: #ffffff;
  color: #2B2B2B;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.view-switch-btn svg {
  display: block;
}

/* ─── Floating Page Indicator (智慧懸浮頁數膠囊) ──────── */
.prod-float-page-indicator {
  position: fixed;
  bottom: 148px;
  right: 24px;
  z-index: 1045;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #dbdbdb;
  border-radius: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  padding: 7px 14px 6px;
  cursor: default;
  user-select: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

.prod-float-page-indicator.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.prod-float-page-indicator:hover {
  border-color: #c0d3ea;
  box-shadow: 0 8px 24px rgba(75, 136, 199, 0.15);
}

.prod-float-page-indicator .indicator-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #2B2B2B;
  line-height: 1.2;
}

.prod-float-page-indicator .indicator-icon {
  color: #4b88c7;
  font-size: 0.85rem;
}

.prod-float-page-indicator .indicator-page strong {
  color: #4b88c7;
  font-weight: 700;
  font-size: 0.92rem;
}

.prod-float-page-indicator .indicator-divider {
  color: #ccc;
  font-size: 0.75rem;
}

.prod-float-page-indicator .indicator-count {
  color: #666;
  font-size: 0.78rem;
  font-weight: 500;
}

.prod-float-page-indicator .indicator-progress-track {
  height: 2px;
  background-color: #f1f3f5;
  border-radius: 1px;
  overflow: hidden;
  margin-top: 5px;
}

.prod-float-page-indicator .indicator-progress-bar {
  height: 100%;
  background-color: #4b88c7;
  border-radius: 1px;
  transition: width 0.25s ease;
}

@media (max-width: 767px) {
  .prod-float-page-indicator {
    bottom: 124px;
    right: 16px;
    padding: 6px 11px 5px;
  }

  .prod-float-page-indicator .indicator-inner {
    font-size: 0.76rem;
    gap: 4px;
  }

  .prod-float-page-indicator .indicator-count {
    display: none;
    /* 手機版空間緊湊，精簡顯示頁數 */
  }

  .prod-float-page-indicator .indicator-divider {
    display: none;
  }
}

/* ─── Product Grid ─────────────────────────────────── */
#product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 1.5rem;
  row-gap: 3rem;
  align-items: stretch;
}

@media (max-width: 991px) {
  #product-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 2.4rem;
  }
}

@media (max-width: 575px) {
  #product-grid {
    grid-template-columns: repeat(1, 1fr);
    row-gap: 2rem;
  }
}

/* ─── Product Card ─────────────────────────────────── */
/* 使用 .prod-card 前綴避免與 BS5 .card 衝突 */
.prod-card {
  background: var(--prod-card-bg);
  border-radius: var(--prod-radius);
  box-shadow: var(--prod-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform var(--prod-trans), box-shadow var(--prod-trans);
  border: 1px solid var(--prod-border);
  opacity: 0;
  transform: translateY(20px);
  animation: prodCardFadeIn .5s ease forwards;
}

.prod-card>a {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}

.prod-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--prod-shadow-lg);
  border-color: #CDA565;
}

@keyframes prodCardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── 商品瀏覽頁 (#product-grid 及首頁 #index-product-grid) 無框線極簡風格 ─── */
#product-grid .prod-card,
#index-product-grid .prod-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  transform: none !important;
  transition: transform .25s ease, opacity .25s ease;
}

#product-grid .prod-card:hover,
#index-product-grid .prod-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

#product-grid .prod-card .card-img-wrap,
#index-product-grid .prod-card .card-img-wrap {
  background: transparent !important;
  border-radius: 4px !important;
  overflow: hidden;
}

#product-grid .prod-card .card-img-wrap img,
#index-product-grid .prod-card .card-img-wrap img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform .35s ease, opacity .25s ease;
}

#product-grid .prod-card:hover .card-img-wrap img,
#index-product-grid .prod-card:hover .card-img-wrap img {
  transform: scale(1.04);
}

#product-grid .prod-card .card-body-inner,
#index-product-grid .prod-card .card-body-inner {
  padding: .65rem 0 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

#product-grid .prod-card .prod-brand,
#index-product-grid .prod-card .prod-brand {
  margin-bottom: .2rem !important;
}

#product-grid .prod-card .prod-name,
#index-product-grid .prod-card .prod-name {
  margin-bottom: .25rem !important;
  color: #2B2B2B !important;
}

#product-grid .prod-card .prod-brief,
#index-product-grid .prod-card .prod-brief {
  display: none !important;
}

#product-grid .prod-card .prod-price-row,
#index-product-grid .prod-card .prod-price-row {
  margin-top: .15rem !important;
  margin-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
}

#product-grid .prod-card .card-actions,
#index-product-grid .prod-card .card-actions {
  display: none !important;
}

/* ─── 商品列表頁 List 清單模式 ─────────────────────── */
#product-grid.view-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
}

#product-grid.view-list .prod-card {
  background: #ffffff !important;
  border: 1px solid var(--prod-border) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
  padding: 12px 16px !important;
  height: auto !important;
  overflow: hidden !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

#product-grid.view-list .prod-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08) !important;
  border-color: #4b88c7 !important;
}

#product-grid.view-list .prod-card>a {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  width: 100% !important;
  gap: 1.25rem !important;
}

#product-grid.view-list .prod-card .card-img-wrap {
  width: 120px !important;
  min-width: 120px !important;
  height: 120px !important;
  padding-top: 0 !important;
  border-radius: 8px !important;
  position: relative !important;
  flex-shrink: 0 !important;
  background: #f8f9fa !important;
  overflow: hidden !important;
}

#product-grid.view-list .prod-card .card-img-wrap img {
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  transition: transform 0.35s ease !important;
}

#product-grid.view-list .prod-card:hover .card-img-wrap img {
  transform: scale(1.05) !important;
}

#product-grid.view-list .prod-card .card-body-inner {
  flex: 1 1 auto !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-width: 0 !important;
}

#product-grid.view-list .prod-card .prod-brand {
  font-size: 0.85rem !important;
  color: #4b88c7 !important;
  font-weight: 600 !important;
  margin-bottom: 0.25rem !important;
}

#product-grid.view-list .prod-card .prod-name {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #2B2B2B !important;
  margin-bottom: 0.4rem !important;
  height: auto !important;
  line-height: 1.4 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  white-space: normal !important;
}

#product-grid.view-list .prod-card .prod-price-row {
  margin-top: 0.25rem !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
}

#product-grid.view-list .prod-card .price-sale {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #2B2B2B !important;
}

#product-grid.view-list .prod-card .price-org {
  font-size: 0.9rem !important;
  color: #888888 !important;
  text-decoration: line-through !important;
}

@media (max-width: 575px) {
  #product-grid.view-list .prod-card {
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }

  #product-grid.view-list .prod-card>a {
    gap: 0.75rem !important;
  }

  #product-grid.view-list .prod-card .card-img-wrap {
    width: 90px !important;
    min-width: 90px !important;
    height: 90px !important;
  }

  #product-grid.view-list .prod-card .prod-name {
    font-size: 0.95rem !important;
    margin-bottom: 0.25rem !important;
  }

  #product-grid.view-list .prod-card .price-sale {
    font-size: 1rem !important;
  }
}

/* Card Image (全站商品卡片正方形滿版裁切，無灰色底) */
.prod-card .card-img-wrap {
  position: relative;
  overflow: hidden;
  padding-top: 100%;
  background: transparent !important;
}

.prod-card .card-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.prod-card:hover .card-img-wrap img {
  transform: scale(1.06);
}

.prod-card .card-img-wrap .card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}

/* Badge — 使用 prod-badge-* 避免與 BS5 .badge 衝突，字級層級規範：12px */
.prod-badge-new {
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: .05em;
  display: inline-block;
}

.prod-badge-hot {
  background: #B08E4E;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: .05em;
  display: inline-block;
}

.prod-badge-oos {
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
}

.card-img-wrap .no-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 3rem;
}

/* Card Body */
.prod-card .card-body-inner {
  padding: 1rem 1rem .6rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.prod-card .prod-brand {
  font-size: 12px;
  font-weight: 700;
  color: #B08E4E;
  letter-spacing: 0.5px;
  line-height: 1.3;
  height: 1.3em;
  margin-bottom: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: none;
}

.prod-card .prod-name {
  font-size: 15px;
  font-weight: 700;
  color: #2B2B2B;
  line-height: 1.4;
  height: 2.8em;
  margin-bottom: .4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: none;
}

.prod-card .prod-brief {
  font-size: 12px;
  color: #777;
  line-height: 1.4;
  height: 1.4em;
  margin-bottom: .6rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: none;
}

.prod-card .prod-price-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: auto;
  margin-bottom: .6rem;
}

.prod-card .price-sale {
  font-size: 15px;
  font-weight: 700;
  color: #B08E4E;
}

.prod-card .price-org {
  font-size: 12px;
  color: #bbb;
  text-decoration: line-through;
}

.prod-card .stock-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: auto;
}

.stock-in {
  background: #4b88c7;
  color: #fff;
}

.stock-out {
  background: #f5f5f5;
  color: #aaa;
}

/* Card Footer Buttons */
.prod-card .card-actions {
  padding: 0 1rem 1rem;
  display: flex;
  gap: .5rem;
  margin-top: auto;
}

/* 加入購物車按鈕：次要按鈕規範 外框 #dbdbdb，白底，文字 #2B2B2B，Hover #4b88c7 */
.btn-prod-cart {
  flex: 1;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--prod-border);
  color: var(--prod-primary) !important;
  border-radius: var(--prod-radius-sm);
  font-size: 14px;
  font-weight: 600;
  padding: .5rem .75rem;
  text-align: center;
  transition: background var(--prod-trans), border-color var(--prod-trans), color var(--prod-trans), transform .15s;
  cursor: pointer;
  line-height: 1.4;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-prod-cart:hover:not(:disabled) {
  background: #4b88c7;
  border-color: #4b88c7;
  color: #fff !important;
  transform: scale(1.02);
}

.btn-prod-cart:disabled {
  background: #f0f0f0;
  border-color: #ddd;
  color: #aaa !important;
  cursor: not-allowed;
  transform: none;
}

/* ─── Loading Spinner (Infinite Scroll) ────────────── */
#load-more-trigger {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2.5rem;
  min-height: 80px;
}

.load-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #eee;
  border-top-color: var(--prod-accent);
  border-radius: 50%;
  animation: prodSpin .7s linear infinite;
}

@keyframes prodSpin {
  to {
    transform: rotate(360deg);
  }
}

#no-more-msg {
  text-align: center;
  color: #bbb;
  font-size: .85rem;
  padding: 2rem;
  display: none;
}

/* ─── Product Detail Page ──────────────────────────── */
.product-detail-wrap {
  font-family: 'Noto Sans TC', sans-serif;
}

/* Image Gallery */
.prod-gallery-main {
  position: relative;
  border-radius: var(--prod-radius);
  overflow: hidden;
  background: #f8f8f8;
  border: 1px solid var(--prod-border);
  margin-bottom: .8rem;
}

.prod-gallery-main img {
  width: 100%;
  display: block;
  object-fit: contain;
  max-height: 500px;
  transition: opacity .3s ease;
}

.prod-thumb-list {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.prod-thumb-item {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--prod-trans);
  background: #f4f4f4;
  flex-shrink: 0;
}

.prod-thumb-item:hover,
.prod-thumb-item.active {
  border-color: #CDA565;
}

.prod-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Info Panel */
.prod-info-panel {
  padding: 0 .5rem;
}

/* 商品標題 — 使用 .prod-title-h1 避免全站 h1 覆蓋 */
.prod-title-h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--prod-primary);
  line-height: 1.4;
  margin-bottom: .6rem;
}

@media (max-width: 768px) {
  .prod-title-h1 {
    font-size: 1.2rem;
  }
}

.prod-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  /* BS5 gap 0.5rem */
  font-size: .83rem;
  color: #888;
  margin-bottom: .9rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--prod-border);
}

.prod-meta-row .sku-label {
  font-weight: 500;
}

.prod-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.prod-stock-badge.in {
  background: rgba(75, 136, 199, 0.12);
  color: #4b88c7;
  border: 1px solid #4b88c7;
}

.prod-stock-badge.out {
  background: #f8f9fa;
  color: #888;
  border: 1px solid #dbdbdb;
}

.prod-stock-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Price — 價格強調：#B08E4E */
.prod-price-block {
  margin-bottom: 1.2rem;
}

.prod-price-sale {
  font-size: 2rem;
  font-weight: 700;
  color: #B08E4E;
  line-height: 1;
}

.prod-price-sale .currency {
  font-size: 1.1rem;
  vertical-align: middle;
}

.prod-price-org {
  font-size: .9rem;
  color: #bbb;
  text-decoration: line-through;
  margin-left: .5rem;
}

/* Spec Selectors */
.spec-section {
  margin-bottom: 1.1rem;
}

.spec-label {
  font-size: .85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.spec-label .selected-val {
  font-weight: 500;
  color: #B08E4E;
}

.spec-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* 使用 .spec-btn 不繼承 BS5 .btn 樣式 */
.spec-btn {
  min-width: 52px;
  padding: .4rem .9rem;
  border: 1.5px solid var(--prod-border);
  border-radius: var(--prod-radius-sm);
  background: #fff;
  font-size: .85rem;
  color: var(--prod-primary);
  cursor: pointer;
  transition: all var(--prod-trans);
  text-align: center;
  /* 重設 BS5 button 預設 */
  font-family: inherit;
  line-height: 1.4;
}

.spec-btn:hover:not(.spec-btn-oos) {
  border-color: #CDA565;
  color: #96763C;
}

.spec-btn.selected {
  border-color: #CDA565;
  background: #CDA565;
  color: #fff;
  font-weight: 600;
}

.spec-btn.spec-btn-oos {
  opacity: .4;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Quantity Control */
.qty-control {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--prod-border);
  border-radius: var(--prod-radius-sm);
  overflow: hidden;
  width: fit-content;
}

.qty-control button {
  width: 38px;
  height: 38px;
  border: none;
  background: #f5f5f5;
  color: #555;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background var(--prod-trans);
  flex-shrink: 0;
  /* 重設 BS5 button 樣式 */
  padding: 0;
  line-height: 1;
  font-family: inherit;
}

.qty-control button:hover {
  background: #eee;
}

/* 避免與 BS5 .form-control 衝突 */
.qty-control .qty-input {
  width: 56px;
  height: 38px;
  border: none;
  border-left: 1.5px solid var(--prod-border);
  border-right: 1.5px solid var(--prod-border);
  text-align: center;
  font-size: .95rem;
  font-weight: 600;
  color: var(--prod-primary);
  outline: none;
  box-shadow: none !important;
  appearance: textfield;
  -moz-appearance: textfield;
}

.qty-control .qty-input:focus {
  border-color: #96763C;
  outline: none;
}

.qty-control .qty-input::-webkit-outer-spin-button,
.qty-control .qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

/* Add to Cart Button — 次要按鈕規範 外框 #dbdbdb，白底，文字 #2B2B2B，Hover #4b88c7 */
.btn-add-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: #ffffff;
  color: var(--prod-primary) !important;
  border: 1px solid var(--prod-border);
  border-radius: var(--prod-radius-sm);
  padding: .75rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background var(--prod-trans), border-color var(--prod-trans), color var(--prod-trans), transform .15s, box-shadow var(--prod-trans);
  width: 100%;
  margin-top: 1rem;
  font-family: inherit;
  line-height: 1.4;
  text-decoration: none;
}

.btn-add-cart:hover:not(:disabled) {
  background: #4b88c7;
  border-color: #4b88c7;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(75, 136, 199, .35);
  text-decoration: none;
}

.btn-add-cart:disabled {
  background: #e9ecef;
  border-color: #dbdbdb;
  color: #aaa !important;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Continue Shopping / Secondary Action Button */
.btn-continue-shop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: #ffffff;
  color: var(--prod-primary) !important;
  border: 1px solid var(--prod-border);
  border-radius: var(--prod-radius-sm);
  padding: .65rem 1.25rem;
  font-size: .88rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--prod-trans);
  text-decoration: none !important;
  line-height: 1.4;
  font-family: inherit;
}

.btn-continue-shop:hover {
  border-color: #4b88c7;
  background: #4b88c7;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(75, 136, 199, .35);
  transform: translateY(-1px);
}

/* Clear Cart Button */
.btn-clear-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: #ffffff;
  color: #c0392b !important;
  border: 1px solid var(--prod-border);
  border-radius: var(--prod-radius-sm);
  padding: .65rem 1.25rem;
  font-size: .88rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--prod-trans);
  text-decoration: none !important;
  line-height: 1.4;
  font-family: inherit;
}

.btn-clear-cart:hover {
  border-color: #c0392b;
  background: #c0392b;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(192, 57, 43, .25);
  transform: translateY(-1px);
}

/* Cart Success Toast */
.cart-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #222;
  color: #fff;
  padding: 1rem 1.4rem;
  border-radius: var(--prod-radius-sm);
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  z-index: 1000060;
  box-shadow: var(--prod-shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all .4s cubic-bezier(.25, .8, .25, 1);
}

.cart-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.cart-toast .toast-icon {
  color: #CDA565;
  font-size: 1.1rem;
}

/* Product Description Tabs — 與 BS5 .nav-tabs 分開 */
.prod-tab-nav {
  display: flex;
  border-bottom: 2px solid var(--prod-border);
  margin: 2.5rem 0 1.5rem;
}

.prod-tab-btn {
  padding: .7rem 1.5rem;
  font-size: .9rem;
  font-weight: 600;
  color: #888;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: color var(--prod-trans);
  font-family: inherit;
  line-height: 1.4;
}

.prod-tab-btn:hover {
  color: #96763C;
}

.prod-tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #CDA565;
  transition: width var(--prod-trans);
}

.prod-tab-btn.active {
  color: #B08E4E;
}

.prod-tab-btn.active::after {
  width: 100%;
}

.prod-tab-content {
  display: none;
}

.prod-tab-content.active {
  display: block;
  animation: prodFadeIn .35s ease;
}

@keyframes prodFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.prod-desc-body {
  font-size: .93rem;
  line-height: 1.9;
  color: #444;
}

.prod-desc-body img {
  max-width: 100%;
  border-radius: 8px;
}

/* ─── Cart Page ────────────────────────────────────── */
.cart-wrap {
  font-family: 'Noto Sans TC', sans-serif;
}

/* 使用 .prod-cart-table 避免與任何全站 table 樣式衝突 */
.prod-cart-table {
  background: #fff;
  border-radius: var(--prod-radius);
  box-shadow: var(--prod-shadow);
  overflow: hidden;
  border: 1px solid var(--prod-border);
}

.prod-cart-table table {
  width: 100%;
  border-collapse: collapse;
  /* 重設 BS5 table 樣式 */
  --bs-table-bg: transparent;
  --bs-table-accent-bg: transparent;
}

.prod-cart-table thead th {
  padding: 1rem 1.2rem;
  background: #f9f9f7;
  font-size: .8rem;
  font-weight: 700;
  color: #888;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--prod-border);
}

.prod-cart-table tbody td {
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--prod-border);
  vertical-align: middle;
  font-size: .9rem;
  /* 清除 BS5 .table tbody td 邊框 */
  border-top: none;
}

.prod-cart-table tbody tr:last-child td {
  border-bottom: none;
}

.prod-cart-table .cart-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  background: #f4f4f4;
}

.prod-cart-table .cart-prod-name {
  font-weight: 600;
  color: var(--prod-primary);
  margin-bottom: .25rem;
  font-size: .9rem;
}

.prod-cart-table .cart-spec {
  font-size: .78rem;
  color: #999;
}

/* Cart Qty Control */
.cart-qty-ctrl {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--prod-border);
  border-radius: var(--prod-radius-sm);
  overflow: hidden;
  width: 110px;
}

.cart-qty-ctrl button {
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f5f5;
  color: #666;
  font-size: .95rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}

.cart-qty-ctrl button:hover {
  background: #eee;
}

.cart-qty-ctrl .cart-qty-input {
  width: 46px;
  height: 32px;
  border: none;
  border-left: 1.5px solid var(--prod-border);
  border-right: 1.5px solid var(--prod-border);
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  outline: none;
  box-shadow: none !important;
  appearance: textfield;
  -moz-appearance: textfield;
}

.cart-qty-ctrl .cart-qty-input:focus {
  border-color: #96763C;
}

.btn-cart-remove {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color var(--prod-trans);
  padding: .25rem;
  line-height: 1;
}

.btn-cart-remove:hover {
  color: #c0392b;
}

.cart-price-cell {
  font-weight: 600;
  color: #B08E4E;
  font-size: .95rem;
}

/* Cart Summary */
.cart-summary-card {
  background: #fff;
  border-radius: var(--prod-radius);
  box-shadow: var(--prod-shadow);
  border: 1px solid var(--prod-border);
  padding: 1.5rem;
}

.cart-summary-card h5 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--prod-primary);
  margin-bottom: 1.2rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--prod-border);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
  color: #666;
  margin-bottom: .6rem;
}

.cart-summary-row.total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--prod-primary);
  margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px solid var(--prod-border);
}

.cart-summary-row.total .total-price {
  color: #B08E4E;
  font-size: 1.4rem;
}

/* 主要按鈕（Primary CTA）：預設 #B08E4E，Hover #96763C */
.btn-checkout {
  display: block;
  width: 100%;
  background: #B08E4E;
  color: #fff !important;
  border: none;
  border-radius: var(--prod-radius-sm);
  padding: .9rem;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  margin-top: 1.2rem;
  transition: background var(--prod-trans), transform .15s, box-shadow var(--prod-trans);
  text-decoration: none;
  font-family: inherit;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(176, 142, 78, 0.25);
}

.btn-checkout:hover {
  background: #96763C;
  color: #fff !important;
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(150, 118, 60, 0.35);
}

.cart-empty-state {
  text-align: center;
  padding: 5rem 2rem;
}

.cart-empty-state .empty-icon {
  font-size: 4rem;
  color: #ddd;
  margin-bottom: 1rem;
}

.cart-empty-state h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #aaa;
  margin-bottom: .5rem;
}

.cart-empty-state p {
  font-size: .9rem;
  color: #bbb;
}

/* Cart Floating Button — 遵循品牌四大標準色與 z-index 規範 */
.cart-float-btn {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 56px;
  height: 56px;
  background-color: #B08E4E;
  color: #fff !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 6px 20px rgba(176, 142, 78, 0.4);
  z-index: 1050;
  /* 與 BS5 fixed-top 同層，低於 modal (1055+) */
  text-decoration: none;
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cart-float-btn:hover {
  background-color: #96763C;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 24px rgba(150, 118, 60, 0.5);
  color: #fff !important;
  text-decoration: none;
}

.cart-float-btn:active {
  transform: translateY(0) scale(1.02);
  box-shadow: 0 4px 12px rgba(150, 118, 60, 0.4);
}

.cart-float-btn .cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: #96763C;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 767px) {
  .prod-info-panel {
    padding: 1rem 0 0;
  }

  .prod-cart-table thead {
    display: none;
  }

  .prod-cart-table tbody td {
    display: block;
    padding: .6rem 1rem;
  }

  .prod-cart-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: .75rem;
    color: #aaa;
    margin-bottom: .2rem;
  }

  .prod-cart-table tbody tr {
    border-bottom: 2px solid var(--prod-border);
    display: block;
    padding: .5rem 0;
  }

  .cart-float-btn {
    bottom: 68px !important;
    right: 16px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 1.15rem !important;
  }
}

/* ─── Brand Introduction Card (品牌介紹) ──────────── */
.brand-intro-box {
  background: #ffffff;
  border: 1px solid var(--prod-border);
  border-radius: var(--prod-radius-sm);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.brand-intro-header {
  border-bottom: 1px solid #f1f3f5;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
}

.brand-intro-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: #f0f7ff;
  color: #4b88c7;
  font-size: 1rem;
  margin-right: 0.75rem;
}

.brand-intro-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2B2B2B;
}

.brand-intro-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background-color: #f8f9fa;
  color: #4b88c7;
  border: 1px solid #e1e9f4;
}

.brand-intro-wrapper {
  position: relative;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.brand-intro-wrapper.is-collapsed {
  max-height: 180px;
}

.brand-intro-wrapper.is-collapsed .brand-intro-fade {
  display: block;
}

.brand-intro-fade {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  pointer-events: none;
}

.brand-intro-body {
  font-size: 0.93rem;
  color: #2B2B2B;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: break-word;
}

.brand-intro-body p {
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.brand-intro-box a {
  color: #4b88c7;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.brand-intro-box a:hover {
  color: #366ea8;
  text-decoration: underline;
}

.brand-intro-body p:last-child {
  margin-bottom: 0;
}

.brand-intro-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 0.5rem 0;
}

.brand-intro-body table {
  width: 100%;
  max-width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
}

.brand-intro-body table th,
.brand-intro-body table td {
  border: 1px solid #dbdbdb;
  padding: 0.5rem 0.75rem;
}

.brand-intro-toggle-wrap {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
}

.btn-brand-toggle {
  background: #f8f9fa;
  border: 1px solid #dbdbdb;
  color: #2B2B2B;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 1.1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
}

.btn-brand-toggle:hover {
  background: #f0f4f8;
  color: #4b88c7;
  border-color: #4b88c7;
}