/*
   KBW base v1.0.0 — 赤陶画廊（公共 + 移动 + 平板）
   源：DeepSeek 手册 v2.0 × 现站类名适配（2026-10-13）
   断点族：719（网格2列，doll-img-cards 管）/ 720–1023（3列，本层）/ ≥1024（4列，kbw-desktop.css）
           1280（页眉状态，对齐 header_mobile_switch）——2026-10-13 拍板：归档统一 4 列，无 1440 五列档
   适配要点：
   - Block 主题结构，ul.products 外无 .woocommerce 包装 div，选择器不依赖该祖先
   - 卡片图框 2:3/1:3 由 doll-img-cards.php 管理（铁律：文件矩形=卡框矩形），本层不碰图
   - .product-action-wrap 为现站结构（site-extras 1.10 已移回文档流），按它隐藏/复现卡钮
   - 卡内排版沿用现站 tuned 值（14/15px 已近手册），本层不动字号，避免与 site-extras !important 缠斗
*/
:root{
  --kbw-brand:#a8533c;
  --kbw-brand-strong:#7c3a26;
  --kbw-brand-soft:#d9a07a;
  --kbw-brand-tint:#f6ece4;
  --kbw-brand-tint-strong:#f0ddcf;
  --kbw-ink:#26201b;
  --kbw-ink-2:#6b6258;
  --kbw-bg:#faf7f2;
  --kbw-surface:#fff;
  --kbw-line:#ece4da;
  --kbw-dark:#2a241d;
  --kbw-on-dark:#f4efe7;
  --kbw-radius-lg:14px;
  --kbw-radius:10px;
  --kbw-radius-sm:6px;
  --kbw-shadow-sm:0 1px 3px rgba(42,36,29,.06);
  --kbw-shadow-hover:0 14px 34px rgba(42,36,29,.14);
  --kbw-fast:.15s;
  --kbw-normal:.25s;
}

/* ---- 卡壳：表面 / 描边 / 圆角 / 微投影（作用于全部商品循环，含首页卡墙/PDP 相关）。
        圆角声明 14px 但被 site-extras v1.17「卡框 r12」!important 压制——接受偏差（evidence §3.1），勿加码缠斗 ---- */
html body ul.products li.product{
  background:var(--kbw-surface);
  border:1px solid var(--kbw-line);
  border-radius:var(--kbw-radius-lg);
  box-shadow:var(--kbw-shadow-sm);
  overflow:hidden;
}
html body ul.products li.product{width:100%!important;margin:0!important;float:none!important}

/* ---- 价格贴底管线（R2 评审 P2-2：自 kbw-desktop 下放全视口）----
   原三件套只在 ≥1024 生效，720-1023/≤719 的混排行（方卡线 1:1 与全身线 2:3 同行）
   价格悬半空、卡底留白。block 语境 auto margin 解析为 0 无副作用；移动端价格本就是末元素。 */
html body ul.products li.product{display:flex;flex-direction:column}
html body ul.products li.product .product-details{display:flex;flex-direction:column;flex:1 1 auto}
html body ul.products li.product .product-details .price{margin-top:auto}

/* ---- asnp 图片外空壳组退场（R2 评审 P3：零高度空 DOM 节点，每归档页 ~7 个） ---- */
html body ul.products li.product [class*="asnp-esb-badge-group-out-of-image"]{display:none!important}

/* ---- 类目页头部块整体退场（2026-10-13 用户覆议 R2 决策 ③，原话示例：页面顶部的
        "China Warehouse / Every doll in this section is made to order…"）——
        类目标题 h1 + 类目描述（.archive-description）整块不再展示；custom_css 全站
        body:not(.single-post) .entry-hero{display:none!important} 自然接管，此处不再反隐。
        SEO 折价（隐藏 h1）已随用户覆议接受，登记 evidence §24。 ---- */

/* ---- 卡内动作区整体退场（手册：移动端纯浏览卡，整卡链接承担跳转）；评分/分类同步隐藏。
        PC 悬停复现见 kbw-desktop.css。特异性 html body(0,3,4) 压过 site-extras 的 display:flex!important(0,3,2)。 ---- */
html body ul.products li.product .product-action-wrap,
html body ul.products li.product .star-rating,
html body ul.products li.product .posted_in{display:none!important}

/* ---- 卡面统一净化（2026-10-13 用户「太丑了」批：干净卡推广到全视口）：
        仓库签/库存签/稀缺行/品牌行全退场（仅卡内，PDP 保留告知）；绿色促销角标只隐角标本体，
        asnp-sale-badge-image-wrapper 是图片的定位父级不可整个隐藏（v1.6.2 教训） ---- */
