/**
 * Melody Magic — mobile floating "Text us" CTA.
 * Hidden on >=768px. All values from theme.json design tokens.
 */

.mm-floating-cta {
    position: fixed;
    inset-inline-end: var(--wp--preset--spacing--40);
    inset-block-end: var(--wp--preset--spacing--40);
    z-index: 60;
    display: flex;
    align-items: stretch;
    background-color: var(--wp--preset--color--teal-base);
    color: var(--wp--preset--color--white);
    border-radius: var(--wp--preset--spacing--50);
    box-shadow: 0 6px 16px rgba(10, 10, 10, 0.18), 0 2px 4px rgba(10, 10, 10, 0.08);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 240ms ease, transform 240ms ease;
    max-width: calc(100vw - var(--wp--preset--spacing--40) * 2);
}

.mm-floating-cta[hidden] {
    display: none;
}

.mm-floating-cta.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Suppressed when the dark footer is in viewport so the footer's policy
   links and SMS button aren't covered. JS toggles this via IntersectionObserver
   on .mm-site-footer. Pointer-events:none keeps the CTA from intercepting
   scroll/tap during the fade. */
.mm-floating-cta.is-suppressed {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.mm-floating-cta.is-no-motion {
    transition: none;
}

/* ===== Link (primary tap target) ===================================== */

.mm-floating-cta__link {
    display: inline-flex;
    align-items: center;
    gap: var(--wp--preset--spacing--20);
    padding-block: var(--wp--preset--spacing--30);
    padding-inline: var(--wp--preset--spacing--40);
    color: var(--wp--preset--color--white);
    background-color: transparent;
    text-decoration: none;
    font-weight: 600;
    font-size: var(--wp--preset--font-size--base);
    line-height: 1.2;
    min-height: 44px;
}

.mm-floating-cta__link:hover,
.mm-floating-cta__link:focus-visible {
    background-color: var(--wp--preset--color--teal-dark);
    color: var(--wp--preset--color--white);
}

.mm-floating-cta__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.mm-floating-cta__text {
    white-space: nowrap;
}

/* ===== Dismiss ======================================================= */

.mm-floating-cta__dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    background-color: transparent;
    border: 0;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--wp--preset--color--white);
    cursor: pointer;
    padding: 0;
}

.mm-floating-cta__dismiss:hover,
.mm-floating-cta__dismiss:focus-visible {
    background-color: var(--wp--preset--color--teal-dark);
}

.mm-floating-cta__dismiss-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

/* ===== Hide on >=768px ============================================== */

@media (min-width: 768px) {
    .mm-floating-cta {
        display: none !important;
    }
}

/* ===== prefers-reduced-motion: belt + suspenders for the JS path ==== */

@media (prefers-reduced-motion: reduce) {
    .mm-floating-cta {
        transition: none;
    }
}
