/*
 * Miaopian floating CTA.
 * Class prefix: mp-fcta.
 * Desktop rules are the base. Mobile rules override them at max-width 767.98px,
 * so every viewport width matches one layout. 768px is the desktop minimum.
 *
 * Desktop position and size follow the measured PPTWiki floating CTA
 * (https://www.pptwiki.com/qzoffice.html, 2026-10-28, 1280/1440/1920):
 * fixed, bottom 32px, left 50% with translateX(-50%), height 52px,
 * padding 12px 24px, 18px/600, pill radius, shadow-xl.
 * Hover scales to 1.05 while keeping translateX(-50%).
 * Button colors stay on the element style attribute.
 *
 * Puock public theme, measured 2026-10-28 from wordpress-theme-puock master:
 * #rb-float-actions { position:fixed; right:10px; bottom:50px; z-index:999; }
 * Mobile CTA raises that stack only while the mobile CTA is active.
 */

.mp-fcta__link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  margin: 0;
  border: 0;
  font: 600 15px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.mp-fcta__link:focus {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.mp-fcta__link:focus:not(:focus-visible) {
  outline: none;
}

.mp-fcta__link:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.mp-fcta--both .mp-fcta__link,
.mp-fcta--desktop .mp-fcta__link {
  position: fixed;
  z-index: 998;
  left: 50%;
  right: auto;
  bottom: 32px;
  width: auto;
  min-width: 180px;
  max-width: calc(100vw - 48px);
  min-height: 52px;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 18px;
  line-height: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.mp-fcta--both .mp-fcta__link:hover,
.mp-fcta--desktop .mp-fcta__link:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.12), 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.mp-fcta--mobile {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .mp-fcta--both .mp-fcta__link,
  .mp-fcta--desktop .mp-fcta__link,
  .mp-fcta--both .mp-fcta__link:hover,
  .mp-fcta--desktop .mp-fcta__link:hover {
    transition: none;
    transform: translateX(-50%);
  }
}

@media (max-width: 767.98px) {
  body.mp-fcta-mobile {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  body.mp-fcta-mobile #rb-float-actions {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .mp-fcta--mobile {
    display: block;
  }

  .mp-fcta--desktop {
    display: none;
  }

  .mp-fcta--mobile .mp-fcta__link,
  .mp-fcta--both .mp-fcta__link {
    position: fixed;
    z-index: 998;
    left: 12px;
    right: auto;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 24px);
    min-width: 0;
    max-width: calc(100vw - 24px);
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    transform: none;
    transition: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  }

  .mp-fcta--mobile .mp-fcta__link:hover,
  .mp-fcta--both .mp-fcta__link:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  }
}
