/* ═══════════════════════════════════════════════════════
   Floating CTA — v3.0 — 3 Visible Floating Action Buttons
   زرار واتساب + اتصال + تواصل — ثابتة ظاهرة على اليمين
   ═══════════════════════════════════════════════════════ */

/* ── الـ Wrapper ── */
.fcta-wrap {
    position: fixed;
    left: 24px;
    bottom: 40px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

html[dir="rtl"] .fcta-wrap,
.rtl .fcta-wrap {
    left: auto;
    right: 24px;
    align-items: flex-end;
}

/* ════════════════════════════════════════
   DESKTOP — 3 Floating Circles
   ════════════════════════════════════════ */
.fcta-panel-system {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* كل زرار دائري */
.fcta-fab {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    text-decoration: none !important;
    flex-shrink: 0;
}

.fcta-fab:hover {
    transform: scale(1.12) translateY(-2px);
}

/* واتساب */
.fcta-fab--wa {
    background: linear-gradient(135deg, #25D366 0%, #1db954 100%);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.fcta-fab--wa:hover {
    box-shadow: 0 10px 28px rgba(37, 211, 102, 0.6);
}

/* اتصال */
.fcta-fab--call {
    background: linear-gradient(135deg, var(--brand-primary, #0F2742) 0%, var(--brand-primary-dark, #0A1B2E) 100%);
    box-shadow: 0 6px 20px rgba(15, 39, 66, 0.4);
}

.fcta-fab--call:hover {
    box-shadow: 0 10px 28px rgba(15, 39, 66, 0.55);
}

/* تواصل / فورم */
.fcta-fab--form {
    background: linear-gradient(135deg, var(--brand-accent, #C9A45C) 0%, #A37F38 100%);
    box-shadow: 0 6px 20px rgba(201, 164, 92, 0.4);
}

.fcta-fab--form:hover {
    box-shadow: 0 10px 28px rgba(201, 164, 92, 0.55);
}

/* Pulse Ring على الواتساب */
.fcta-fab--wa::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.4);
    animation: fabPulse 2.5s ease-out infinite;
    pointer-events: none;
}

@keyframes fabPulse {
    0%   { transform: scale(1);    opacity: 0.7; }
    70%  { transform: scale(1.35); opacity: 0;   }
    100% { transform: scale(1.35); opacity: 0;   }
}

/* ── Tooltips ── */
.fcta-fab::before {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: rgba(15, 20, 40, 0.88);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(4px);
}

html[dir="ltr"] .fcta-fab::before {
    right: auto;
    left: calc(100% + 12px);
    transform: translateY(-50%) translateX(-6px);
}

.fcta-fab:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ── إخفاء الـ trigger القديم والـ panel ── */
.fcta-trigger,
.fcta-panel,
.fcta-panel-system .fcta-trigger {
    display: none !important;
}

/* ════════════════════════════════════════
   MOBILE BOTTOM BAR
   ════════════════════════════════════════ */
.mobile-sticky-bar {
    display: none;
}

@media (max-width: 768px) {

    /* إخفاء الدوائر الـ desktop على موبايل */
    .fcta-panel-system.desktop-only {
        display: none;
    }

    /* شريط موبايل سفلي */
    .fcta-mobile-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: #fff;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
        z-index: 9999;
        align-items: center;
        gap: 0;
        min-height: 64px;
        /* Hidden until scroll */
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        border-radius: 20px 20px 0 0;
    }

    .fcta-mobile-bar.is-visible {
        transform: translateY(0);
    }

    /* Developer Info على موبايل */
    .ms-developer-info {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 10px;
        flex: 0 0 auto;
        border-left: 1px solid #f0f0f0;
    }

    html[dir="ltr"] .ms-developer-info {
        border-left: none;
        border-right: 1px solid #f0f0f0;
    }

    .ms-dev-logo img {
        width: 36px;
        height: 36px;
        object-fit: contain;
        border-radius: 8px;
        border: 1px solid #eee;
    }

    .ms-dev-logo--initial {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, var(--brand-primary, #0F2742), var(--brand-primary-dark, #0A1B2E));
        border-radius: 8px;
        flex-shrink: 0;
    }

    .ms-dev-logo--initial span {
        color: #fff;
        font-size: 11px;
        font-weight: 800;
    }

    .ms-dev-text {
        display: none;
    }

    /* Mobile Quick Buttons */
    .fcta-mobile-actions {
        display: flex;
        flex: 1;
        height: 64px;
    }

    .fcta-mob-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 0.7rem;
        font-weight: 700;
        text-decoration: none !important;
        border: none;
        cursor: pointer;
        font-family: inherit;
        transition: filter 0.2s ease, transform 0.15s ease;
        color: #fff !important;
        line-height: 1.2;
        border-left: 1px solid rgba(255,255,255,0.15);
    }

    html[dir="ltr"] .fcta-mob-btn {
        border-left: none;
        border-right: 1px solid rgba(255,255,255,0.15);
    }

    .fcta-mob-btn:first-child {
        border-left: none;
        border-right: none;
    }

    .fcta-mob-btn:active {
        filter: brightness(0.9);
        transform: scale(0.97);
    }

    .fcta-mob-btn i {
        font-size: 1.1rem;
    }

    /* الأسعار */
    .fcta-mob-btn:nth-child(1) {
        background: var(--brand-primary, #0F2742);
    }

    /* معاينة */
    .fcta-mob-btn:nth-child(2) {
        background: var(--brand-primary, #0F2742);
    }

    /* بروشور */
    .fcta-mob-btn--brochure {
        background: var(--brand-accent, #C9A45C) !important;
        color: #0F2742 !important;
    }

    /* اتصال - زرار مستقل داكن */
    .fcta-mob-btn--call {
        background: var(--brand-primary-dark, #0A1B2E) !important;
    }

    /* واتساب - لو في زرار واتساب رئيسي */
    .fcta-mob-btn--wa {
        background: #25D366 !important;
    }

    /* إذا كانت 2 أزرار رئيسية فقط (واتساب + اتصال) */
    .fcta-mobile-actions:has(.fcta-mob-btn:only-child) .fcta-mob-btn {
        font-size: 1rem;
    }

    /* Padding لجسم الصفحة على موبايل */
    body.single-projects {
        padding-bottom: 70px;
    }
}

/* ════════════════════════════════════════
   MOBILE — إخفاء الـ wrap كلياً
   ════════════════════════════════════════ */
@media (max-width: 768px) {
    .fcta-wrap {
        display: block; /* keep for mobile bar */
    }

    .fcta-wrap > .fcta-panel-system {
        display: none;
    }
}
