/* =========================================================
   KA Packaging 全站商店页面统一修复
   修改配色：优先修改下面 6 个颜色变量。
   ========================================================= */
:root {
  --ka-shop-ink: #0f172a;
  --ka-shop-brown: #2d2118;
  --ka-shop-muted: #756555;
  --ka-shop-green: #287761;
  --ka-shop-green-dark: #1f604f;
  --ka-shop-cream: #fff8ee;
  --ka-shop-card: #fffdf8;
  --ka-shop-line: #eadbc3;
}

/* 1.1.3：未交互的可选 SKU 也保持清晰，避免旧自定义 CSS 误判为缺货。 */
html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term:not(.wpcvs-disabled) {
  opacity: 1 !important;
  cursor: pointer !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term:not(.wpcvs-disabled) .wpcvs-term-inner,
html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term:not(.wpcvs-disabled) .wpcvs-term-label {
  color: var(--ka-shop-brown) !important;
  background: transparent !important;
  opacity: 1 !important;
  text-decoration: none !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-selected .wpcvs-term-inner,
html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-selected .wpcvs-term-label {
  color: var(--ka-shop-green-dark) !important;
}

@media (max-width: 767px) {
  html body.single-product:not(.postid-3671)
    form.variations_form .wpcvs-terms.wpcvs-type-button
    .wpcvs-term.wpcvs-selected::after {
    color: #fff !important;
  }
}

/* =========================================================
   1. 手机页眉：只保留 Logo，隐藏右上角多余的汉堡菜单
   修改 Logo 高度：修改 max-height。
   ========================================================= */
@media (max-width: 921px) {
  #masthead #ast-mobile-header .ast-primary-header-bar,
  #masthead #ast-mobile-header .ast-above-header-bar,
  #masthead #ast-mobile-header .ast-below-header-bar,
  #masthead #ast-mobile-header .ast-builder-grid-row {
    min-height: 42px !important;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
  }

  #masthead #ast-mobile-header .site-branding.ast-site-identity,
  #masthead #ast-mobile-header .ast-builder-layout-element {
    min-height: 0 !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .ast-mobile-header-wrap .site-logo-img img,
  .ast-mobile-header-wrap .custom-logo-link img {
    width: auto !important;
    max-height: 30px !important;
  }

  .ast-mobile-header-wrap [data-section="section-header-mobile-trigger"],
  .ast-mobile-header-wrap .main-header-menu-toggle,
  .ast-mobile-header-wrap .ast-mobile-menu-trigger-minimal,
  .ast-mobile-header-wrap .ast-mobile-menu-trigger-outline {
    display: none !important;
  }
}

/* =========================================================
   2. Elementor 页面 4 个导航按钮：平均占满一行
   改字体大小：修改 font-size；改间距：修改 gap。
   ========================================================= */
@media (max-width: 759px) {
  .ka-header-inner {
    gap: 6px !important;
    padding: 8px 4px 7px !important;
  }

  html body nav.ka-nav {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  html body nav.ka-nav > a,
  html body nav.ka-nav > a[href*="/about/"] {
    display: flex !important;
    flex: none !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    width: auto !important;
    min-height: 40px !important;
    padding: 7px 4px !important;
    border-radius: 11px !important;
    font-size: clamp(12.5px, 3.3vw, 14.5px) !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
}

/* 第五项旧 Contact 即使来自页面缓存也不显示；四项导航始终保持单排。 */
html body nav.ka-nav > a:nth-child(n+5) {
  display: none !important;
}

/* 电脑导航同样固定为 4 个入口。 */
@media (min-width: 760px) {
  html body .ka-header-inner {
    min-height: 68px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    padding: 0 !important;
  }

  html body nav.ka-nav {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
    flex: 0 1 620px !important;
    width: min(620px, 65vw) !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  html body nav.ka-nav > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }
}

/* =========================================================
   3. 产品页 / 产品分类页新增的 4 个统一导航按钮
   改链接和按钮文字：编辑主插件文件中的 ka_storefront_render_quick_nav。
   ========================================================= */
.ka-store-quicknav {
  width: 100%;
  border-top: 1px solid rgba(234, 219, 195, .72);
  border-bottom: 1px solid var(--ka-shop-line);
  background: rgba(255, 248, 238, .97);
}

.ka-store-quicknav__inner {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 9px 0;
}

.ka-store-quicknav__inner > a:nth-child(n+5) {
  display: none !important;
}

.ka-store-quicknav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 8px 7px;
  border: 1px solid var(--ka-shop-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .78);
  color: var(--ka-shop-brown);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.ka-store-quicknav a:hover,
.ka-store-quicknav a:focus-visible {
  border-color: var(--ka-shop-green);
  color: var(--ka-shop-green-dark);
  background: #f0f8f4;
}

@media (max-width: 520px) {
  .ka-store-quicknav__inner {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 5px !important;
    width: calc(100% - 16px);
    padding: 7px 0;
  }

  .ka-store-quicknav a {
    min-height: 40px;
    padding: 7px 3px;
    font-size: clamp(12px, 3.4vw, 14px);
    line-height: 1.1;
    white-space: nowrap;
  }
}

/* 1.1.7：覆盖旧手机缓存中曾经隐藏 About 的规则，四项必须始终可见且等宽。 */
html body .ka-store-quicknav .ka-store-quicknav__inner {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

html body .ka-store-quicknav .ka-store-quicknav__inner > a:nth-child(-n+4),
html body .ka-store-quicknav .ka-store-quicknav__inner > a[href*="/about/"] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

html body .ka-store-quicknav .ka-store-quicknav__inner > a:nth-child(n+5) {
  display: none !important;
}

/* =========================================================
   4. SKU 按钮：选中后使用浅绿色底、2px 绿色边框和绿色文字
   解决真实手机中文字挤在一起、覆盖和固定高度问题。
   ========================================================= */
body.single-product:not(.postid-3671) form.variations_form {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.single-product:not(.postid-3671)
  .wpcvs-terms.wpcvs-type-button .wpcvs-term {
  min-width: 0 !important;
  min-height: 44px !important;
  height: auto !important;
  border-color: var(--ka-shop-line) !important;
  border-width: 1px !important;
  background: var(--ka-shop-card) !important;
  opacity: 1 !important;
  overflow: visible !important;
  cursor: pointer !important;
}

body.single-product:not(.postid-3671)
  .wpcvs-terms.wpcvs-type-button .wpcvs-term-inner,
body.single-product:not(.postid-3671)
  .wpcvs-terms.wpcvs-type-button .wpcvs-term-label {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 42px !important;
  color: var(--ka-shop-brown) !important;
  font-weight: 800 !important;
  line-height: 1.28 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  text-decoration: none !important;
}

body.single-product:not(.postid-3671)
  .wpcvs-terms.wpcvs-type-button .wpcvs-term.wpcvs-selected {
  border: 2px solid var(--ka-shop-green) !important;
  background: #edf8f3 !important;
  box-shadow: 0 0 0 2px rgba(40, 119, 97, .12) !important;
}

body.single-product:not(.postid-3671)
  .wpcvs-terms.wpcvs-type-button .wpcvs-term.wpcvs-selected
  .wpcvs-term-inner,
body.single-product:not(.postid-3671)
  .wpcvs-terms.wpcvs-type-button .wpcvs-term.wpcvs-selected
  .wpcvs-term-label {
  color: var(--ka-shop-green-dark) !important;
}

/* 旧产品页的内联 CSS 在插件样式之后加载，并把选中文字强制成白色。
   增加 form 层级提高优先级，确保选中文字始终为绿色。 */
html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-selected .wpcvs-term-inner,
html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-selected .wpcvs-term-label {
  color: var(--ka-shop-green-dark) !important;
}

body.single-product:not(.postid-3671)
  .wpcvs-terms.wpcvs-type-button .wpcvs-term.wpcvs-selected::after {
  top: 3px !important;
  right: 5px !important;
  color: var(--ka-shop-green) !important;
  font-size: 11px !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-selected::after {
  top: -5px !important;
  right: -5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 15px !important;
  height: 15px !important;
  border-radius: 50% !important;
  background: var(--ka-shop-green) !important;
  color: #fff !important;
  font-size: 9px !important;
}

/* 只有插件明确标记为 disabled 的变体才显示灰色斜杠。
   不再把“尚未完成初始化”的按钮误判成缺货。 */
body.single-product:not(.postid-3671)
  .wpcvs-terms.wpcvs-type-button .wpcvs-term.wpcvs-disabled {
  border-color: #ddd6ce !important;
  background: #f3f0eb !important;
  opacity: .66 !important;
  cursor: not-allowed !important;
}

body.single-product:not(.postid-3671)
  .wpcvs-terms.wpcvs-type-button .wpcvs-term.wpcvs-disabled
  .wpcvs-term-inner,
body.single-product:not(.postid-3671)
  .wpcvs-terms.wpcvs-type-button .wpcvs-term.wpcvs-disabled
  .wpcvs-term-label {
  color: #9f968d !important;
  text-decoration: line-through !important;
}

@media (max-width: 520px) {
  body.single-product:not(.postid-3671)
    .wpcvs-terms.wpcvs-type-button {
    /* 拼多多式紧凑 SKU：标签随文字宽度自动排列，不再平均撑满整行。 */
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    grid-template-columns: none !important;
    gap: 8px 7px !important;
    width: 100% !important;
  }

  body.single-product:not(.postid-3671)
    .wpcvs-terms.wpcvs-type-button .wpcvs-term {
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: 100% !important;
    min-height: 36px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  /* 改 SKU 框内留白、字号和居中方式：修改下面 padding、font-size。 */
  body.single-product:not(.postid-3671)
    .wpcvs-terms.wpcvs-type-button .wpcvs-term-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: 100% !important;
    min-height: 34px !important;
    padding: 6px 11px !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
    line-height: 1.22 !important;
    text-align: center !important;
  }

  body.single-product.postid-5143
    .wpcvs-terms[data-attribute="cake-box-size-height"] {
    align-items: flex-start !important;
  }

  body.single-product:not(.postid-3671)
    .wpcvs-terms.wpcvs-type-button .wpcvs-term-label {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }

  /* 选中角标：小号绿色圆形勾选，更接近移动商城的规格标签。 */
  body.single-product:not(.postid-3671)
    .wpcvs-terms.wpcvs-type-button .wpcvs-term.wpcvs-selected::after {
    top: -5px !important;
    right: -5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 15px !important;
    height: 15px !important;
    border-radius: 50% !important;
    background: var(--ka-shop-green) !important;
    color: #fff !important;
    font-size: 9px !important;
    line-height: 1 !important;
    box-shadow: 0 0 0 2px var(--ka-shop-card) !important;
  }
}

/* =========================================================
   4A. 手机产品图库：缩略图放在主图上方
   适用于当前和以后新建的所有正式产品，点击 SKU 后主图仍由 WooCommerce 自动替换。
   ========================================================= */
@media (max-width: 767px) {
  body.single-product:not(.postid-3671)
    div.product > .woocommerce-product-gallery {
    display: flex !important;
    flex-direction: column !important;
  }

  body.single-product:not(.postid-3671)
    div.product > .woocommerce-product-gallery > .flex-control-thumbs {
    order: 1 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
  }

  body.single-product:not(.postid-3671)
    div.product > .woocommerce-product-gallery > .flex-control-thumbs li {
    float: none !important;
    width: 76px !important;
    margin: 0 !important;
  }

  body.single-product:not(.postid-3671)
    div.product > .woocommerce-product-gallery > .flex-control-thumbs img {
    display: block !important;
    width: 76px !important;
    height: 76px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
  }

  body.single-product:not(.postid-3671)
    div.product > .woocommerce-product-gallery > .woocommerce-product-gallery__trigger {
    order: 2 !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    align-self: flex-end !important;
    flex: 0 0 36px !important;
    margin: 0 0 -36px !important;
    transform: translate(-.5em, .5em) !important;
    z-index: 9 !important;
  }

  body.single-product:not(.postid-3671)
    div.product > .woocommerce-product-gallery > .flex-viewport,
  body.single-product:not(.postid-3671)
    div.product > .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper {
    order: 3 !important;
  }
}

/* =========================================================
   5. 产品页底部：隐藏 Astra 自动生成的蓝色悬浮 Select options 条
   ========================================================= */
body.single-product .ast-sticky-add-to-cart {
  display: none !important;
}

/* 正式商品只显示描述正文，不显示 Reviews / Additional information 标签栏。 */
body.single-product:not(.postid-3671) .woocommerce-tabs ul.tabs,
body.single-product:not(.postid-3671) .woocommerce-Tabs-panel--reviews,
body.single-product:not(.postid-3671) .woocommerce-Tabs-panel--additional_information {
  display: none !important;
}

body.single-product:not(.postid-3671) .woocommerce-Tabs-panel--description {
  display: block !important;
}

/* =========================================================
   6. 相关产品与分类页 Select options：改成绿色圆角按钮
   ========================================================= */
body.single-product:not(.postid-3671)
  .related.products a.button.product_type_variable,
body.single-product:not(.postid-3671)
  .up-sells.products a.button.product_type_variable,
body.tax-product_cat.woocommerce
  ul.products li.product a.button.product_type_variable {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 48px !important;
  margin-top: 12px !important;
  padding: 10px 14px !important;
  border: 1px solid var(--ka-shop-green) !important;
  border-radius: 14px !important;
  background: var(--ka-shop-green) !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  letter-spacing: .045em !important;
  text-align: center !important;
  text-transform: none !important;
  box-shadow: none !important;
}

body.single-product:not(.postid-3671)
  .related.products a.button.product_type_variable:hover,
body.single-product:not(.postid-3671)
  .up-sells.products a.button.product_type_variable:hover,
body.tax-product_cat.woocommerce
  ul.products li.product a.button.product_type_variable:hover {
  border-color: var(--ka-shop-green-dark) !important;
  background: var(--ka-shop-green-dark) !important;
}

/* =========================================================
   7. WooCommerce 产品分类归档页：统一成米白、绿色、圆角卡片
   ========================================================= */
body.tax-product_cat.woocommerce {
  background: var(--ka-shop-cream) !important;
  color: var(--ka-shop-ink);
}

body.tax-product_cat.woocommerce .site-content .ast-container {
  width: min(1160px, calc(100% - 28px));
  max-width: 1160px;
  padding-top: 30px;
  padding-bottom: 58px;
}

body.tax-product_cat.woocommerce .woocommerce-products-header {
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid var(--ka-shop-line);
  border-radius: 22px;
  background: var(--ka-shop-card);
}

body.tax-product_cat.woocommerce .woocommerce-products-header__title {
  margin: 0;
  color: var(--ka-shop-ink);
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -.025em;
}

body.tax-product_cat.woocommerce .woocommerce-result-count,
body.tax-product_cat.woocommerce .woocommerce-ordering {
  margin-bottom: 18px;
  color: var(--ka-shop-muted);
}

body.tax-product_cat.woocommerce .woocommerce-ordering select {
  min-height: 42px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--ka-shop-line);
  border-radius: 12px;
  background-color: #fff;
  color: var(--ka-shop-brown);
}

body.tax-product_cat.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
  margin: 0 !important;
}

body.tax-product_cat.woocommerce ul.products::before,
body.tax-product_cat.woocommerce ul.products::after {
  display: none !important;
}

body.tax-product_cat.woocommerce ul.products li.product {
  float: none !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 14px 14px !important;
  overflow: hidden !important;
  border: 1px solid var(--ka-shop-line) !important;
  border-radius: 18px !important;
  background: var(--ka-shop-card) !important;
  box-shadow: 0 12px 30px rgba(45, 33, 24, .06) !important;
}

body.tax-product_cat.woocommerce ul.products li.product a.woocommerce-loop-product__link {
  display: block;
  color: inherit;
}

body.tax-product_cat.woocommerce ul.products li.product img {
  width: calc(100% + 28px) !important;
  max-width: none !important;
  margin: 0 -14px 12px !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
}

body.tax-product_cat.woocommerce ul.products li.product .ast-woo-product-category {
  color: var(--ka-shop-muted) !important;
  font-size: 12px !important;
}

body.tax-product_cat.woocommerce ul.products li.product .woocommerce-loop-product__title {
  margin: 5px 0 0 !important;
  color: var(--ka-shop-ink) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

body.tax-product_cat.woocommerce ul.products li.product .button {
  margin-top: auto !important;
}

@media (max-width: 921px) {
  body.tax-product_cat.woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
}

@media (max-width: 520px) {
  body.tax-product_cat.woocommerce .site-content .ast-container {
    width: calc(100% - 16px);
    padding-top: 16px;
    padding-bottom: 42px;
  }

  body.tax-product_cat.woocommerce .woocommerce-products-header {
    margin-bottom: 12px;
    padding: 16px 15px;
    border-radius: 16px;
  }

  body.tax-product_cat.woocommerce .woocommerce-products-header__title {
    font-size: 29px;
  }

  body.tax-product_cat.woocommerce ul.products {
    gap: 8px !important;
  }

  body.tax-product_cat.woocommerce ul.products li.product {
    padding: 0 9px 10px !important;
    border-radius: 14px !important;
  }

  body.tax-product_cat.woocommerce ul.products li.product img {
    width: calc(100% + 18px) !important;
    margin: 0 -9px 9px !important;
  }

  body.tax-product_cat.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 14px !important;
  }

  body.tax-product_cat.woocommerce ul.products li.product a.button.product_type_variable {
    min-height: 43px !important;
    padding: 8px 7px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    letter-spacing: .025em !important;
  }
}

/* =========================================================
   8. 产品页和产品分类页统一页脚
   改文字和链接：编辑主插件文件中的 ka_storefront_render_footer。
   ========================================================= */
.ka-store-footer {
  width: 100%;
  padding: 30px 0;
  background: var(--ka-shop-brown);
  color: #f8ead8;
}

.ka-store-footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
}

.ka-store-footer strong {
  color: #fff;
  font-size: 20px;
}

.ka-store-footer p {
  max-width: 560px;
  margin: 7px 0 0;
  color: #e6d4bf;
  font-size: 14px;
  line-height: 1.55;
}

.ka-store-footer__contact {
  display: grid;
  gap: 7px;
  text-align: right;
}

/* 修改页脚政策链接：这里控制 Shipping / FAQ / Privacy / Terms 的排列。 */
.ka-store-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  width: min(1120px, calc(100% - 28px));
  margin: 22px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 244, 232, .18);
}

.ka-store-footer__legal a {
  color: #f6e7d5;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.ka-store-footer a {
  color: #fff4e8;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.ka-store-footer a:hover,
.ka-store-footer a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 680px) {
  .ka-store-footer {
    padding: 24px 0 92px;
  }

  .ka-store-footer__inner {
    display: grid;
    gap: 16px;
    width: calc(100% - 28px);
  }

  .ka-store-footer__contact {
    text-align: left;
  }

  .ka-store-footer__legal {
    justify-content: flex-start;
    margin-top: 18px;
  }
}

/* =========================================================
   9. 产品价格口径和正式产品描述
   修改文字：在主插件文件 ka_storefront_render_price_context 与产品 copy 中修改。
   ========================================================= */
.ka-product-price-context {
  margin: 0 0 7px !important;
  color: var(--ka-shop-green-dark) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .045em !important;
  line-height: 1.35 !important;
  text-transform: uppercase !important;
}

.ka-product-description p {
  margin: 0 0 14px !important;
}

.ka-product-description ul {
  margin: 0 0 16px 1.15rem !important;
  padding: 0 !important;
  color: var(--ka-shop-muted) !important;
  line-height: 1.65 !important;
}

.ka-product-description li + li {
  margin-top: 5px !important;
}

.ka-product-description .ka-product-price-note {
  margin: 18px 0 0 !important;
  padding: 14px 16px !important;
  border-left: 4px solid var(--ka-shop-green) !important;
  border-radius: 0 12px 12px 0 !important;
  background: #edf8f3 !important;
  color: var(--ka-shop-green-dark) !important;
  font-weight: 700 !important;
}

/* =========================================================
   10. Shipping / FAQ / Privacy / Terms / Samples 普通说明页
   修改内容：在主插件文件 ka_storefront_information_pages 中修改。
   ========================================================= */
body.page .ka-info-page {
  width: min(920px, calc(100% - 28px));
  margin: 34px auto 58px;
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid var(--ka-shop-line);
  border-radius: 24px;
  background: var(--ka-shop-card);
  box-shadow: 0 18px 48px rgba(45, 33, 24, .07);
}

/* Astra 会在正文上方自动再输出一次标题；说明页只保留卡片中的 H1。 */
body.ka-store-info-page-template .site-main > article > .entry-header {
  display: none !important;
}

.ka-info-page .ka-info-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--ka-shop-green-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ka-info-page h1 {
  margin: 0 0 20px;
  color: var(--ka-shop-ink);
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.04;
  letter-spacing: -.035em;
}

.ka-info-page h2 {
  margin: 30px 0 10px;
  color: var(--ka-shop-ink);
  font-size: clamp(22px, 3vw, 29px);
  line-height: 1.2;
}

.ka-info-page p,
.ka-info-page li {
  color: var(--ka-shop-muted);
  font-size: 16px;
  line-height: 1.72;
}

.ka-info-page a:not(.button) {
  color: var(--ka-shop-green-dark);
}

.ka-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.ka-info-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 20px !important;
  border: 1px solid var(--ka-shop-green) !important;
  border-radius: 999px !important;
  background: var(--ka-shop-green) !important;
  color: #fff !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

.ka-info-actions .ka-info-button-secondary {
  background: #fff !important;
  color: var(--ka-shop-green-dark) !important;
}

@media (max-width: 520px) {
  body.page .ka-info-page {
    width: calc(100% - 16px);
    margin: 16px auto 34px;
    padding: 22px 17px;
    border-radius: 17px;
  }

  .ka-info-actions .button {
    flex: 1 1 100%;
  }
}

/* =========================================================
   11. 空购物车
   ========================================================= */
body.woocommerce-cart {
  background: var(--ka-shop-cream);
}

.ka-empty-cart-help {
  width: min(760px, calc(100% - 28px));
  margin: 28px auto 48px;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--ka-shop-line);
  border-radius: 22px;
  background: var(--ka-shop-card);
  text-align: center;
}

