/* ═══════════════════════════════════════════════════════════════
   BEST SELLERS Section - 全屏铺开响应式
   ═══════════════════════════════════════════════════════════════ */

.box_18 {
  /* 暖近白：亮，跟暗 Hero 拉开、也跟下方第3块米色 #ebe9e4 区分（白卡靠下方加强的描边/阴影浮起）*/
  background-color: #faf9f6;
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 53px 0 80px;
  box-sizing: border-box;
}

/* 顶部标签 "— BEST SELLERS —" */
.text_134 {
  color: rgba(188, 153, 75, 1);
  font-size: 14px;
  letter-spacing: 4px;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  white-space: nowrap;
  line-height: 22px;
  margin: 0 0 0 calc((100vw - 1180px) / 2);
  max-width: var(--content-max, 1280px);
}

/* 标题和筛选器容器 */
.group_42 {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  max-width: var(--content-max, 1280px);
  width: 100%;
  margin: 32px auto 0;
  padding: 0 20px;
  box-sizing: border-box;
}

/* 主标题 "Loved by pet - trusted parents." */
.paragraph_16 {
  color: rgba(25, 42, 68, 1);
  font-size: 46px;
  font-family: 'Merriweather', serif;
  font-weight: 900;
  text-align: left;
  line-height: 58px;
  max-width: 580px;
}

/* 分类筛选器容器 */
.group_16 {
  background-color: rgba(239, 232, 218, 1);
  border-radius: 4px;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 12px;
  margin-top: 67px;
}

/* ── 分类筛选按钮(由后台产品分类动态生成) ── */
.section_13 { flex-wrap: wrap; row-gap: 6px; }
.bs-filter {
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: none;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  color: rgba(188, 153, 75, 1);
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  white-space: nowrap;
  line-height: 16px;
  transition: background-color .25s, color .25s;
}
.bs-filter:hover { color: rgba(25, 42, 68, 1); }
.bs-filter.is-active { background-color: rgba(188, 153, 75, 1); color: #fff; }

.section_13 {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* 筛选器按钮 - 默认状态 */
.text-wrapper_46,
.text-wrapper_47,
.text-wrapper_48,
.text-wrapper_49 {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  cursor: pointer;
  transition: background-color 0.3s;
}

/* 筛选器按钮 - 激活状态 (ALL) */
.text-wrapper_45 {
  background-color: rgba(188, 153, 75, 1);
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  cursor: pointer;
}

.text_135 {
  color: rgba(255, 255, 255, 1);
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  white-space: nowrap;
  line-height: 16px;
}

.text_136,
.text_137,
.text_138,
.text_139 {
  color: rgba(188, 153, 75, 1);
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  line-height: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   响应式头部微调（覆盖上方固定值）
   ═══════════════════════════════════════════════════════════════ */
.box_18 {
  padding: clamp(40px, 6vw, 60px) 0 clamp(50px, 7vw, 80px);
  justify-content: center;
}

/* 顶部标签用居中容器代替 calc 边距，窄屏不再溢出 */
.text_134 {
  margin: 0 auto;
  max-width: var(--content-max, 1280px);
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

.paragraph_16 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.22;
}

/* ═══════════════════════════════════════════════════════════════
   产品卡片网格（自适应）
   ═══════════════════════════════════════════════════════════════ */
.pgrid {
  max-width: var(--content-max, 1280px);
  width: 100%;
  margin: clamp(36px, 5vw, 64px) auto 0;
  padding: 0 20px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 1.6vw, 24px);
}

/* ───────── 单张产品卡片（组件） ───────── */
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(25, 42, 68, 0.12);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(25, 42, 68, 0.09);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s ease,
              border-color 0.3s ease;
}

.pcard:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 34px rgba(25, 42, 68, 0.16);
}

.pcard:focus-visible {
  outline: 2px solid #bc994b;
  outline-offset: 2px;
}

/* 图片区 */
.pcard__media {
  position: relative;
  background: #f1f1f3;
  aspect-ratio: 1 / 0.92;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;              /* 去内边距,让图铺满矩形边到边 */
  box-sizing: border-box;
  overflow: hidden;
}

.pcard__img {
  width: 100%;             /* 铺满整个图片区 */
  height: 100%;
  object-fit: cover;       /* 填满并按需裁切(替代原 contain 的居中留白) */
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.pcard:hover .pcard__img { transform: scale(1.06); }

/* BEST SELLER 角标 */
.pcard__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #5c7a9c;
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 2px;
}

/* 内容区 */
.pcard__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 18px 20px 20px;
  transition: background-color 0.35s ease;
}

.pcard__cat {
  color: rgba(25, 42, 68, 0.55);
  font-family: 'Roboto', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.2;
}

.pcard__title {
  margin: 2px 0 0;
  color: #192a44;
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.3;
}

