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

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

/* ---------- Breadcrumb ---------- */
.products-breadcrumb {
  background: var(--color-wants-cream);
}

.products-breadcrumb__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 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: #888;
  margin: 0;
  text-align: left;
}

/* ---------- 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 {
  background: var(--color-wants-dark);
  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 #d7ccc8;
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 13px;
  font-weight: 400;
  line-height: normal;
  color: #fff;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.products-category-btn.is-active {
  background: var(--color-wants-accent);
  border-color: var(--color-wants-accent);
}

.products-category-btn:hover {
  opacity: 1;
  border-color: var(--color-wants-cream);
}

.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: #fff;
  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 #ffffff; /* 截圖中的白色細邊框 */
  border-radius: 8px; /* 截圖中的圓角樣式 */
  color: #ffffff; /* 截圖中的白色文字 */
  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-cream, #d7ccc8);
}

.products-sort__trigger:focus {
  outline: none;
  border-color: var(--color-wants-gold, #877c55);
  box-shadow: 0 0 0 2px rgba(135, 124, 85, 0.3);
}

.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: #ffffff;
  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, 1fr);
  gap: 30px 18px;
  margin-bottom: 48px;
}

.product-card {
  min-width: 0;
  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: 16px;
  
  /* 覆寫 style.css 中的干擾樣式，消除卡片外圍白色圈與邊框 */
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

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

.product-card__inner {
  background: #fff;
  border: none; /* 移除外邊框，以符合截圖樣式 */
  border-radius: 16px; /* 大圓角樣式 */
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* 輕微的淡陰影 */
  transition: box-shadow 0.3s ease;
}

.product-card:hover .product-card__inner {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15); /* 懸停時精巧陰影加深 */
}

.product-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* 修改為與截圖一致的 1:1 正方形比例 */
  overflow: hidden;
  background: #f5f5f5;
}

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

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

.product-card__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.product-card__badge img {
  display: none; /* 隱藏原本的 SVG 背景，完全改用 CSS 自訂的實體圓形與膠囊形背景 */
}

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

/* TOP 徽章：精緻正圓形 */
.product-card__badge--top {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-wants-accent, #847d6b);
}

.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-brand-orange, #877c55);
}

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

/* 優惠徽章：膠囊形 */
.product-card__badge--sale {
  height: 24px;
  padding: 0 10px;
  border-radius: 20px;
  background: #c05c36; /* 溫和的紅褐色 */
}

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

.product-card__info {
  padding: 20px 22px 24px; /* 增大內距，符合 premium 呼吸感 */
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px; /* 文字間隙拉開，更顯精緻 */
}

.product-card__title {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-wants-dark);
  margin: 0;
}

.product-card__desc {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 13px;
  font-weight: 400;
  line-height: normal;
  color: var(--color-wants-accent);
  margin: 0;
}

.product-card__price {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  color: #877c55;
  margin: 8px 0 0 0; /* 與描述拉開呼吸感 */
}

.product-card__price-current {
  color: #877c55;
}

.product-card__price-original {
  font-size: 14px;
  font-weight: 400;
  color: #999;
  text-decoration: line-through;
  margin-left: 6px;
}

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

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

.products-pagination__item.is-active {
  background: #fff;
  border-color: #fff;
  color: #877c55;
  font-weight: 700;
}

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

.products-pagination__item:hover,
.products-pagination__next:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

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

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 16px;
  }
}

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

  .products-breadcrumb__inner {
    padding: 8px 45px;
  }

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

  .products-hero {
    height: 85px;
  }

  .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 #fff;
    border-radius: 999px;
    background: transparent;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 13px;
    line-height: 1;
  }

  .products-category-btn.is-active {
    background: transparent;
    border-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 {
    aspect-ratio: 1.08 / 1;
  }

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

  .product-card__badge {
    top: 12px;
    left: 7px;
    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 {
    gap: 6px;
    padding: 21px 16px 14px;
  }

  .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: 14px;
    line-height: 20px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .product-card__price {
    margin-top: 2px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 16px;
    line-height: 22px;
  }

  .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 #fff;
    border-radius: 50%;
    font-family: 'Georgia', 'Noto Sans TC', serif;
    font-size: clamp(11px, 3.2vw, 12px);
    font-weight: 400;
    line-height: 1;
  }

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

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

/* 覆寫全站固定 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;
}
