/**
 * 8E8 + 8E9 + 8G3 Phase A — Floating back-to-top + WhatsApp (desktop: horizontal row).
 * Back-to-top: Cab gold / dark (no legacy blue).
 * Markup: resources/views/site/inc/footer.blade.php (.cab8e8-float-stack).
 * JS: public/js/lamar.js binds #return-to-top only (unchanged).
 */

.cab8e8-float-stack {
  position: fixed;
  z-index: 99999;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 24px));
  right: max(24px, calc(env(safe-area-inset-right, 0px) + 24px));
  pointer-events: none;
}

.cab8e8-float-stack > * {
  pointer-events: auto;
}

/* Back-to-top: body + stack + id beats head-loaded #return-to-top (style.css). */
body .cab8e8-float-stack #return-to-top,
body.home-page.cab8b5-v2-shell .cab8e8-float-stack #return-to-top {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  display: none;
  border-radius: 50%;
  background: #fcb142 !important;
  color: #111111 !important;
  border: 1px solid transparent;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  text-decoration: none !important;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease, box-shadow 0.2s ease;
}

body .cab8e8-float-stack #return-to-top:hover,
body.home-page.cab8b5-v2-shell .cab8e8-float-stack #return-to-top:hover {
  background: #111111 !important;
  color: #fcb142 !important;
  border: 1px solid #fcb142 !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

body .cab8e8-float-stack #return-to-top:active,
body.home-page.cab8b5-v2-shell .cab8e8-float-stack #return-to-top:active {
  transform: translateY(1px);
}

body .cab8e8-float-stack #return-to-top .cab8e8-float-stack__top-icon,
body.home-page.cab8b5-v2-shell
  .cab8e8-float-stack
  #return-to-top
  .cab8e8-float-stack__top-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  font-style: normal;
  font-family: system-ui, "Segoe UI", sans-serif;
}

/* WhatsApp: reset legacy fixed corners when inside stack */
.cab8e8-float-stack .wspMobs {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  margin: 0 !important;
  font-size: 0;
  line-height: 0;
}

.cab8e8-float-stack .wspMobs i {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px;
  min-height: 48px;
  line-height: 48px !important;
  font-size: 0 !important;
  margin: 0 !important;
  border-radius: 50%;
  background: #25d366 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.cab8e8-float-stack .wspMobs i:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.cab8e8-float-stack .wspMobs i .cab8e6-wa-svg {
  width: 28px !important;
  height: 28px !important;
}

@media (max-width: 575px) {
  .cab8e8-float-stack {
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 12px));
    right: max(16px, calc(env(safe-area-inset-right, 0px) + 12px));
  }

  body .cab8e8-float-stack #return-to-top,
  body.home-page.cab8b5-v2-shell .cab8e8-float-stack #return-to-top {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  body .cab8e8-float-stack #return-to-top .cab8e8-float-stack__top-icon,
  body.home-page.cab8b5-v2-shell
    .cab8e8-float-stack
    #return-to-top
    .cab8e8-float-stack__top-icon {
    font-size: 20px;
  }

  .cab8e8-float-stack .wspMobs i {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px;
    min-height: 48px;
    line-height: 48px !important;
  }

  .cab8e8-float-stack .wspMobs i .cab8e6-wa-svg {
    width: 26px !important;
    height: 26px !important;
  }
}
