/* ==========================================================================
   M25-01 · Global Footer Grey-Fog Eradication
   Root cause: .site-footer::before starfield was painted at
   top: calc(-1 * clamp(320px, 28vw, 460px)) with overflow:visible, so the
   nebula/gradient washed over the bottom of quote.html's form and over the
   homepage enquiry block. Fix: trap every layer strictly inside the footer.

   Loaded by the canonical footer partial (body-level link) so it lands after
   styles.css in the cascade. High-specificity + !important overrides the
   legacy `.site-footer { overflow: visible !important }` rule.
   ========================================================================== */

html body footer.site-footer,
html body .site-footer {
  position: relative !important;
  z-index: 1 !important;
  margin-top: 0 !important;       /* was 16px inline on home; no gap = no exposed wash */
  overflow: hidden !important;    /* CRITICAL: clips starfield + gradients to the footer box */
  isolation: isolate !important;  /* own stacking context: no bleed into main / CTA */
}

/* Zero upward overflow for every pseudo-element layer that can paint a wash.
   Covers the starfield canvas (::before), the bottom scrim (::after), and the
   legacy .footer-starfield element if a page still carries one. */
html body .site-footer::before,
html body .site-footer::after,
html body footer::before,
html body footer::after,
html body .footer-starfield {
  top: 0 !important;
  margin-top: 0 !important;
  transform: none !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

/* The darkening scrim is anchored to the footer bottom; keep it there and
   inside the box. It must never extend above the footer top edge. */
html body .site-footer::after {
  bottom: 0 !important;
  top: auto !important;
}

/* Content sits above every trapped decorative layer. */
html body .site-footer > * {
  position: relative !important;
  z-index: 2 !important;
}

/* Narrow screens had top:-240px; override that too — no exception by breakpoint. */
@media (max-width: 900px) {
  html body .site-footer::before { top: 0 !important; }
}

/* ==========================================================================
   M25-R1 · R1-03 · SEAMLESS MIDNIGHT STARFIELD FOOTER CTA
   --------------------------------------------------------------------------
   The old Enquiries band was an opaque #0D0C0A block above the footer. Its
   hard bottom edge sliced the golden FY mark in the starfield artwork in half.
   Replacement: one continuous starfield canvas INSIDE the footer, with a
   narrow dark-glass CTA strip floating in the sky above the artwork.

   Geometry contract (artwork = starfield-alpha-*.webp, 1920x1226):
     golden FY mark top  y = 0.5791 x image height
     golden FY mark base y = 0.6835 x image height
     image height at desktop = 63.854vw  (100% width, 1226/1920 ratio)
   The canvas is pinned to the footer TOP (not bottom), so the CTA-to-logo
   clearance stays 64px at every desktop width and the footer may grow with
   its content without moving the artwork.
   ========================================================================== */

/* 1. The opaque enquiry / console bands above the footer are retired.
      Their conversion copy now lives in the glass CTA inside the footer.
      Scoped to direct children of main so no in-article CTA is touched. */
html body main > .fy3-endcap,
html body main > .cta-band,
html body main > .cta-band--console,
html body main > .pdp-console-sec {
  display: none !important;
}

/* 2. Footer box: keep the M25 containment (overflow hidden + margin-top 0),
      but give the sky a deterministic 32px head room for the CTA strip. */
html body .site-footer {
  padding-top: 32px !important;
  background-color: #08090b !important;
}

/* 3. ONE continuous starfield canvas. Remove the old radial spot layers:
      the glass CTA supplies its own contrast, and a single image layer makes
      the 64px clearance arithmetic exact. */
html body .site-footer::before {
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: 0 !important;
  z-index: 0 !important;
  background-color: transparent !important;
  background-image: image-set(
    url("./img/footer/starfield-alpha-1280w.webp") 1x,
    url("./img/footer/starfield-alpha-1920w.webp") 2x,
    url("./img/footer/starfield-alpha-2560w.webp") 3x
  ) !important;
  background-repeat: no-repeat !important;
  background-size: 100% auto !important;
  /* CTA bottom measured 32 + 84.9 = 116.9px; +64px breathing = logo top at 181px.
     Logo top in the artwork = 0.5791 x 63.854vw = 37vw. */
  background-position: center calc(181px - 37vw) !important;
}

/* 4. CTA strip: extremely narrow full-width dark glass, floating on the sky. */
html body .site-footer .fy-moonlight-cta {
  box-sizing: border-box;
  width: calc(100% - 48px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
  flex-wrap: wrap;
  border: 1px solid rgba(200, 161, 101, .22) !important;
  border-radius: 16px;
  background: rgba(14, 14, 16, .58) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 34px -20px rgba(0, 0, 0, .9);
  color: #f3efe8;
}

html body .site-footer .fy-moonlight-cta__eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #c8a165;
}
html body .site-footer .fy-moonlight-cta__title {
  margin: 0;
  font-family: Georgia, 'Noto Serif TC', serif;
  font-size: clamp(19px, 1.7vw, 26px);
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
}
html body .site-footer .fy-moonlight-cta__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
html body .site-footer .fy-mf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease;
}
html body .site-footer .fy-mf-btn--gold {
  background: #c8a165;
  color: #141311;
  border: 1px solid #c8a165;
}
html body .site-footer .fy-mf-btn--gold:hover { background: #e0bd86; }
html body .site-footer .fy-mf-btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .30);
}
html body .site-footer .fy-mf-btn--ghost:hover { border-color: #fff; }

/* 5. Push the link columns below the full golden mark + moonlight beam.
      Logo base = 181px + 0.1044 x 63.854vw = 181px + 6.7vw.
      CTA bottom = 104px, so a 40px gap after the mark needs
      margin-top = 104px + 6.7vw. */
html body .site-footer > .container {
  margin-top: calc(104px + 6.7vw) !important;
  padding-bottom: 10px !important;   /* M26-R2 P0-5：32 → 10，见文件末段 */
}
/* The artwork stays whole; only the area BEHIND the link columns gets a soft
   local scrim so white type never sits on a moonlit highlight. The sky, the
   golden mark, the beam and the bottles above this edge stay untouched. */
html body .site-footer > .container::before {
  content: "";
  position: absolute;
  inset: -24px 0 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(8, 8, 9, 0) 0%,
    rgba(8, 8, 9, .58) 10%,
    rgba(8, 8, 9, .84) 26%,
    rgba(8, 8, 9, .92) 100%);
}

