/* ==========================================================
   ebmnt1-floating-cta.css
   CTA ثابت أسفل يسار الصفحة: زرارين (واتساب + اتصال مباشر)
   كل زرار = أيقونة + كلمة
   smart UI: بيظهر بعد أول سكرول / نبضة على الأيقونة / لمعة عند الـ hover
   ========================================================== */

:root {
    /* ---------- ألوان ---------- */
    --ebmnt1-floating-cta-whatsapp-background-color: var(--ebmnt1-color-helper-whatsapp-green);
    --ebmnt1-floating-cta-whatsapp-text-color: var(--ebmnt1-color-helper-white);
    --ebmnt1-floating-cta-whatsapp-icon-background-color: var(--ebmnt1-color-helper-white);
    --ebmnt1-floating-cta-whatsapp-icon-color: var(--ebmnt1-color-helper-whatsapp-green);
    --ebmnt1-floating-cta-whatsapp-pulse-color: var(--ebmnt1-color-helper-white);

    --ebmnt1-floating-cta-call-background-color: var(--ebmnt1-color-secondary-yellow);
    --ebmnt1-floating-cta-call-text-color: var(--ebmnt1-color-helper-heading-dark);
    --ebmnt1-floating-cta-call-icon-background-color: var(--ebmnt1-color-primary-blue);
    --ebmnt1-floating-cta-call-icon-color: var(--ebmnt1-color-helper-white);
    --ebmnt1-floating-cta-call-pulse-color: var(--ebmnt1-color-primary-blue);

    --ebmnt1-floating-cta-shadow-color: var(--ebmnt1-color-helper-shadow);
    --ebmnt1-floating-cta-shine-color: var(--ebmnt1-color-helper-white);

    /* ---------- مقاسات ---------- */
    --ebmnt1-floating-cta-offset-inline: 0.75rem;
    --ebmnt1-floating-cta-offset-block: 0.75rem;
    --ebmnt1-floating-cta-gap: 0.6rem;
    --ebmnt1-floating-cta-icon-size: 2.4rem;
    --ebmnt1-floating-cta-icon-font-size: clamp(1.1rem, 1rem + 0.4vw, 1.4rem);
    --ebmnt1-floating-cta-font-size: clamp(0.85rem, 0.8rem + 0.25vw, 1rem);
    --ebmnt1-floating-cta-z-index: 900;
}

@media (min-width: 768px) {
    :root {
        --ebmnt1-floating-cta-offset-inline: 1.5rem;
        --ebmnt1-floating-cta-offset-block: 1.5rem;
        --ebmnt1-floating-cta-icon-size: 2.8rem;
    }
}

@keyframes ebmnt1-floating-cta-pulse {
    0% {
        transform: scale(1);
        opacity: 0.55;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

.ebmnt1-floating-cta {
    position: fixed;
    left: var(--ebmnt1-floating-cta-offset-inline);
    bottom: var(--ebmnt1-floating-cta-offset-block);
    z-index: var(--ebmnt1-floating-cta-z-index);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ebmnt1-floating-cta-gap);
}

.ebmnt1-js .ebmnt1-floating-cta {
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
}

.ebmnt1-js .ebmnt1-floating-cta.ebmnt1-is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.ebmnt1-floating-cta__button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.35em 1.1em 0.35em 0.35em;
    overflow: hidden;
    border-radius: var(--ebmnt1-radius-pill);
    font-size: var(--ebmnt1-floating-cta-font-size);
    font-weight: var(--ebmnt1-font-weight-bold);
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 20px var(--ebmnt1-floating-cta-shadow-color);
    transition: transform var(--ebmnt1-transition-base), box-shadow var(--ebmnt1-transition-base);
}

.ebmnt1-floating-cta__button::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(115deg, transparent 35%, var(--ebmnt1-floating-cta-shine-color) 50%, transparent 65%);
    background-position: 160% 0;
    background-repeat: no-repeat;
    background-size: 220% 100%;
    opacity: 0.45;
    pointer-events: none;
    transition: background-position 0.7s ease;
}

.ebmnt1-floating-cta__button:hover,
.ebmnt1-floating-cta__button:focus-visible {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 14px 28px var(--ebmnt1-floating-cta-shadow-color);
}

.ebmnt1-floating-cta__button:hover::after,
.ebmnt1-floating-cta__button:focus-visible::after {
    background-position: -60% 0;
}

.ebmnt1-floating-cta__button--whatsapp {
    background-color: var(--ebmnt1-floating-cta-whatsapp-background-color);
    color: var(--ebmnt1-floating-cta-whatsapp-text-color);
}

.ebmnt1-floating-cta__button--call {
    background-color: var(--ebmnt1-floating-cta-call-background-color);
    color: var(--ebmnt1-floating-cta-call-text-color);
}

.ebmnt1-floating-cta__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: var(--ebmnt1-floating-cta-icon-size);
    height: var(--ebmnt1-floating-cta-icon-size);
    border-radius: 50%;
    font-size: var(--ebmnt1-floating-cta-icon-font-size);
}

/* حلقة نبض حوالين الأيقونة */
.ebmnt1-floating-cta__icon::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: ebmnt1-floating-cta-pulse 2s ease-out infinite;
}

.ebmnt1-floating-cta__button--whatsapp .ebmnt1-floating-cta__icon {
    background-color: var(--ebmnt1-floating-cta-whatsapp-icon-background-color);
    color: var(--ebmnt1-floating-cta-whatsapp-icon-color);
}

.ebmnt1-floating-cta__button--whatsapp .ebmnt1-floating-cta__icon::before {
    border-color: var(--ebmnt1-floating-cta-whatsapp-pulse-color);
}

.ebmnt1-floating-cta__button--call .ebmnt1-floating-cta__icon {
    background-color: var(--ebmnt1-floating-cta-call-icon-background-color);
    color: var(--ebmnt1-floating-cta-call-icon-color);
}

.ebmnt1-floating-cta__button--call .ebmnt1-floating-cta__icon::before {
    border-color: var(--ebmnt1-floating-cta-call-pulse-color);
}

.ebmnt1-floating-cta__button:hover .ebmnt1-floating-cta__icon i {
    animation: ebmnt1-floating-cta-wiggle 0.5s ease;
}

@keyframes ebmnt1-floating-cta-wiggle {
    0%,
    100% {
        transform: rotate(0);
    }
    25% {
        transform: rotate(-14deg);
    }
    75% {
        transform: rotate(14deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ebmnt1-floating-cta__icon::before,
    .ebmnt1-floating-cta__button:hover .ebmnt1-floating-cta__icon i {
        animation: none;
    }
}
