/* Public document spacing ownership.
 * Fixed mobile controls overlap the viewport, so their clearance belongs after
 * the LAST document content (the footer), never on both main and its wrapper.
 * IDs deliberately outrank the !important reservations in legacy page bundles.
 * Keep section/card spacing and the fixed-control geometry intact.
 */
html[data-tmset-shell-css="v1"] body {
  padding-block-end: 0 !important;
}

html[data-tmset-shell-css="v1"] body > main#main-content {
  margin-block-end: 0 !important;
  padding-block-end: 0 !important;
}

html[data-tmset-shell-css="v1"] body > main#main-content > :is(
  .tm-washer-page, .wm-page, .tm-dw-page, .tm-fridge-page, .tm-ac-page, .tm-pkg-page
) {
  margin-block-end: 0 !important;
  padding-block-end: 0 !important;
}

html[data-tmset-shell-css="v1"] body > #tmset-footer.tmset-footer {
  margin-block-start: 0 !important;
}

@media (max-width: 1060px) {
  html[data-tmset-shell-css="v1"] body > #tmset-footer.tmset-footer {
    /* The runtime measurement also covers product/cart bars and wrapped labels.
     * CSS fallbacks protect footer links before deferred JS runs or with JS off.
     * max() chooses one reservation instead of adding overlapping dock heights.
     */
    padding-block-end: calc(max(
      var(--tmset-mobile-bottom-reserved, 88px),
      var(--tmset-service-nav-reserved, 0px),
      var(--tmset-dynamic-bottom-space, 0px),
      calc(var(--tmset-mobile-ux-fixed-space, 0px) + env(safe-area-inset-bottom, 0px)),
      calc(88px + env(safe-area-inset-bottom, 0px))
    ) + 16px) !important;
  }
}
