/* ============================================================
   LINENWEAR — PRODUCT Stylesheet
   产品展示区样式（New Arrivals 页面专属）
   基线: 1440px → 流体缩放 via clamp() & viewport units
   ============================================================ */

/* ---------- Hero: Breadcrumb + Title + Description ---------- */
.new-arrivals-hero {
  background-color: var(--color-cream);
}

.new-arrivals-hero__inner {
  max-width: var(--section-max-width);
  margin: 0 auto;
  padding: clamp(40px, 4.24vw, 61px) var(--section-padding-x) clamp(20px, 2.22vw, 32px);
  text-align: center;
}

.new-arrivals-hero__breadcrumb {
  text-align: left;
  font-size: clamp(12px, 0.97vw, 14px);
  font-weight: 200;
  letter-spacing: 0.025em;
  color: var(--color-dark-text);
  margin-bottom: clamp(40px, 4.65vw, 67px);
}

.new-arrivals-hero__breadcrumb a {
  transition: opacity var(--transition-default);
}

.new-arrivals-hero__breadcrumb a:hover {
  opacity: 0.7;
}

.new-arrivals-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 500;
  letter-spacing: 0.015em;
  color: var(--color-terracotta);
  margin-bottom: clamp(16px, 1.74vw, 25px);
}

.new-arrivals-hero__desc {
  font-size: clamp(13px, 1.11vw, 16px);
  font-weight: 400;
  color: #2F3E46;
  max-width: 1440px;
  margin: 0 auto clamp(16px, 1.74vw, 25px);
  line-height: 1.7;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  background-color: #D8D1C6;
  padding: 0 var(--section-padding-x);
}

.filter-bar__container {
  max-width: var(--section-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(56px, 5.21vw, 75px);
}

.filter-bar__filters {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.25vw, 18px);
  flex-wrap: wrap;
}

.filter-bar__icon {
  width: clamp(16px, 1.39vw, 20px);
  height: auto;
  flex-shrink: 0;
}

.filter-bar__label {
  font-size: clamp(12px, 0.97vw, 14px);
  font-weight: 400;
  color: var(--color-dark-red);
  white-space: nowrap;
}

.filter-bar__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  font-size: clamp(12px, 0.97vw, 14px);
  font-weight: 400;
  color: var(--color-dark-red);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition-default);
}

.filter-bar__chip:hover {
  opacity: 0.7;
}

.filter-bar__chevron {
  width: clamp(10px, 0.97vw, 14px);
  height: auto;
}

/* ---------- Filter Dropdown Panels ---------- */
.filter-bar__dropdown-wrapper {
  position: relative;
}

.filter-bar__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  min-width: 180px;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #D8D1C6;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 8px 0;
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.filter-bar__dropdown--open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.filter-bar__dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-dark-text);
  cursor: pointer;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.filter-bar__dropdown-option:hover {
  background-color: #F7F4EF;
}

.filter-bar__checkbox,
.filter-bar__radio {
  accent-color: var(--color-dark-red);
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.filter-bar__dropdown-empty-text {
  display: block;
  padding: 12px 14px;
  font-size: 12px;
  color: #999;
  text-align: center;
}

/* ---------- Price Range Inputs (Custom) ---------- */
.filter-bar__dropdown--price {
  min-width: 240px;
  padding: 14px 16px;
}

.filter-bar__price-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-bar__price-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.filter-bar__price-label {
  font-size: 11px;
  font-weight: 400;
  color: #9A8E7E;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-bar__price-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #D8D1C6;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.filter-bar__price-currency {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  font-size: 13px;
  color: #9A8E7E;
  background: #F7F4EF;
  border-right: 1px solid #D8D1C6;
  flex-shrink: 0;
  align-self: stretch;
  padding: 6px 0;
}

.filter-bar__price-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 400;
  font-family: inherit;
  color: var(--color-dark-text);
  min-width: 0;
  -moz-appearance: textfield;
}

.filter-bar__price-input::-webkit-outer-spin-button,
.filter-bar__price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.filter-bar__price-input::placeholder {
  color: #C2B8A8;
}

.filter-bar__price-input:focus {
  box-shadow: 0 0 0 2px rgba(139, 61, 45, 0.15);
}

.filter-bar__price-sep {
  font-size: 14px;
  color: #9A8E7E;
  padding-bottom: 8px;
  flex-shrink: 0;
}

.filter-bar__price-actions {
  display: flex;
  gap: 8px;
}

.filter-bar__price-apply,
.filter-bar__price-clear {
  flex: 1;
  padding: 7px 0;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: opacity var(--transition-default);
}

.filter-bar__price-apply {
  background-color: var(--color-dark-red);
  color: #fff;
}

.filter-bar__price-apply:hover {
  opacity: 0.85;
}

.filter-bar__price-clear {
  background-color: transparent;
  color: #9A8E7E;
  border: 1px solid #D8D1C6;
}

