/* ========================================
   Product List – 迋斯生技 Figma 產品選購
   ======================================== */

.products-list-main {
  margin-top: var(--header-height);
  background: var(--color-wants-dark);
}

/* ---------- Breadcrumb ---------- */
.products-breadcrumb {
  min-height: 52px;
  padding: 0;
  display: flex;
  align-items: center;
  /*
   * 原本是 RoRich 的橘金漸層（#eeb65a → #f2c8a6），三個色值都不在配色表裡。
   * 改由次色（中性灰）推導：左側原色，向右混白變淡，設計稿是這個灰階效果。
   */
  background: linear-gradient(
    90deg,
    var(--color-wants-accent, #808080) 0%,
    color-mix(in srgb, var(--color-wants-accent, #808080) 82%, #fff) 48%,
    color-mix(in srgb, var(--color-wants-accent, #808080) 58%, #fff) 100%
  );
}

.products-breadcrumb__inner {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 52px;
  padding: 0 20px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100% !important; /* 撐滿 1200px 限制區域，以實現麵包屑與 LOGO 完美對齊 */
}

.products-breadcrumb__text {
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  color: #fff;
  margin: 0;
  text-align: left;
}

.products-breadcrumb__text a {
  display: inline-block;
  color: #fff;
  text-decoration: none;
}

.products-breadcrumb__text a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.products-breadcrumb__separator {
  margin: 0 2px;
}

/* ---------- Hero ---------- */
.products-hero {
  position: relative;
  width: 100%;
  height: 100px;
  overflow: hidden;
  margin-bottom: 0; /* 移除下方外距，消除白色空白區塊 */
}

.products-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.products-hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  z-index: 1;
}

.products-hero__title {
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 26px;
  font-weight: 400;
  line-height: normal;
  color: #fff;
  margin: 0;
}

.products-hero__subtitle {
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  color: var(--color-wants-cream);
  margin: 0;
}

/* ---------- Body / Container ---------- */
.products-body {
  /*
   * 原本鋪 product-list-content-background.png ——那是淡化的 RoRich 商品照，
   * 包裝上的品牌字樣看得出來，等於在自家頁面掛別人的商標。設計稿這一區是純白底。
   *
   * 要放回背景圖的話用「外觀 → 自訂 → 頁面區塊背景 → 商品列表 → 商品格線區」，
   * 不要再寫死在這裡。
   */
  background-color: var(--color-wants-cream, #ffffff);
  padding: 23px 0 80px;
}

.products-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Filter Bar ---------- */
.products-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.products-categories {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
}

.products-category-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 35px;
  padding: 10px 24px;
  border-radius: 60px;
  border: 1px solid var(--color-wants-gold, #987b4f);
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 13px;
  font-weight: 400;
  line-height: normal;
  color: var(--color-wants-gold, #987b4f);
  white-space: nowrap;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.products-category-btn.is-active {
  background: var(--color-wants-gold, #987b4f);
  border-color: var(--color-wants-gold, #987b4f);
  color: #fff;
}

.products-category-btn:hover {
  opacity: 1;
  border-color: var(--color-wants-gold, #987b4f);
}

.products-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.products-sort__label {
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-wants-accent, #808080);
  white-space: nowrap;
}

/* 自定義下拉選單外層 */
.products-sort__custom-select {
  position: relative;
  min-width: 140px;
  font-family: "Georgia", "Noto Sans TC", serif;
}

/* 觸發按鈕 */
.products-sort__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 35px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--color-wants-accent, #808080); /* 截圖中的藍綠色細邊框 */
  border-radius: 8px; /* 截圖中的圓角樣式 */
  color: var(--color-wants-accent, #808080); /* 截圖中的藍綠色文字 */
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.products-sort__trigger:hover {
  border-color: var(--color-wants-accent, #808080);
}

.products-sort__trigger:focus {
  outline: none;
  border-color: var(--color-wants-accent, #808080);
  box-shadow: 0 0 0 2px
    color-mix(in srgb, var(--color-wants-accent) 24%, transparent);
}

.products-sort__selected-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  text-align: center; /* 讓文字稍微置中，更契合截圖的視覺感 */
}

.products-sort__arrow {
  font-size: 9px;
  color: var(--color-wants-accent, #808080);
  transition: transform 0.25s ease;
}

/* 當選單開啟時，箭頭旋轉動畫 */
.products-sort__custom-select.is-open .products-sort__arrow {
  transform: rotate(180deg);
}

/* 下拉選項清單 */
.products-sort__options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 100%;
  min-width: 150px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: rgba(36, 40, 38, 0.95); /* 深灰色背景，與主題 dark 相符 */
  backdrop-filter: blur(8px); /* 磨砂玻璃效果，顯得高階 */
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 100;

  /* 動畫初始狀態 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 0.25s cubic-bezier(0.25, 0.8, 0.25, 1),
    transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1),
    visibility 0.25s;
}

/* 當選單開啟時顯示選項 */
.products-sort__custom-select.is-open .products-sort__options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 下拉單個選項 */
.products-sort__option {
  padding: 10px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
  white-space: nowrap;
}

.products-sort__option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* 啟動中的選項 */
.products-sort__option.is-active {
  background: rgba(135, 124, 85, 0.2); /* 淡淡的金黃色背景 */
  color: var(--color-wants-gold, #c5a880); /* 金色/米色文字 */
  font-weight: 500;
}

/* ---------- Product Grid ---------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 352px));
  justify-content: center;
  gap: 45px 48px;
  margin-bottom: 48px;
}

.product-card {
  min-width: 0;
  width: 100%;
  max-width: 352px;
  transition:
    transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-radius: 10px;
  overflow: hidden;

  /* 設計稿是浮在白底上的白卡；!important 用來壓過 style.css 的舊卡片樣式 */
  background: #fff !important;
  padding: 0 !important;
  border: none !important;
  box-shadow:
    0 2px 6px rgba(58, 63, 59, 0.08),
    0 8px 24px rgba(58, 63, 59, 0.1) !important;
}

.product-card:hover {
  transform: translateY(-6px);
}

.product-card__inner {
  background: #fff;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  min-height: 381px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
  transition: box-shadow 0.3s ease;
}

.product-card:hover .product-card__inner {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.product-card__image-wrap {
  position: relative;
  width: 100%;
  height: 250px;
  flex: 0 0 250px;
  overflow: hidden;
  /* 商品去背照下方的淺灰襯底 */
  background: #f2f2f2;
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.016);
  transform-origin: center;
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.product-card:hover .product-card__image {
  transform: scale(1.06);
}

.product-card__badge {
  position: absolute;
  top: 13px;
  left: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: none;
}

.product-card__badge-text {
  position: relative;
  z-index: 1;
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 11px;
  font-weight: 700;
  line-height: normal;
  text-align: center;
  color: #fff;
  white-space: nowrap;
}

/* TOP 徽章：精緻正圓形。設計稿用主色紅，與首頁排行榜第 1 名一致 */
.product-card__badge--top {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-wants-orange, #a82022);
}

.product-card__badge--top .product-card__badge-text {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 新品徽章：精緻正圓形 */
.product-card__badge--new {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-wants-gold, #987b4f);
}

.product-card__badge--new .product-card__badge-text {
  color: #fff;
  font-weight: 700;
}

/* 優惠徽章：膠囊形 */
.product-card__badge--sale {
  height: 24px;
  padding: 0 10px;
  border-radius: 3px;
  /* 原本是 #c05c36，一個不在配色表裡的橘色，改吃強調色 */
  background: var(--color-wants-gold, #987b4f);
}

.product-card__badge--sale .product-card__badge-text {
  color: #fff;
  font-weight: 700;
}

.product-card__info {
  min-height: 131px;
  padding: 20px 20px 17px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card__title {
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: normal;
  color: var(--color-section-title, #7e7e7e);
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.product-card__desc {
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  color: #595757;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.product-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: normal;
  color: var(--color-wants-gold, #987b4f);
  margin: auto 0 0;
}

.product-card__price-current {
  color: var(--color-wants-gold, #987b4f);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.product-card__price-original {
  font-size: 14px;
  font-weight: 700;
  color: color-mix(in srgb, var(--color-wants-orange, #a82022) 45%, #fff);
  text-decoration: line-through;
  line-height: 1.2;
}

/* ---------- Pagination ---------- */
.products-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.products-pagination__item,
.products-pagination__prev,
.products-pagination__next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 30px;
  border: 1px solid var(--color-wants-gold, #987b4f);
  font-family: "Georgia", "Noto Sans TC", serif;
  font-size: 12px;
  line-height: normal;
  color: var(--color-wants-gold, #987b4f);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.products-pagination__item.is-active {
  background: var(--color-wants-gold, #987b4f);
  border-color: var(--color-wants-gold, #987b4f);
  color: #fff;
  font-weight: 700;
}

.products-pagination__prev,
.products-pagination__next {
  width: 70px;
  border-radius: 60px;
  font-weight: 400;
}

.products-pagination__item:hover,
.products-pagination__prev:hover,
.products-pagination__next:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--color-wants-gold) 12%, transparent);
}

.products-pagination__item.is-active:hover {
  background: var(--color-wants-gold, #987b4f);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 352px));
    gap: 32px 24px;
  }
}

@media (max-width: 768px) {
  .products-breadcrumb {
    min-height: 52px;
    padding: 0;
  }

  .products-breadcrumb__inner {
    min-height: 52px;
    padding: 0 45px;
  }

  .products-breadcrumb__text {
    font-family: "Noto Sans TC", sans-serif;
    font-size: 13px;
  }

  .products-hero {
    height: 70px;
  }

  .products-hero picture {
    display: block;
    width: 100%;
    height: 100%;
  }

  .products-hero__bg {
    object-position: center center;
  }

  .products-hero__content {
    gap: 3px;
  }

  .products-hero__title {
    font-family: "Noto Sans TC", sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 22px;
  }

  .products-hero__subtitle {
    font-family: "Noto Sans TC", sans-serif;
    font-size: 14px;
    line-height: 20px;
  }

  .products-body {
    padding: 35px 0 54px;
  }

  .products-container {
    max-width: none;
    padding: 0;
  }

  .products-filter-bar {
    display: block;
    margin-bottom: 33px;
  }

  .products-sort {
    display: none;
  }

  .products-categories {
    flex-wrap: nowrap;
    gap: 16px;
    width: 100%;
    padding: 0 16px 3px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .products-categories::-webkit-scrollbar {
    display: none;
  }

  .products-category-btn {
    flex: 0 0 auto;
    height: 31px;
    padding: 0 24px;
    border: 1px solid var(--color-wants-gold, #987b4f);
    border-radius: 999px;
    background: transparent;
    color: var(--color-wants-gold, #987b4f);
    font-family: "Noto Sans TC", sans-serif;
    font-size: 13px;
    line-height: 1;
  }

  .products-category-btn.is-active {
    background: var(--color-wants-gold, #987b4f);
    border-color: var(--color-wants-gold, #987b4f);
    color: #fff;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 14px;
    width: calc(100% - 76px);
    max-width: 362px;
    margin: 0 auto 46px;
  }

  .product-card {
    border-radius: 6px;
  }

  .product-card:hover {
    transform: none;
  }

  .product-card__inner {
    min-height: 0;
    border-radius: 6px;
    box-shadow: none;
  }

  .product-card:hover .product-card__inner {
    box-shadow: none;
  }

  .product-card__image-wrap {
    height: auto;
    flex: 0 0 auto;
    aspect-ratio: 352 / 250;
  }

  .product-card:hover .product-card__image {
    transform: scale(1.016);
  }

  .product-card__badge {
    top: 12px;
    left: 10px;
    box-shadow: none;
  }

  .product-card__badge--top {
    width: 35px;
    height: 35px;
  }

  .product-card__badge--new {
    width: auto;
    min-width: 35px;
    height: 24px;
    padding: 0 7px;
    border-radius: 4px;
  }

  .product-card__badge-text {
    font-size: 10px;
  }

  .product-card__badge--sale {
    height: 22px;
    padding: 0 8px;
  }

  .product-card__info {
    min-height: 116px;
    gap: 7px;
    padding: 17px 14px 13px;
  }

  .product-card__title {
    font-family: "Noto Sans TC", sans-serif;
    font-size: 16px;
    line-height: 22px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .product-card__desc {
    font-family: "Noto Sans TC", sans-serif;
    font-size: 13px;
    line-height: 18px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .product-card__price {
    margin-top: auto;
    gap: clamp(4px, 1.6vw, 6px);
    font-family: Georgia, "Noto Sans TC", serif;
    font-size: 16px;
    line-height: 1.2;
  }

  .product-card__price-current {
    font-size: clamp(15px, 4.1vw, 16px);
    font-weight: 700;
    color: var(--color-wants-gold, #987b4f);
  }

  .product-card__price-original {
    font-size: clamp(13px, 3.5vw, 14px);
    font-weight: 700;
    color: color-mix(in srgb, var(--color-wants-orange, #a82022) 45%, #fff);
    text-decoration: line-through;
  }

  .products-pagination {
    gap: clamp(7px, 2.1vw, 8px);
    padding: 0 20px;
  }

  .products-pagination__item,
  .products-pagination__prev,
  .products-pagination__next {
    width: clamp(20px, 5.5vw, 21px);
    height: clamp(20px, 5.5vw, 21px);
    flex: 0 0 auto;
    border: 1px solid var(--color-wants-gold, #987b4f);
    border-radius: 50%;
    font-family: "Georgia", "Noto Sans TC", serif;
    font-size: clamp(11px, 3.2vw, 12px);
    font-weight: 400;
    line-height: 1;
    color: var(--color-wants-gold, #987b4f);
  }

  .products-pagination__prev,
  .products-pagination__next {
    width: clamp(58px, 15.8vw, 60px);
    border-radius: 999px;
  }

  .products-pagination__item.is-active {
    color: #fff;
  }
}

/* 覆寫全站固定 1920px 寬度的 Header 樣式，確保在各螢幕尺寸下都以視窗寬度為基準置中 */
@media (min-width: 769px) {
  .site-header {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* 修正產品列表主容器背景色與內邊距，消除分頁與頁尾之間的白色空白區塊 */
#product-list-main {
  background: var(--color-wants-dark) !important;
  padding-bottom: 0 !important;
}