.pcard__desc {
  margin: 0;
  color: rgba(25, 42, 68, 0.6);
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.pcard__foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pcard__price {
  color: #192a44;
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}

/* 右侧加号按钮 */
.pcard__add {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(188, 153, 75, 0.7);
  background: #fff;
  color: #bc994b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, transform 0.3s, border-color 0.3s;
}

.pcard__plus {
  display: block;
  font-size: 24px;
  line-height: 1;
  margin-top: -2px;
}

.pcard__add:hover {
  background: #bc994b;
  border-color: #bc994b;
  color: #fff;
  transform: scale(1.08);
}

.pcard__add:active { transform: scale(0.92); }

/* ───────── AJAX 加购反馈态（WooCommerce add-to-cart.js 加的 loading / added class）───────── */
/* loading：隐藏“+”，中间显示转圈 */
.pcard__add.loading {
  pointer-events: none;
  opacity: 0.75;
}
.pcard__add.loading .pcard__plus { visibility: hidden; }
.pcard__add.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(188, 153, 75, 0.3);
  border-top-color: #bc994b;
  border-radius: 50%;
  animation: pcard-add-spin 0.6s linear infinite;
}
/* added：变金色、隐藏“+”、显示对勾 */
.pcard__add.added {
  background: #bc994b;
  border-color: #bc994b;
  color: #fff;
}
.pcard__add.added .pcard__plus { display: none; }
.pcard__add.added::after {
  content: '\2713'; /* ✓ */
  font-size: 20px;
  line-height: 1;
}
@keyframes pcard-add-spin {
  to { transform: rotate(360deg); }
}
/* WooCommerce 成功后会自动在按钮后注入一个「View cart」链接；
   导航栏的 CART 徽标已实时更新，卡片内这个链接会撑乱底部行，故隐藏保持整洁。 */
.pcard__foot .added_to_cart { display: none !important; }

/* ───────── 选中状态（深色高亮） ───────── */
.pcard.is-selected {
  border-color: #16243f;
  box-shadow: 0 16px 34px rgba(25, 42, 68, 0.24);
}
.pcard.is-selected .pcard__body   { background: #16243f; }
.pcard.is-selected .pcard__cat    { color: rgba(255, 255, 255, 0.6); }
.pcard.is-selected .pcard__title  { color: #fff; }
.pcard.is-selected .pcard__desc   { color: rgba(255, 255, 255, 0.65); }
.pcard.is-selected .pcard__price  { color: #fff; }
.pcard.is-selected .pcard__add {
  background: #16243f;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.pcard.is-selected .pcard__add:hover {
  background: #bc994b;
  border-color: #bc994b;
}

/* ═══════════════════════════════════════════════════════════════
   入场动效
   ═══════════════════════════════════════════════════════════════ */
.js .box_18 [data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s ease,
              border-color 0.3s ease;
}
.box_18 [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 卡片逐张错峰 */
.box_18 .pgrid .pcard:nth-child(1) { transition-delay: 0.05s; }
.box_18 .pgrid .pcard:nth-child(2) { transition-delay: 0.13s; }
.box_18 .pgrid .pcard:nth-child(3) { transition-delay: 0.21s; }
.box_18 .pgrid .pcard:nth-child(4) { transition-delay: 0.29s; }
.box_18 .pgrid .pcard:hover { transition-delay: 0s; }

/* 卡片内文字逐层入场 */
.js .box_18 .pcard .pcard__cat,
.js .box_18 .pcard .pcard__title,
.js .box_18 .pcard .pcard__desc,
.js .box_18 .pcard .pcard__foot {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.box_18 .pcard.is-visible .pcard__cat   { opacity: 1; transform: translateY(0); transition-delay: 0.14s; }
.box_18 .pcard.is-visible .pcard__title { opacity: 1; transform: translateY(0); transition-delay: 0.22s; }
.box_18 .pcard.is-visible .pcard__desc  { opacity: 1; transform: translateY(0); transition-delay: 0.30s; }
.box_18 .pcard.is-visible .pcard__foot  { opacity: 1; transform: translateY(0); transition-delay: 0.38s; }
.box_18 .pcard:hover .pcard__cat,
.box_18 .pcard:hover .pcard__title,
.box_18 .pcard:hover .pcard__desc,
.box_18 .pcard:hover .pcard__foot { transition-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  .box_18 [data-reveal],
  .box_18 .pcard__cat,
  .box_18 .pcard__title,
  .box_18 .pcard__desc,
  .box_18 .pcard__foot {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   响应式断点
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .box_18 { justify-content: flex-start; }

  .pgrid { grid-template-columns: repeat(2, 1fr); }

  .group_42 {
    flex-direction: column;
    gap: 24px;
  }
  .group_16 { margin-top: 8px; }
}

@media (max-width: 768px) {
  .pgrid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .text_134 { text-align: left; }

  .group_16 {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .section_13 { justify-content: flex-start; }

  .pcard__media { aspect-ratio: 1 / 0.62; }
}

@media (max-width: 480px) {
  .pcard__media { aspect-ratio: 1 / 0.78; }
}
