/* 摇小树 IP 插画选图 · 前台样式
   配色统一引用 Astra 主题全局变量（--ast-global-color-N），仅在主题未加载时给兜底值，
   不另造一套自定义灰。Astra: 0=黑(#000) 4=浅灰(#f8f8f8) 5=白 8=正文(#333)。 */
/* 最外层不再画框：去掉边框/圆角/内边距，让选图内容直接融入商品页（用户要求） */
.yxs-art {
  margin: 40px 0;
  color: var(--ast-global-color-8, #1a1a1a);
}
.yxs-art-hd { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.yxs-art-hd strong { font-size: 15px; color: var(--ast-global-color-0, #000); }
.yxs-art-hint { font-size: 12px; color: #888; }
.yxs-art-preorder-note { margin: 0 0 10px; font-size: 12px; color: #854F0B; display: flex; align-items: center; gap: 6px; }
.yxs-art-preorder-tag { display: inline-block; font-size: 10px; line-height: 1.5; padding: 1px 7px; border-radius: 20px; background: #FAEEDA; color: #854F0B; }
.yxs-art-desc { font-size: 13px; color: #666; margin: 0 0 12px; }
.yxs-art-desc b { color: var(--ast-global-color-0, #000); }
/* 按变体分现货：属性没选全时的提示（现货/预售还没法定） */
.yxs-art-varnote { font-size: 12px; color: #854F0B; background: #FAEEDA; border-radius: 6px; padding: 6px 10px; margin: 0 0 12px; }
.yxs-art-varnote[hidden] { display: none !important; }
.yxs-art-tools { margin-bottom: 12px; }
.yxs-art-search {
  width: 100%; box-sizing: border-box; padding: 9px 12px; font-size: 13px;
  border: 1px solid var(--ast-global-color-4, #ddd); border-radius: 6px;
  background: var(--ast-global-color-5, #fff); color: var(--ast-global-color-8, #333);
}
.yxs-art-sorts { display: flex; gap: 6px; margin-bottom: 12px; }
.yxs-art-sort {
  appearance: none; -webkit-appearance: none; box-shadow: none;
  font-size: 12px; line-height: 1; padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--ast-global-color-4, #ddd) !important; border-radius: 20px;
  background: var(--ast-global-color-5, #fff) !important;
  color: var(--ast-global-color-8, #333) !important;
}
.yxs-art-sort.is-active {
  background: var(--ast-global-color-0, #000) !important;
  color: var(--ast-global-color-5, #fff) !important;
  border-color: var(--ast-global-color-0, #000) !important;
}
.yxs-art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; max-height: 460px; overflow: auto; padding: 4px 2px; }

/* 卡片：默认无框，hover 浅灰，选中黑框——不遮图，编号/名称在图下方 */
.yxs-art-cell {
  position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden;
  background: var(--ast-global-color-5, #fff); cursor: pointer; outline: none;
  transition: border-color .12s, background .12s;
}
.yxs-art-cell:hover { border-color: var(--ast-global-color-4, #ddd); background: var(--ast-global-color-4, #fafafa); }
.yxs-art-cell.selected,
.yxs-art-cell.selected:hover { border-color: var(--ast-global-color-0, #000); background: var(--ast-global-color-5, #fff); }
.yxs-art-cell.filtered { display: none; }
.yxs-art-thumb { position: relative; display: block; line-height: 0; background: var(--ast-global-color-4, #fafafa); }
.yxs-art-thumb img { width: 100%; height: auto; display: block; }
.yxs-art-cap { display: flex; flex-direction: column; gap: 1px; padding: 6px 5px 7px; line-height: 1.3; text-align: center; }
.yxs-art-cap b { font-size: 12px; font-weight: 600; color: var(--ast-global-color-0, #000); }
.yxs-art-cap i { font-style: normal; font-size: 10px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yxs-art-stock { position: absolute; left: 4px; top: 4px; line-height: 1.4; font-size: 10px; font-weight: 600; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.yxs-art-stock.is-stock { background: #E1F5EE; color: #0F6E56; }
.yxs-art-stock.is-preorder { background: #FAEEDA; color: #854F0B; }

/* 已选清单 */
.yxs-art-picked { margin-top: 14px; padding: 12px; border: 1px solid var(--ast-global-color-4, #e5e5e5); border-radius: 8px; background: var(--ast-global-color-4, #fafafa); font-size: 13px; }
.yxs-art-picked[hidden] { display: none !important; }
.yxs-art-picked-label { color: #666; }
.yxs-art-picked-label b { color: var(--ast-global-color-0, #000); font-weight: 500; }
.yxs-art-picked-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.yxs-art-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--ast-global-color-4, #eee); border-radius: 6px; background: var(--ast-global-color-5, #fff); }
.yxs-art-pick-name { flex: 1; min-width: 120px; color: var(--ast-global-color-0, #000); }
.yxs-art-pick-badge { font-size: 11px; padding: 1px 6px; border-radius: 20px; }
.yxs-art-pick-badge.is-stock { background: #E1F5EE; color: #0F6E56; }
.yxs-art-pick-badge.is-preorder { background: #FAEEDA; color: #854F0B; }
/* 材质标签：虚线描边，跟「现货/预定」实心角标区分开 */
.yxs-art-pick-mat { font-size: 11px; line-height: 1.6; padding: 0 6px; border-radius: 4px; border: 1px dashed #c9c9c9; color: #555; background: var(--ast-global-color-5, #fff); white-space: nowrap; }

/* 件数 / 移除 / 清空：用 Astra 全局变量配色，对抗主题 button{} 黑底 */
.yxs-art .yxs-art-pick-qty { display: inline-flex; align-items: center; border: 1px solid var(--ast-global-color-4, #ddd); border-radius: 6px; overflow: hidden; }
.yxs-art .yxs-art-pick-qty button,
.yxs-art .yxs-art-pick-rm,
.yxs-art .yxs-art-clear {
  appearance: none; -webkit-appearance: none; box-shadow: none; text-shadow: none;
  background-image: none; border-radius: 0;
}
.yxs-art .yxs-art-pick-qty button {
  border: 0 !important;
  background: var(--ast-global-color-4, #fafafa) !important;
  color: var(--ast-global-color-8, #333) !important;
  width: 28px; height: 26px; margin: 0; padding: 0; cursor: pointer; font-size: 14px; line-height: 26px;
}
.yxs-art .yxs-art-pick-qty button:hover { filter: brightness(.94); }
.yxs-art .yxs-art-pick-qty b {
  display: inline-block; min-width: 26px; text-align: center; font-weight: 500; font-size: 13px;
  color: var(--ast-global-color-0, #000); background: var(--ast-global-color-5, #fff); line-height: 26px;
}
.yxs-art .yxs-art-pick-rm {
  border: 0 !important; background: transparent !important;
  color: #999 !important; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; margin: 0;
}
.yxs-art .yxs-art-pick-rm:hover { color: #A32D2D !important; background: transparent !important; }
.yxs-art .yxs-art-clear {
  display: inline-block; margin-top: 10px; padding: 0;
  border: 0 !important; background: transparent !important;
  color: #888 !important; font-size: 12px; cursor: pointer; text-decoration: underline;
}
.yxs-art .yxs-art-clear:hover { color: #A32D2D !important; background: transparent !important; }
.yxs-art-error { color: #A32D2D; font-size: 13px; margin-top: 10px; }
.yxs-art-error[hidden] { display: none !important; }

/* 商品页原生数量计数器：启用选图后隐藏，只留加入购物车（占满整行宽）
   用 form[class] 抬高特异性 + !important，压过 Astra 的 .woocommerce .quantity / .single_add_to_cart_button 规则；
   元素由变体 JS 后插入也能命中，不依赖脚本执行时机。 */
form.variations_form.cart:has(.yxs-art) .quantity,
form.variations_form.cart:has(.yxs-art) .quantity input,
form.variations_form.cart:has(.yxs-art) .woocommerce-QuantityRow { display: none !important; }
form.variations_form.cart:has(.yxs-art) button.single_add_to_cart_button,
form:has(.yxs-art) .single_add_to_cart_button { width: 100% !important; box-sizing: border-box; }

/* 同款商品入口：卡片样式完全交给 WooCommerce + Astra（与首页一致），这里只管容器与标题。 */
.yxs-same-goods { margin: 36px 0 8px; }
.yxs-same-goods > h3 { margin: 0 0 16px; font-size: 18px; font-weight: 500; line-height: 1.4; }
