/* SM WhatsApp Popover \u2014 anima\u00e7\u00f5es e posicionamento (sem equivalente nativo Bricks) */

.sm-wa-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    left: auto;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
    gap: 0.75rem;
}
.sm-wa-fab__button { order: 2; }
.sm-wa-fab__cta { order: 1; }

/* Bot\u00e3o circular flutuante */
.sm-wa-fab__button {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background-color: #25D366;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
    transition: background-color .2s ease, box-shadow .2s ease;
}
.sm-wa-fab__button:hover {
    background-color: #128C7E;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.sm-wa-fab__icon {
    position: absolute;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: opacity .15s ease;
}
.sm-wa-fab__icon--close {
    width: 22px;
    height: 22px;
    opacity: 0;
}
.sm-wa-fab__button[aria-expanded="true"] .sm-wa-fab__icon--open {
    opacity: 0;
}
.sm-wa-fab__button[aria-expanded="true"] .sm-wa-fab__icon--close {
    opacity: 1;
}

/* CTA tooltip ao lado do bot\u00e3o */
.sm-wa-fab__cta {
    background: #fff;
    color: #1A1A1A;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    white-space: nowrap;
    transition: opacity .2s ease;
}
.sm-wa-fab__cta strong {
    font-weight: 700;
}
.sm-wa-fab:has(.sm-wa-fab__button[aria-expanded="true"]) .sm-wa-fab__cta {
    opacity: 0;
    pointer-events: none;
}

/* Popover content */
.sm-wa-fab__content {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    right: 0;
    left: auto;
    min-width: 340px;
    max-width: 92vw;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(20, 22, 31, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s .2s;
}
.sm-wa-fab__content--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .2s ease, transform .2s ease, visibility 0s 0s;
}

/* Header verde dentro da popover */
.sm-wa-fab__content > .brxe-heading.sm-wa-fab__header,
.sm-wa-fab__content > h1.sm-wa-fab__header,
.sm-wa-fab__content > h2.sm-wa-fab__header,
.sm-wa-fab__content > h3.sm-wa-fab__header,
.sm-wa-fab__content > h4.sm-wa-fab__header {
    margin: 0;
    padding: 14px 16px;
    background: #25D366;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.3;
}

/* Form dentro da popover */
.sm-wa-fab__content .brxe-form {
    padding: 18px 16px 22px;
    background: #fff;
    margin: 0;
}
.sm-wa-fab__content .brxe-form .form-group {
    margin-bottom: 10px;
    animation: none !important;
    transition: none !important;
}
.sm-wa-fab__content .brxe-form input[type="text"],
.sm-wa-fab__content .brxe-form input[type="tel"],
.sm-wa-fab__content .brxe-form input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #DDDDE3;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #201140;
    box-sizing: border-box;
    transition: border-color .15s ease;
    animation: none !important;
    transform: none !important;
}
.sm-wa-fab__content .brxe-form input[type="text"]:focus,
.sm-wa-fab__content .brxe-form input[type="tel"]:focus {
    outline: none;
    border-color: #25D366;
}
.sm-wa-fab__content .brxe-form .options-wrapper {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sm-wa-fab__content .brxe-form .options-wrapper li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.sm-wa-fab__content .brxe-form .options-wrapper input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}
.sm-wa-fab__content .brxe-form .options-wrapper label {
    font-size: 12px;
    line-height: 1.45;
    color: #57575F;
}
.sm-wa-fab__content .brxe-form .submit-button-wrapper {
    margin-top: 14px;
}
.sm-wa-fab__content .brxe-form button[type="submit"],
.sm-wa-fab__content .brxe-form .bricks-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease;
    animation: none !important;
    transform: none !important;
}
.sm-wa-fab__content .brxe-form button[type="submit"]:hover,
.sm-wa-fab__content .brxe-form .bricks-button:hover {
    background: #128C7E;
}
.sm-wa-fab__content .brxe-form .bricks-button .loading {
    display: none !important;
}

/* Responsive: tablet */
@media (max-width: 991px) {
    .sm-wa-fab__cta {
        font-size: 13px;
        padding: 0.4rem 0.7rem;
    }
}

/* Responsive: mobile */
@media (max-width: 478px) {
    .sm-wa-fab {
        bottom: 1rem;
        right: 1rem;
        left: auto;
        gap: 0.5rem;
    }
    .sm-wa-fab__button {
        width: 54px;
        height: 54px;
    }
    .sm-wa-fab__icon {
        width: 26px;
        height: 26px;
    }
    .sm-wa-fab__cta {
        display: none;
    }
    .sm-wa-fab__content {
        min-width: calc(100vw - 2rem);
    }
}


/* ================================================================ */
/* WhatsApp Floating FAB Attention Animations                       */
/* ================================================================ */
@keyframes smWaPulse {
  0% {
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35), 0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  50% {
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35), 0 0 0 14px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35), 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

@keyframes smWaWobble {
  0%, 100% { transform: scale(1); }
  4% { transform: scale(1.1) rotate(-8deg); }
  8% { transform: scale(1.1) rotate(8deg); }
  12% { transform: scale(1.1) rotate(-8deg); }
  16% { transform: scale(1.1) rotate(8deg); }
  20% { transform: scale(1) rotate(0); }
}

.sm-wa-fab__button {
  animation: smWaPulse 2s infinite, smWaWobble 6s infinite ease-in-out;
}

/* Stop animations when hover or active or popover is open to prevent distraction */
.sm-wa-fab__button:hover {
  animation-play-state: paused !important;
}

.sm-wa-fab__button[aria-expanded="true"] {
  animation: none !important;
}
