/* ========================================
   Product List – ISHOON 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;
  background: linear-gradient(90deg, #eeb65a 0%, #efbf82 48%, #f2c8a6 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;
}

/* ---------- 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-image: url('../images/product-list/product-list-content-background.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  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 #152042;
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 13px;
  font-weight: 400;
  line-height: normal;
  color: #152042;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.products-category-btn.is-active {
  background: #152042;
  border-color: #152042;
  color: #fff;
}

.products-category-btn:hover {
  opacity: 1;
  border-color: #152042;
}

.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: #d77350;
  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 #5a8a94; /* 截圖中的藍綠色細邊框 */
  border-radius: 8px; /* 截圖中的圓角樣式 */
  color: #5a8a94; /* 截圖中的藍綠色文字 */
  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: #5a8a94;
}

.products-sort__trigger:focus {
  outline: none;
  border-color: #5a8a94;
  box-shadow: 0 0 0 2px rgba(90, 138, 148, 0.24);
}

.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: #5a8a94;
  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: 4px;
  
  /* 覆寫 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: 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: transparent;
}

.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 徽章：精緻正圓形 */
.product-card__badge--top {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #152042;
}

.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: #81895b;
}

.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 {
  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: #152042;
  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 {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 18px;
  font-weight: 700;
  line-height: normal;
  color: #152042;
  margin: auto 0 0;
}

.product-card__price-current {
  color: #152042;
}

.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 #152042;
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 12px;
  line-height: normal;
  color: #152042;
  transition: background 0.2s ease, color 0.2s ease;
}

.products-pagination__item.is-active {
  background: #152042;
  border-color: #152042;
  color: #fff;
  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(21, 32, 66, 0.12);
}

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

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

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

  .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;
}
