/**
 * WOLKENTAKT · Components · 移动端吸底 CTA（结账 / 购物车）
 *
 * 加载：全站——functions.php 的 $wt_base_styles 链（依赖 wolkentakt-side-cart）；
 *       仅 ≤640px 显示，桌面端 DOM 存在但 display:none。
 * 渲染：inc/mobile-cta.php（wp_footer）；购物车 / 结账 / 我的账户 三页不输出。
 * 层级：900 < 侧边抽屉 998/999，抽屉打开时被遮罩正常覆盖。
 * 底距：body:has(.wt-mcta) 补 68px（含 iPhone 安全区），避免遮住页脚最后一行。
 * 变更：2026-11-18 左按钮由「选购（展开品牌）」改为「Zur Kasse（结账）」，
 *       品牌下拉已迁到头部（见 components 之外的 layout/header.css `.wt-header-shop`）。
 */

.wt-mcta {
  display: none;
}

@media (max-width: 640px) {
  body:has(.wt-mcta) {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .wt-mcta {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 900;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--wt-surface-glass);
    border-top: 1px solid var(--wt-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .wt-mcta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--wt-radius-control);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
  }

  .wt-mcta__btn svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
  }

  .wt-mcta__btn--checkout {
    background: var(--wt-carbon);
    color: var(--wt-text-on-dark);
  }

  .wt-mcta__btn--cart {
    background: var(--wt-surface-white);
    color: var(--wt-carbon);
    border: 1px solid var(--wt-border);
  }

  /* 购物车数量角标：0 时由 [hidden] 隐藏（需显式覆盖 display，否则会被 inline-flex 顶掉） */
  .wt-mcta__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--wt-radius-pill);
    background: var(--wt-tag-new);
    color: var(--wt-text-on-dark);
    font-size: 0.6875rem;
    font-weight: 800;
    line-height: 1;
  }

  .wt-mcta__count[hidden] {
    display: none;
  }
}