/* 6. Subscribe box: dark frosted glass, high-contrast, anti-glare.
      The moonlight beam used to land on a pale inset frame and wash the field
      out. Both the outer row and the input get a dark matte backdrop. */
html body .site-footer .foot-sub__row {
  background: rgba(9, 10, 12, .86) !important;
  box-shadow: inset 0 0 0 1px rgba(200, 161, 101, .34) !important;
  backdrop-filter: blur(10px) saturate(.85);
  -webkit-backdrop-filter: blur(10px) saturate(.85);
}
html body .site-footer .foot-sub__row:focus-within {
  background: rgba(9, 10, 12, .94) !important;
  box-shadow: inset 0 0 0 1px rgba(200, 161, 101, .70) !important;
  transform: none !important;
}
html body .site-footer .foot-sub__input {
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
}
html body .site-footer .foot-sub__input::placeholder {
  color: rgba(255, 255, 255, .78) !important;
  opacity: 1 !important;
}
html body .site-footer .foot-sub__btn {
  background: #f7f4ee !important;
  color: #141311 !important;
}
html body .site-footer .foot-sub__label,
html body .site-footer .foot-sub__note {
  color: rgba(255, 255, 255, .92) !important;
}

/* 7. Mobile: enlarge the same artwork so the mark still has a full sky band
      above it. Artwork width = 180% = 1.8W; mark centre sits at 0.76 x 1.8W
      = 1.368W, so x = -86.8vw centres the whole mark in the viewport.
      Artwork height = 0.639 x 1.8W = 115vw; mark top = 66.6vw.
      CTA bottom measured 20 + 204.7 = 224.7px; +64px = logo top at 289px. */
@media (max-width: 900px) {
  html body .site-footer {
    padding-top: 20px !important;
  }
  html body .site-footer::before {
    background-size: 180% auto !important;
    background-position: -86.8vw calc(289px - 66.6vw) !important;
  }
  html body .site-footer .fy-moonlight-cta {
    width: calc(100% - 28px);
    padding: 14px 18px;
    gap: 12px;
  }
  html body .site-footer .fy-moonlight-cta__title {
    font-size: 18px;
  }
  html body .site-footer .fy-moonlight-cta__actions {
    width: 100%;
  }
  html body .site-footer .fy-mf-btn {
    flex: 1 1 auto;
  }
  /* Legacy mobile rule stretched the subscribe arrow to the full row width,
     collapsing the email field to 24px and leaving a pale pill. Restore the
     dark frosted field with a compact 44px arrow. */
  html body .site-footer .foot-sub__row { padding-left: 16px !important; }
  html body .site-footer .foot-sub__btn {
    width: 44px !important;
    flex: 0 0 44px !important;
  }
  /* Mark base = 289px + 0.1044 x 115vw = 289px + 12vw. */
  html body .site-footer > .container {
    margin-top: calc(112px + 12vw) !important;
  }
  /* Stacked columns start right under the water reflection on a phone:
     darken from just below the golden mark so the tagline stays legible. */
  html body .site-footer > .container::before {
    inset: -30px 0 0;
    background: linear-gradient(180deg,
      rgba(8, 8, 9, .68) 0%,
      rgba(8, 8, 9, .88) 14%,
      rgba(8, 8, 9, .94) 100%);
  }
}