.ka-empty-cart-help h1 {
  margin: 0 0 12px;
  color: var(--ka-shop-ink);
}

.ka-empty-cart-help p {
  color: var(--ka-shop-muted);
  line-height: 1.6;
}

.ka-empty-cart-help .ka-continue-shopping {
  margin-top: 10px !important;
  padding: 12px 22px !important;
  border-radius: 999px !important;
  background: var(--ka-shop-green) !important;
  color: #fff !important;
  font-weight: 800 !important;
}

/* =========================================================
   12. 1.1.2 单品页完整视觉：米白页面 + 圆角内容卡
   这里使用较高优先级，覆盖旧 wp-custom-css 中残留的纯白/蓝色规则。
   ========================================================= */
html body.single-product:not(.postid-3671) {
  background: #fff5e8 !important;
  color: var(--ka-shop-ink) !important;
}

html body.single-product:not(.postid-3671) .site-content,
html body.single-product:not(.postid-3671) .site-content > .ast-container,
html body.single-product:not(.postid-3671) main#main > .ast-woocommerce-container,
html body.single-product:not(.postid-3671) main#main {
  background: #fff5e8 !important;
}

html body.single-product:not(.postid-3671) main#main div.product {
  width: min(1180px, 100%) !important;
  max-width: 1180px !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding: 28px 16px 58px !important;
  box-sizing: border-box !important;
}

