/* ═══════════════════════════════════════════════════════════════
   URMYWO — Inquiry List（询价清单）+ 目录页响应式修正
   独立样式表：不改 style.css，出问题直接删本文件即可回滚
   ═══════════════════════════════════════════════════════════════ */

/* ─────────── 1. 「＋ Add to List」按钮（列表卡 / 首页卡） ─────────── */
.add-to-list {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
  border: 1.5px solid #1A2744;
  border-radius: 6px;
  background: #fff;
  color: #1A2744;
  transition: background .15s, color .15s, border-color .15s;
}
.add-to-list:hover { background: #1A2744; color: #fff; }
.add-to-list.added { background: #E8F5E9; border-color: #4CAF50; color: #2E7D32; }

/* ─────────── 2. 商品卡底部按钮组：修掉「Wholesale / Inquiry」两行挤压 ─────────── */
/* 卡片改为纵向 flex，操作区贴底 → 同一行卡片按钮基线对齐 */
.product-card { display: flex; flex-direction: column; }
.product-card > a { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.product-card > a .info { display: flex; flex-direction: column; flex: 1 1 auto; }
/* 标题 / 描述固定行数 → 卡片节奏一致、高度不参差 */
.product-card h3 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.7em; line-height: 1.35;
}
.product-card .info > p {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin-top: auto;
  padding-top: 12px;
}
.product-card .actions .inquiry-btn {
  flex: 1 1 116px;
  min-width: 0;
  white-space: nowrap;
  font-size: 12.5px;
  padding: 0 8px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.product-card .actions .add-to-list {
  flex: 1 1 104px;
  min-width: 0;
  height: 38px;
  padding: 0 8px;
}
.product-card .actions .view-link {
  flex: 1 1 100%;
  justify-content: center;
  padding: 8px 12px;
}
/* 手机端单列时压缩图片高度（contain 不裁切产品主体）+ 放大点击区 */
@media (max-width: 560px) {
  .catalog-layout .product-card .img-wrap { padding-bottom: 82%; }
  .catalog-layout .product-card .img-wrap img { object-fit: contain; padding: 10px; }
  .product-card .actions .inquiry-btn,
  .product-card .actions .add-to-list { height: 42px; }
}
/* 目录页带 240px 侧栏 → 主区仅 ~928px，4 列会挤成 217px 宽：桌面固定 3 列 */
@media (min-width: 981px) {
  .catalog-layout .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .catalog-layout .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .catalog-layout .product-grid { grid-template-columns: 1fr; }
}

/* ─────────── 3. 目录页响应式（修 240px 侧栏 + 网格导致的横向溢出） ─────────── */
.catalog-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.catalog-layout > * { min-width: 0; }
.catalog-sidebar { position: sticky; top: 100px; align-self: start; }
.catalog-toggle { display: none; }

@media (max-width: 980px) {
  .catalog-layout { display: block; }
  .catalog-sidebar {
    position: static;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px 14px;
  }
  .catalog-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #F7F9FC;
    border: 1px solid #e6ebf2;
    border-radius: 9px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #1A2744;
    cursor: pointer;
  }
  .catalog-toggle .chev { transition: transform .2s; font-size: 12px; color: #8b95a5; }
  .catalog-sidebar.open .catalog-toggle .chev { transform: rotate(180deg); }
  .catalog-sidebar-inner { display: none; margin-top: 14px; }
  .catalog-sidebar.open .catalog-sidebar-inner { display: block; }
}

/* ─────────── 4. 详情页 CTA 按钮组（统一高度 / 清晰层级 / 窄屏堆叠） ─────────── */
.pdp-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
/* 隐藏 Buy on Amazon 后重新收口：两个动作按钮同排等宽，PayPal 标整行置底 */
.pdp-cta .cta-btn,
.pdp-cta .add-to-list { flex: 1 1 190px; }
.pdp-cta .pdp-inq { order: 2; }
.pdp-cta .paypal-chip { order: 3; flex: 1 1 100%; justify-content: center; }
.pdp-cta .cta-btn,
.pdp-cta .add-to-list {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 22px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
}
.pdp-cta .pdp-add { background: #1A2744; border: 2px solid #1A2744; color: #fff; }
.pdp-cta .pdp-add:hover { background: #fff; color: #1A2744; }
.pdp-cta .pdp-amz { background: #FFD814; border: 2px solid #FFD814; color: #111; font-weight: 700; }
.pdp-cta .pdp-amz:hover { background: #f0c800; border-color: #f0c800; }
.pdp-cta .pdp-inq { background: #E05A2D; border: 2px solid #E05A2D; color: #fff; }
.pdp-cta .pdp-inq:hover { background: #C44D22; border-color: #C44D22; }
.pdp-cta-note { margin-top: 14px; font-size: 14px; }
.pdp-cta-note a { color: #6A9FFD; text-decoration: none; font-weight: 600; }
.pdp-cta-note a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .pdp-cta { display: block; }
  .pdp-cta > * { width: 100%; margin-bottom: 10px; }
}

/* ─────────── 4b. PayPal 标（默认不可点击占位，配置 PAYPAL_LINK 后变可点击） ─────────── */
.paypal-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 50px;
  padding: 0 18px;
  border: 1.5px solid #d7deea;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: default;
  user-select: none;
}
.paypal-chip .pp-brand { font-weight: 800; font-style: italic; font-size: 16px; letter-spacing: -.2px; }
.paypal-chip .pp-p1 { color: #003087; }
.paypal-chip .pp-p2 { color: #009CDE; }
.paypal-chip .pp-cap { font-size: 12px; font-weight: 500; color: #8b95a5; }
.paypal-chip.is-inactive { opacity: .72; }
a.paypal-chip { cursor: pointer; }
a.paypal-chip:hover { border-color: #009CDE; box-shadow: 0 2px 10px rgba(0,156,222,.16); }
.paypal-chip.sm { height: 38px; padding: 0 12px; gap: 6px; }
.paypal-chip.sm .pp-brand { font-size: 13px; }
.paypal-chip.sm .pp-cap { font-size: 11px; }
@media (max-width: 640px) {
  .pdp-cta .paypal-chip { width: 100%; justify-content: center; }
}

/* ─────────── 5. 顶栏：手机端可见的清单入口 ─────────── */
.header-cart-mobile { display: none; }
.header-nav .cart-nav-link { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.header-nav .cart-nav-link.active { color: #D4AF37 !important; }
.cart-count {
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 20px;
  background: #D4AF37;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 17px;
}
@media (max-width: 768px) {
  .header-cart-mobile {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 14px;
    font-size: 19px;
    text-decoration: none;
    padding: 4px 2px;
  }
}

/* ─────────── 6. 询价清单页 ─────────── */
.cart-page { max-width: 1040px; margin: 0 auto; }

.cart-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 122px 124px 186px;
  grid-template-areas: "thumb info qty price actions";
  align-items: center;
  gap: 10px 16px;
  background: #fff;
  border: 1px solid #eef1f5;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.cart-row:hover { border-color: #d8e2f0; box-shadow: 0 2px 12px rgba(26,39,68,.06); }

.cart-thumb {
  grid-area: thumb;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: #F1F3F7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cart-main { grid-area: info; min-width: 0; }
.cart-name { font-size: 15px; font-weight: 600; color: #1A2744; margin-bottom: 5px; line-height: 1.35; }
.cart-name a { color: #1A2744; text-decoration: none; }
.cart-name a:hover { color: #6A9FFD; }
.cart-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: #97a1b0; }
.cart-meta span { white-space: nowrap; }

.cart-qty {
  grid-area: qty;
  display: inline-flex;
  align-items: center;
  border: 1px solid #cdd7e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  justify-self: start;
}
.cart-qty button {
  width: 38px;
  height: 40px;
  border: 0;
  background: #EDF2F9;
  color: #2b3a55;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.cart-qty button:hover { background: #DCE6F5; color: #1A2744; }
.cart-qty input {
  width: 50px;
  height: 40px;
  border: 0;
  border-left: 1px solid #cdd7e5;
  border-right: 1px solid #cdd7e5;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #1A2744;
  background: #fff;
  box-sizing: border-box;
}
.cart-qty input::-webkit-outer-spin-button,
.cart-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-qty input[type=number] { -moz-appearance: textfield; }

.cart-price { grid-area: price; text-align: right; }
.cart-price .amount { font-size: 16px; font-weight: 700; color: #1A2744; white-space: nowrap; }
.cart-price .amount.is-quote { font-size: 13px; font-weight: 600; color: #8b95a5; }
.cart-price .unit { font-size: 11.5px; color: #97a1b0; margin-top: 2px; white-space: nowrap; }

.cart-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.cart-amz {
  font-size: 12px;
  font-weight: 600;
  background: #FFD814;
  color: #111;
  padding: 7px 13px;
  border-radius: 16px;
  text-decoration: none;
  white-space: nowrap;
}
.cart-amz:hover { background: #f0c800; }
.cart-remove {
  font-size: 12px;
  color: #b3261e;
  background: none;
  border: 0;
  padding: 6px 2px;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .cart-row {
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-areas:
      "thumb info"
      "thumb price"
      "qty   qty"
      "actions actions";
    gap: 8px 12px;
    padding: 14px;
  }
  .cart-thumb { width: 58px; height: 58px; font-size: 22px; }
  .cart-qty { justify-self: stretch; width: 100%; }
  .cart-qty button { flex: 1 1 auto; height: 42px; }
  .cart-qty input { flex: 0 0 54px; width: 54px; height: 42px; }
  .cart-price { text-align: left; }
  .cart-actions { justify-content: flex-end; width: 100%; padding-top: 2px; }
  .cart-amz { padding: 11px 16px; min-height: 40px; display: inline-flex; align-items: center; }
  .cart-remove { padding: 11px 6px; min-height: 40px; }
  #cart-form input[type=text],
  #cart-form input[type=email],
  #cart-form textarea { font-size: 16px; }   /* 防 iOS 聚焦自动放大 */
}
.cart-qty button:disabled { opacity: .38; cursor: not-allowed; }

/* 汇总条 + 表单 */
.cart-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: #F7F9FC;
  border: 1px solid #e8eef7;
  border-radius: 14px;
  padding: 20px 22px;
  margin: 20px 0 24px;
}
.cart-summary .totals { min-width: 220px; }
.cart-summary .pieces { font-size: 14px; color: #5a6577; }
.cart-summary .subtotal { font-size: 27px; font-weight: 700; color: #1A2744; line-height: 1.15; margin-top: 2px; }
.cart-summary .subtotal small { font-size: 12.5px; font-weight: 400; color: #8b95a5; margin-left: 6px; }
.cart-summary .fineprint { font-size: 12px; color: #8b95a5; margin-top: 8px; max-width: 560px; line-height: 1.65; }
.cart-summary .buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cart-btn-ghost {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border: 2px solid #6A9FFD;
  color: #3f7fe0;
  background: #fff;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}
.cart-btn-ghost:hover { background: #EEF4FF; }
.cart-btn-plain {
  font-family: inherit;
  font-size: 13px;
  padding: 11px 14px;
  border: 1px solid #e2e7ef;
  color: #939cab;
  background: #fff;
  border-radius: 9px;
  cursor: pointer;
}
.cart-btn-plain:hover { color: #b3261e; border-color: #f0d6d3; }
.cart-btn-primary {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 0 38px;
  height: 54px;
  border: 0;
  border-radius: 10px;
  background: #1A2744;
  color: #fff;
  cursor: pointer;
}
.cart-btn-primary:hover { background: #26365c; }
.cart-btn-jump { display: none; }
@media (max-width: 760px) {
  .cart-summary .buttons { width: 100%; }
  .cart-summary .buttons > button { flex: 1 1 auto; }
  .cart-btn-jump { display: inline-flex; align-items: center; justify-content: center; }
}

#cart-form.contact-form { max-width: 100%; margin: 0; background: #fff; border: 1px solid #eef1f5; border-radius: 16px; padding: 28px; }
#cart-form .cart-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
#cart-form input[type=text],
#cart-form input[type=email] { width: 100%; box-sizing: border-box; }
#cart-form .req { color: #E05A2D; }
#cart-form .hint { color: #a8b0bd; font-weight: 400; }
#cart-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  padding: 12px 14px;
  border: 1px solid #dfe4ec;
  border-radius: 9px;
}
#cart-form textarea:focus { outline: none; border-color: #6A9FFD; box-shadow: 0 0 0 3px rgba(106,159,253,.14); }
#cart-form .sync-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #8b95a5; margin: 12px 0 20px; }
.cart-submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (max-width: 640px) { .cart-submit-row { gap: 10px; } .cart-submit-row .paypal-chip { width: 100%; justify-content: center; } }
#cart-form .submit-note { font-size: 12px; color: #a8b0bd; margin: 14px 0 0; }
@media (max-width: 640px) {
  #cart-form.contact-form { padding: 20px 16px; }
  #cart-form .cart-fields { grid-template-columns: 1fr; }
  .cart-btn-primary { width: 100%; }
}

/* 空态 */
.cart-empty {
  text-align: center;
  padding: 48px 24px;
  background: #fff;
  border: 1px solid #eef1f5;
  border-radius: 16px;
}
.cart-empty .icon { font-size: 46px; line-height: 1; }
.cart-empty h2 { font-size: 21px; color: #1A2744; margin: 14px 0 8px; }
.cart-empty p { color: #8b95a5; font-size: 15px; max-width: 520px; margin: 0 auto 22px; line-height: 1.7; }
.cart-empty .alt { margin-top: 16px; font-size: 14px; }
.cart-empty .alt a { color: #6A9FFD; text-decoration: none; }
.cart-empty .alt a:hover { text-decoration: underline; }