/* ==========================================================================
   M26-R2 · P0-5 页尾版权栏下方 120px+ 纯黑死块物理根治（task-43）
   --------------------------------------------------------------------------
   修复前实测（1440，真 DOM，2026-11-26）：
     footer.site-footer 高 930.73px、padding-bottom **114px**；
     版权行「© 2026 Guangzhou Fuyao Packaging Products Co., Ltd.」bottom=11526.06，
     footer bottom=11683.56 → 版权行下方 **157.5px 纯黑死块**（1919 档 157.5、390 档 221）。
   根因是两处历史「给旧底部 CTA 胶囊让位」的固定内边距叠加：
     · floating-cta-v2.css `.site-footer{padding-bottom: calc(var(--space-xl) + 78px)}`
       + `@media (max-width:900px)` 的 +120px  → 114px（桌面）/ 136px（窄屏）
     · m15-mobile.css `@media (max-width:768px) .site-footer{padding-bottom:84px}`
     · footer-mask-fix.css 自身 `> .container{padding-bottom:32px}`（第 188 行）
     三者相加 = 桌面 146 / 窄屏 116~168，而 M26-04 之后底部只剩一枚 52px 圆钮
     （bottom:22px，总占高 74px），旧胶囊早已退役 —— 这段预留已无对应物。
   修法（只改本文件，不碰 floating-cta 与 m15-mobile 的写域）：
     ① 用 `html body` 提高特异性压掉上面两条旧预留：页尾 padding-bottom 10px；
     ② 容器底部内边距 32px → 10px（同一文件内直接改，语义不变）；
     ③ 不再用「底部留 100px 空白」给圆钮让位，改为**横向避让**：
        ≤1700px 时给 .foot-bottom 留 84px 右内边距（52 圆钮 + 22 底距 + 10 呼吸），
        法务链接与版权字始终在圆钮左侧，点击命中不受影响（lead-m9-overlap 同判据；
        1440 实测圆钮 left=1366 < 法务右缘 1382.4 → 确有相交，故安全区扩到 1700）。
     ④ ≤1100px 时 .foot-bottom 的 flex-wrap 会把「Cosmetic…」与法务链接换到版权行
        下方，版权行就不再是最底元素 → 改为单列并把 © 排到最后一行
        （顺序：Cosmetic · OEM/ODM → Policies Privacy Terms → © 2026…）。
   ⚠️ 不动星空 / 月光 / 金色 FY / 草地玻璃瓶：`::before` 画布锚在页尾**顶部**
      （background-position: center calc(181px - 37vw)，见本文件第 108 行），
      减掉的全是页尾底部那块本来就没有画布的黑区。
   实测（修复后，footer.bottom − 版权行.bottom）：
     1920 = 31.5px（原 157.5）、1440 = 31.5px（原 157.5）、
     900 = 20px、768 = 20px、390 = 20px（原 221）；全部 <= 36px。
     FY Logo / 月光 / 星空 / 草地玻璃瓶全部完整（实拍见交接单附图）。
   ========================================================================== */
html body .site-footer {
  padding-bottom: 10px !important;
  min-height: 0 !important;
}
html body .site-footer > .container {
  padding-bottom: 10px !important;
}
html body .site-footer .foot-bottom {
  padding-bottom: 0 !important;
}
/* ≤1100 档：.foot-bottom 的 flex-wrap 会把「Cosmetic…」和法务链接换行到
   版权行下方 —— 版权行就落不到最底，净空被后面两行重新撑到 130px+。
   这里显式改成单列，并把版权行排到最后一行：
     · 视觉顺序变成「Cosmetic · OEM/ODM → Policies Privacy Terms → © 2026…」，
       © 成为整页最后一行，这也是移动端页尾最常见的收口方式；
     · 净空 = 页尾 10px 内边距 + 版权行自身 2px 内边距 ≈ 12px，恒 <= 36px；
     · 同时留 84px 右侧安全区给 52px 圆钮（bottom:22 → 顶边距页尾底 74px），
       版权行与法务链接都不会被圆钮压住（elementFromPoint 中心点命中同判据）。 */
@media (max-width: 1700px) {
  /* 52px 圆钮 left = vw − 74px；.container 右缘 = (vw + min(1488, 0.92vw))/2。
     两者在 <1690px 档必然相交（1440 实测圆钮 left=1366 < 法务右缘 1382.4），
     所以 1700 以下统一给底部行留 84px 右安全区，>1700 保持原三列排布不动。 */
  html body .site-footer .foot-bottom {
    padding-right: 84px !important;
  }
}
@media (max-width: 1100px) {
  html body .site-footer .foot-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }
  html body .site-footer .foot-bottom > span:first-child {
    order: 3 !important;
    flex: 0 0 auto !important;
  }
}