html body.single-product:not(.postid-3671)
  main#main div.product > .ka-mobile-product-intro,
html body.single-product:not(.postid-3671)
  main#main div.product > .woocommerce-product-gallery,
html body.single-product:not(.postid-3671)
  main#main div.product > .summary.entry-summary,
html body.single-product:not(.postid-3671)
  .woocommerce-Tabs-panel--description,
html body.single-product:not(.postid-3671)
  .related.products {
  box-sizing: border-box !important;
  border: 1px solid var(--ka-shop-line) !important;
  border-radius: 20px !important;
  background: var(--ka-shop-card) !important;
  box-shadow: 0 12px 30px rgba(75, 50, 28, .07) !important;
}

html body.single-product:not(.postid-3671)
  main#main div.product > .woocommerce-product-gallery {
  overflow: visible !important;
}

html body.single-product:not(.postid-3671)
  main#main div.product > .summary.entry-summary {
  padding: clamp(22px, 2.6vw, 34px) !important;
}

html body.single-product:not(.postid-3671)
  .summary.entry-summary .price {
  margin: 5px 0 20px !important;
  color: var(--ka-shop-green-dark) !important;
  font-size: clamp(27px, 3.2vw, 38px) !important;
  font-weight: 900 !important;
  line-height: 1.08 !important;
}