html body ul.products li.product .doll-wh-loop,
html body ul.products li.product .doll-avail-tag,
html body ul.products li.product .doll-scarcity,
html body ul.products li.product .doll-only-left,
html body ul.products li.product .pwb-brands-in-loop{display:none!important}
html body ul.products li.product .asnp-sale-badge-image-wrapper [class^="asnp-esb-badge"],
html body ul.products li.product .asnp-sale-badge-image-wrapper [class*=" asnp-esb-badge"]{display:none!important}

/* ---- 标题两行钳制（全视口）：PC 实测 8/9 卡三行未截断=文字墙参差；钳二行 + 最小高保行数一致，
        网格节奏齐整（单行标题也占两行位，价格贴底线对齐） ---- */
html body ul.products li.product .woocommerce-loop-product__title{
  display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  min-height:2.8em;line-height:1.4!important;
}

/* ---- 平板 3 列（720–1023，接管 Kadence grid-sm-col-2）——仅归档语境 ---- */
@media (min-width:720px) and (max-width:1023px){
  body.is-shop ul.products{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    column-gap:16px!important;
    row-gap:26px!important;
  }
}

/* ---- 移动端排序 / 计数 / 分页触控 ---- */
@media (max-width:719px){
  .woocommerce-result-count{display:none}
  .woocommerce-ordering{width:100%!important;margin:0 0 12px}
  .woocommerce-ordering select,
  .woocommerce-ordering .orderby{
    width:100%!important;min-height:44px;font-size:16px;padding:10px 30px 10px 12px;
    border:1px solid var(--kbw-line);border-radius:var(--kbw-radius);background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6258' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance:none;appearance:none;color:var(--kbw-ink);
  }
  .woocommerce nav.woocommerce-pagination ul{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;border:0}
  .woocommerce nav.woocommerce-pagination ul li{border:0}
  .woocommerce nav.woocommerce-pagination ul li a,
  .woocommerce nav.woocommerce-pagination ul li span{
    min-width:40px;min-height:40px;line-height:40px;padding:0 12px;font-size:15px;
    border-radius:var(--kbw-radius-sm);
  }
}

/* ---- PDP 移动端：主 CTA（44px 选择器基座已由 doll-responsive-base 提供）。
        2026-10-13 R2 评审 P1-2：site-extras T6④ 的全按钮 40px 地板（.woocommerce button.button,
        0,2,1 + !important）压过 form.cart 系规则——此处 (0,3,2)+!important 收回主动权。
        ⚠️ .woocommerce 类挂在 body 上，不能写成后代组合器（body 非自身后代）。
        2026-10-13 用户按钮批 1：48/16→44/14·600；批 2（「太长+没对齐」）：数量|ATC|BN 三栏一行。
        2026-10-14 R3：本段为兜底层（doll-head-swatches.php 移动端块 (0,3,2)+!important
        压过本段后接管实行为准）。flex-wrap 方案与权威层同构（grid 的 fr 列会被 WAPF 容器/
        number input 内在尺寸挤塌）；white-space 去 nowrap——德语「In den Warenkorb」窄列允许
        两行，五语不溢出。 ---- */
@media (max-width:767px){
  body.is-product form.cart,
  body.is-product form.cart .woocommerce-variation-add-to-cart{
    display:flex!important;flex-wrap:wrap;gap:10px;align-items:stretch;
  }
  body.is-product form.cart > *,
  body.is-product form.cart .woocommerce-variation-add-to-cart > *{flex:1 1 100%;min-width:0}
  body.is-product form.cart .quantity{flex:0 0 58px;width:58px;margin:0!important;align-self:center}
  body.is-product form.cart .quantity input.qty{width:100%;min-width:0;text-align:center}
  body.is-product form.cart .single_add_to_cart_button,
  body.is-product form.cart .doll-buynow{
    flex:1 1 0;margin-top:0!important;
    min-height:44px!important;width:auto!important;padding:0 8px!important;
    font-size:14px!important;font-weight:600!important;white-space:normal;line-height:1.15;
  }
  body.is-product form.cart .gtm4wp_single_productdata{display:none!important}
  .product_meta{font-size:12px;color:var(--kbw-ink-2)}
  /* 我的账户表单触控（R2 评审 P3：登录输入临界 43px） */
  body.is-account .woocommerce-form input.input-text,
  body.is-account .woocommerce-form-login .button{min-height:44px}
}