.filter-bar__price-clear:hover {
  background-color: #F7F4EF;
  color: var(--color-dark-text);
}

/* ---------- Sort Dropdown ---------- */
.filter-bar__sort-wrapper {
  position: relative;
  flex-shrink: 0;
}

.filter-bar__sort-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-dark-red);
  -webkit-tap-highlight-color: transparent;
}

.filter-bar__sort-btn:hover {
  opacity: 0.7;
}

.filter-bar__sort-label {
  font-size: clamp(12px, 0.97vw, 14px);
  font-weight: 400;
  color: var(--color-dark-red);
  white-space: nowrap;
}

.filter-bar__sort-icon {
  width: clamp(10px, 0.97vw, 14px);
  height: auto;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.filter-bar__sort-btn[aria-expanded="true"] .filter-bar__sort-icon {
  transform: rotate(180deg);
}

.filter-bar__sort-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  min-width: 190px;
  background: #fff;
  border: 1px solid #D8D1C6;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 8px 0;
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.filter-bar__sort-dropdown--open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Chevron rotation when dropdown is open */
.filter-bar__chip[aria-expanded="true"] .filter-bar__chevron {
  transform: rotate(180deg);
}

.filter-bar__chevron {
  width: clamp(10px, 0.97vw, 14px);
  height: auto;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

/* 旧样式 sort 区保留向后兼容 */
.filter-bar__sort {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filter-bar__sort-label {
  font-size: clamp(12px, 0.97vw, 14px);
  font-weight: 400;
  color: var(--color-dark-red);
  white-space: nowrap;
}

.filter-bar__sort-icon {
  width: clamp(10px, 0.97vw, 14px);
  height: auto;
}

/* ---------- Product Grid Section ---------- */
.product-grid-section {
  background-color: var(--color-cream);
  padding: clamp(24px, 2.78vw, 40px) 0 clamp(8px, 1.94vw, 28px);
}

/* ---------- Product Grid Container (AJAX target) ---------- */
.product-grid-container {
  transition: opacity 0.25s ease;
}

/* ---------- Product Grid Loader ---------- */
.product-grid-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  text-align: center;
}

.product-grid-loader__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #E8E0D3;
  border-top-color: var(--color-dark-red);
  border-radius: 50%;
  animation: product-grid-spin 0.7s linear infinite;
}

@keyframes product-grid-spin {
  to { transform: rotate(360deg); }
}

.product-grid-loader__text {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: #9A8E7E;
  letter-spacing: 0.03em;
}

/* ---------- Product Grid — 3 列表格布局 ---------- */
.product-grid {
  max-width: var(--section-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
}

/* 产品卡片之间竖线分隔（设计稿中的 0.5px 竖线） */
.product-grid__divider {
  /* 由 JS 或 PHP 动态插入，此样式备用 */
}

/* ---------- Product Card ---------- */
.product-card {
  position: relative;
  padding: 0 clamp(20px, 1.94vw, 28px) clamp(24px, 2.22vw, 32px);
  display: flex;
  flex-direction: column;
  /* 滚动逐行显现：初始隐藏，JS 触发后渐显 */
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* IntersectionObserver 触发后显现 */
.product-card--revealed {
  opacity: 1;
  transform: translateY(0);
}

/* IntersectionObserver 不支持时直接显示 */
.product-card--fallback {
  opacity: 1;
  transform: none;
}

/* 非第一列添加左侧竖线 */
.product-grid:not([style*="--grid-columns: 1"]) .product-card:not(:nth-child(3n+1)) {
  /*border-left: 0.5px solid var(--color-dark-red);*/
}

/* 第 2 行开始添加上横线 */
.product-card:nth-child(n+4) {
  /*border-top: 0.5px solid var(--color-dark-red);*/
}

.product-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.product-card__image-wrapper {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: clamp(16px, 1.39vw, 20px);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
}

/* 悬停图：叠在主图上方，默认透明 */
.product-card__image--hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.5s ease;
}

/* 悬停时：主图透明，悬停图显现 */
.product-card:hover .product-card__image:not(.product-card__image--hover) {
  opacity: 0;
}

.product-card:hover .product-card__image--hover {
  opacity: 1;
  filter: blur(0);
  transform: scale(1.03);
}

.product-card__name {
  font-size: clamp(14px, 1.11vw, 16px);
  font-weight: 700;
  color: var(--color-dark-text);
  margin-bottom: clamp(8px, 0.69vw, 10px);
  line-height: 1.4;
}

.product-card__name a {
  text-decoration: none;
  color: inherit;
  transition: opacity var(--transition-default);
}

.product-card__name a:hover {
  opacity: 0.7;
}

.product-card__price {
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 600;
  margin-bottom: clamp(10px, 0.83vw, 12px);
  line-height: 1.2;
}

/* WooCommerce 默认价格样式覆盖 */
.product-card__price del {
  color: rgba(47, 62, 70, 0.50);
  font-weight: 600;
  margin-right: 4px;
}

.product-card__price ins {
  text-decoration: none;
  color: var(--color-dark-red);
  font-weight: 600;
}

.product-card__price .amount {
  color: inherit;
  font-weight: inherit;
}

.product-card__price del .amount {
  color: rgba(47, 62, 70, 0.50);
}

/* ---------- Color Swatches ---------- */
.product-card__colors {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.76vw, 11px);
  flex-wrap: wrap;
}

.product-card__colors-label {
  font-size: clamp(13px, 1.11vw, 16px);
  font-weight: 400;
  color: var(--color-dark-text);
}

.product-card__color-swatch {
  width: clamp(24px, 3.33vw, 32.25px);
  height: clamp(24px, 3.33vw, 32.25px);
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: inline-block;
  flex-shrink: 0;
  box-sizing: content-box;
}

/* ---------- Product Area Notices ---------- */
.product-grid__empty,
.product-grid__notice {
  max-width: var(--section-max-width);
  margin: 0 auto;
  padding: clamp(40px, 5.56vw, 80px) var(--section-padding-x);
  text-align: center;
  font-size: clamp(14px, 1.11vw, 16px);
  color: var(--color-dark-text);
}

/* ---------- Pagination ---------- */
.new-arrivals-pagination {
  background-color: #E8E0D3;
  padding: 0 var(--section-padding-x);
}

.new-arrivals-pagination__inner {
  max-width: var(--section-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 0.56vw, 8px);
  height: clamp(56px, 5.21vw, 75px);
}

.new-arrivals-pagination__page {
  font-size: clamp(13px, 0.97vw, 14px);
  font-weight: 400;
  color: var(--color-dark-text);
  cursor: pointer;
  background: none;
  border: 1.5px solid var(--color-dark-text);
  min-width: clamp(34px, 2.64vw, 38px);
  height: clamp(34px, 2.64vw, 38px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0 6px;
  line-height: 1;
  transition: background-color var(--transition-default),
              color var(--transition-default),
              border-color var(--transition-default);
}

.new-arrivals-pagination__page:hover {
  color: var(--color-dark-red);
  border-color: var(--color-dark-red);
}

.new-arrivals-pagination__page--active {
  font-weight: 600;
  color: #fff;
  background-color: var(--color-dark-text);
  border-color: var(--color-dark-text);
}

.new-arrivals-pagination__prev,
.new-arrivals-pagination__next {
  font-size: clamp(12px, 0.90vw, 13px);
  min-width: auto;
  padding: 0 clamp(10px, 0.83vw, 12px);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.new-arrivals-pagination__prev:hover,
.new-arrivals-pagination__next:hover {
  color: var(--color-dark-red);
  border-color: var(--color-dark-red);
}

/* ============================================================
   RESPONSIVE — New Arrivals Page
   ============================================================ */

/* Tablet (768px - 1024px) */
@media screen and (max-width: 1024px) {

  /* 产品网格 — 2 列 */
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* 第 3 列竖线移除，改为第 2 列加竖线 */
  .product-card {
    border-left: none !important;
  }

  .product-card:nth-child(2n+2) {
    border-left: 0.5px solid var(--color-dark-red) !important;
  }

  .product-card:nth-child(n+4) {
    border-top: none;
  }

  .product-card:nth-child(n+3) {
    border-top: 0.5px solid var(--color-dark-red);
  }

  .product-card {
    padding: 0 clamp(16px, 2vw, 24px) clamp(20px, 2.5vw, 28px);
  }
}

/* Mobile (320px - 767px) */
@media screen and (max-width: 767px) {

  .new-arrivals-hero__inner {
    padding: 32px var(--section-padding-x) 20px;
  }

  .new-arrivals-hero__desc {
    font-size: 13px;
  }

  /* Filter Bar — 纵向堆叠 */
  .filter-bar__container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    height: auto;
    padding: 12px 0;
  }

  .filter-bar__filters {
    gap: 10px;
    flex-wrap: wrap;
  }

  /* 产品网格 — 1 列 */
  .product-grid {
    grid-template-columns: 1fr !important;
  }

  .product-card {
    border-left: none !important;
    padding: 0 var(--section-padding-x) 28px;
  }

  .product-card:nth-child(n+2) {
    border-top: 0.5px solid var(--color-dark-red);
    padding-top: 28px;
  }

  .product-card__image-wrapper {
    max-width: 420px;
  }

  .new-arrivals-pagination__inner {
    gap: 16px;
    height: clamp(48px, 12vw, 64px);
  }
}

/* Small Mobile (320px - 480px) */
@media screen and (max-width: 480px) {

  .new-arrivals-hero__title {
    font-size: 22px;
  }

  .product-card__image-wrapper {
    max-width: 100%;
  }
}