html body.single-product:not(.postid-3671)
  .summary.entry-summary .woocommerce-product-details__short-description {
  margin-top: 22px !important;
  padding-top: 18px !important;
  border-top: 1px solid var(--ka-shop-line) !important;
  color: var(--ka-shop-muted) !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
}

html body.single-product:not(.postid-3671)
  .summary.entry-summary .product_meta {
  margin-top: 20px !important;
  padding-top: 16px !important;
  border-top: 1px solid var(--ka-shop-line) !important;
  color: var(--ka-shop-muted) !important;
}

html body.single-product:not(.postid-3671)
  .woocommerce-Tabs-panel--description {
  margin-top: 18px !important;
  padding: clamp(22px, 4vw, 42px) !important;
}

html body.single-product:not(.postid-3671) .related.products {
  margin-top: 22px !important;
  padding: clamp(18px, 3vw, 28px) !important;
}

/* =========================================================
   13. 1.1.2 紧凑 SKU：按文字自然宽度排列，文字始终居中
   ========================================================= */
html body.single-product:not(.postid-3671)
  .summary form.variations_form table.variations,
html body.single-product:not(.postid-3671)
  .summary form.variations_form table.variations tbody,
html body.single-product:not(.postid-3671)
  .summary form.variations_form table.variations tr,