/* ---- 购物车 / 结算移动端：表格行卡化 + 输入 48px ---- */
@media (max-width:767px){
  body.is-cart table.shop_table.cart,
  body.is-cart table.shop_table.cart tbody,
  body.is-cart table.shop_table.cart tr,
  body.is-cart table.shop_table.cart td{display:block;width:100%!important}
  body.is-cart table.shop_table.cart thead{display:none}
  body.is-cart table.shop_table.cart tr{
    background:var(--kbw-surface);border-radius:var(--kbw-radius);
    box-shadow:var(--kbw-shadow-sm);margin-bottom:12px;padding:12px;
  }
  .cart-collaterals .cart_totals{width:100%!important;float:none!important}
  body.is-checkout .form-row input.input-text,
  body.is-checkout .form-row select,
  body.is-checkout .form-row textarea{min-height:48px;font-size:16px;border-radius:var(--kbw-radius)}
  #place_order{width:100%!important;min-height:52px;font-size:17px}
}

/* ---- 页眉状态层 ≤1279（对齐 header_mobile_switch=1280）：抽屉导航触控行高 + 移动 logo 上限 ---- */
@media (max-width:1279px){
  #mobile-drawer .mobile-navigation li a{
    min-height:48px;padding:14px 16px;font-size:16px;
    border-bottom:1px solid var(--kbw-line);
  }
  .site-header .custom-logo{max-height:40px;width:auto}
}


/* ---- 焦点环赤陶化 ---- */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:2px solid var(--kbw-brand-strong);outline-offset:2px
}

/* ---- 移动端 PDP「购买卡」净化（R3 用户「PDP 移动端很丑」批，2026-10-13）----
   丑源：图与 CTA 间六块字号混杂小字 + CTA 下方三块噪音（心愿单/SKU·分类灰字/品牌行）。
   处置：短描述（与标题+胶囊信息重复）、product_meta、品牌行、心愿单移动端退场（PC 保留）；
   仓库信息由胶囊+稀缺行承载；节奏统一收紧。标题/价格字阶见 site-extras T1c 覆议注。 ---- */
@media (max-width:768px){
  body.is-product .summary .product_title{margin-bottom:2px!important}
  body.is-product .summary .price{margin:6px 0 10px!important}
  body.is-product .summary .doll-wh-chip{font-size:11px!important;padding:2px 10px!important;margin:0 0 8px!important}
  body.is-product .summary .doll-scarcity{margin:2px 0 0!important;font-size:12px!important;line-height:1.45!important}
  body.is-product form.cart{margin:14px 0 0!important}
  body.is-product .summary .woocommerce-product-details__short-description,
  body.is-product .summary .product_meta,
  body.is-product .summary .pwb-single-product-brands,
  body.is-product .yith-add-to-wishlist-button-block{display:none!important}
  /* 信任块移动版：深色 emoji 面板 → 浅色紧凑四列（PC 内联深色原样） */
  .qy-pdp-trust{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important;
    background:#f6ece4!important;border:1px solid #ece4da!important;border-radius:10px!important;
    padding:8px 6px!important;margin:12px 0 14px!important}
  .qy-pdp-trust>div{font-size:10.5px!important;color:#6b6258!important;line-height:1.25!important}
  .qy-pdp-trust>div>b{font-size:14px!important;display:block;margin-bottom:1px}
}

/* ---- 2026-10-13 用户卡面收紧批（移动端 ≤768）：标题/价格缩幅 + 边距压缩，图幅最大化
        （图框 2:3 不变，卡高变矮=每屏多卡）。标签/品牌/角标退场已上移为全视口规则。 ---- */
@media (max-width:768px){
html body ul.products li.product .woocommerce-loop-product__title{
  font-size:12px!important;font-weight:500!important;line-height:1.3!important;
  padding:6px 8px 0!important;margin:0!important;
  min-height:2.6em;
}
html body ul.products li.product .price,
html body ul.products li.product .price .woocommerce-Price-amount{font-size:11.5px!important}
html body ul.products li.product .price .q-int{font-size:15px!important;line-height:1.15}
html body ul.products li.product .price .q-dec{font-size:11px!important}
html body ul.products li.product .price .woocommerce-Price-currencySymbol{font-size:12px!important}
html body ul.products li.product .price del .amount,
html body ul.products li.product .price del .q-int,
html body ul.products li.product .price del .q-dec{font-size:11px!important}
html body ul.products li.product .price{padding:2px 8px 8px!important;margin:0!important}
}