html body.single-product:not(.postid-3671)
  .summary form.variations_form table.variations th,
html body.single-product:not(.postid-3671)
  .summary form.variations_form table.variations td {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  border: 0 !important;
}

html body.single-product:not(.postid-3671)
  .summary form.variations_form table.variations th.label {
  padding: 0 0 9px !important;
  color: var(--ka-shop-brown) !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.3 !important;
  text-align: left !important;
}

html body.single-product:not(.postid-3671)
  .summary form.variations_form table.variations td.value {
  padding: 0 0 14px !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  grid-template-columns: none !important;
  gap: 8px 7px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button .wpcvs-term {
  flex: 0 1 auto !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 36px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  border: 1px solid var(--ka-shop-line) !important;
  border-radius: 9px !important;
  background: #fffaf3 !important;
  box-shadow: none !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button .wpcvs-term-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  max-width: 100% !important;
  min-height: 34px !important;
  height: auto !important;
  padding: 6px 11px !important;
  box-sizing: border-box !important;
  color: var(--ka-shop-brown) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.22 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  text-decoration: none !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button .wpcvs-term-label {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  font: inherit !important;
  line-height: inherit !important;
  text-align: center !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: break-word !important;
  text-decoration: none !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-enabled:not(.wpcvs-disabled) {
  opacity: 1 !important;
  cursor: pointer !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-enabled:not(.wpcvs-disabled) .wpcvs-term-inner,
html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-enabled:not(.wpcvs-disabled) .wpcvs-term-label {
  text-decoration: none !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-selected {
  border: 2px solid var(--ka-shop-green) !important;
  background: #edf8f3 !important;
  box-shadow: 0 0 0 2px rgba(40, 119, 97, .1) !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-selected .wpcvs-term-inner,
html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-selected .wpcvs-term-label {
  color: var(--ka-shop-green-dark) !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-disabled {
  border-color: #ddd6ce !important;
  background: #f3f0eb !important;
  opacity: .66 !important;
  cursor: not-allowed !important;
}

html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-disabled .wpcvs-term-inner,
html body.single-product:not(.postid-3671)
  form.variations_form .wpcvs-terms.wpcvs-type-button
  .wpcvs-term.wpcvs-disabled .wpcvs-term-label {
  color: #9f968d !important;
  text-decoration: line-through !important;
}

/* =========================================================
   14. 数量与 Add to cart：同高、绿色实心、清晰圆角
   ========================================================= */
html body.single-product:not(.postid-3671)
  .summary form.variations_form .single_variation_wrap {
  margin-top: 4px !important;
  padding-top: 18px !important;
  border-top: 1px solid var(--ka-shop-line) !important;
}

html body.single-product:not(.postid-3671)
  .summary form.variations_form
  .woocommerce-variation-add-to-cart.variations_button {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 50px !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body.single-product:not(.postid-3671)
  .summary form.variations_form .quantity {
  float: none !important;
  flex: 0 0 64px !important;
  width: 64px !important;
  height: 50px !important;
  margin: 0 !important;
}

html body.single-product:not(.postid-3671)
  .summary form.variations_form .quantity input.qty {
  width: 64px !important;
  height: 50px !important;
  min-height: 50px !important;
  margin: 0 !important;
  padding: 8px 5px !important;
  box-sizing: border-box !important;
  border: 1px solid var(--ka-shop-line) !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--ka-shop-ink) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
  box-shadow: none !important;
}

html body.single-product
  .summary form.cart
  .single_add_to_cart_button.button.alt {
  float: none !important;
  display: flex !important;
  flex: 1 1 auto !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 50px !important;
  height: 50px !important;
  margin: 0 !important;
  padding: 9px 20px !important;
  box-sizing: border-box !important;
  border: 1px solid var(--ka-shop-green) !important;
  border-radius: 999px !important;
  background: var(--ka-shop-green) !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  letter-spacing: .02em !important;
  text-align: center !important;
  text-transform: none !important;
  box-shadow: 0 8px 20px rgba(31, 96, 79, .22) !important;
}

html body.single-product
  .summary form.cart
  .single_add_to_cart_button.button.alt:hover,
html body.single-product
  .summary form.cart
  .single_add_to_cart_button.button.alt:focus-visible {
  border-color: var(--ka-shop-green-dark) !important;
  background: var(--ka-shop-green-dark) !important;
}

html body.single-product
  .summary form.cart
  .single_add_to_cart_button.button.alt.disabled,
html body.single-product
  .summary form.cart
  .single_add_to_cart_button.button.alt.wc-variation-selection-needed,
html body.single-product
  .summary form.cart
  .single_add_to_cart_button.button.alt:disabled,
html body.single-product
  .summary form.cart
  .single_add_to_cart_button.button.alt[disabled] {
  border-color: var(--ka-shop-green) !important;
  background: var(--ka-shop-green) !important;
  color: #fff !important;
  opacity: .58 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

/* =========================================================
   15. 全站手机底部：唯一购物车 + 唯一询价按钮
   ========================================================= */
html body a.ka-sticky-whatsapp,
html body a.ka-sticky-cart,
html body [class~="ka-sticky-cart"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.ka-global-quote {
  display: none;
}

/* Contact 页面已有正文 WhatsApp / Email 按钮和统一右下询价按钮，隐藏旧的大号重复悬浮条。 */
html body.page-id-4713 a.ka-final-sticky-whatsapp {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 767px) {
  html body .xoo-wsc-basket {
    left: 14px !important;
    right: auto !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 15px !important;
    background: var(--ka-shop-green) !important;
    z-index: 99998 !important;
  }

  html body .ka-global-quote {
    position: fixed !important;
    right: 14px !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 99997 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 156px !important;
    min-height: 50px !important;
    padding: 10px 18px !important;
    box-sizing: border-box !important;
    border: 1px solid var(--ka-shop-green) !important;
    border-radius: 999px !important;
    background: var(--ka-shop-green) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: .01em !important;
    text-align: center !important;
    text-decoration: none !important;
    box-shadow: 0 8px 24px rgba(31, 96, 79, .25) !important;
  }

  html body.single-product:not(.postid-3671) main#main div.product {
    padding: 10px 12px 76px !important;
  }

  html body.single-product:not(.postid-3671)
    main#main div.product > .ka-mobile-product-intro {
    width: 100% !important;
    margin: 0 0 10px !important;
    padding: 14px 15px !important;
    border-radius: 17px !important;
  }

  html body.single-product:not(.postid-3671)
    .ka-mobile-product-intro .ka-mobile-product-badge {
    margin-bottom: 9px !important;
    padding: 7px 10px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
  }

  html body.single-product:not(.postid-3671)
    .ka-mobile-product-intro .woocommerce-breadcrumb {
    margin: 0 0 8px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  html body.single-product:not(.postid-3671)
    .ka-mobile-product-intro .product_title {
    margin: 0 !important;
    font-size: clamp(27px, 8vw, 34px) !important;
    line-height: 1.06 !important;
  }

  html body.single-product:not(.postid-3671)
    main#main div.product > .woocommerce-product-gallery,
  html body.single-product:not(.postid-3671)
    main#main div.product > .summary.entry-summary {
    float: none !important;
    width: 100% !important;
    margin: 0 0 10px !important;
    border-radius: 17px !important;
  }

  html body.single-product:not(.postid-3671)
    main#main div.product > .summary.entry-summary {
    padding: 18px 16px 22px !important;
  }

  html body.single-product:not(.postid-3671)
    form.variations_form .wpcvs-terms.wpcvs-type-button .wpcvs-term-inner {
    min-height: 32px !important;
    padding: 5px 9px !important;
    font-size: 13px !important;
  }
}
