/* ============================================================================
   ZAKI 3D DUAL-MODE INTERACTIVE FLOATING AI ICON (Arabia ERP + Website)
   Hybrid CSS 3D + SVG Orbital Rings + Dynamic Specular Glow + State Machine
   Modes:
     - data-zaki-mode="client" (ZAKI Chat — Website & eCommerce, bottom-left RTL)
     - data-zaki-mode="admin"  (ZAKI Bot  — Arabia ERP Backend, Draggable)
   States: idle | hover | listening | thinking | alert
   Ergonomics: Desktop 72x72px, Mobile 56x56px, Safe Margin 22px, Reduced-Motion Ready
   ============================================================================ */

:root {
    --zaki-size: 72px;
    --zaki-margin: 22px;
    --zaki-cyan: #00E5FF;
    --zaki-gold: #F5B700;
    --zaki-gold-bright: #FFE600;
    --zaki-navy-deep: #021B4D;
    --zaki-navy-mid: #082B70;
    --zaki-sky: #0EA5E9;
    --zaki-alert: #EF4444;
}

@media (max-width: 768px) {
    :root {
        --zaki-size: 56px;
        --zaki-margin: 20px;
    }
}

/* Hide ALL duplicate/legacy floating Zaki / Bot / Livechat buttons so ONLY ONE unified Zaki icon shows */
body.ag-zaki-3d-client-active .o-livechat-root .o-livechat-LivechatButton,
body.ag-zaki-3d-client-active .o_livechat_button,
body[data-ag-zaki-mode] .o-livechat-root .o-livechat-LivechatButton,
body[data-ag-zaki-mode] .o_livechat_button,
body.ag-zaki-3d-admin-active #ag_backend_zaki_3d,
body.ag-zaki-3d-employee-active #ag_backend_zaki_3d,
body[data-ag-zaki-mode] #ag_backend_zaki_3d,
body[data-ag-zaki-mode] #ag_bk_zaki_drawer,
body[data-ag-zaki-mode] #ag_zaki_chat_3d,
body[data-ag-zaki-mode] #ag_zaki_chat_pill,
body[data-ag-zaki-mode] .ag-zrobot-switch-pill,
body[data-ag-zaki-mode] #ag_zaki_robot_theme_toggle,
body[data-ag-zaki-mode] #ag_zaki_fab,
body[data-ag-zaki-mode] .ag-zaki-fab {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Main Floating Container */
.ag-zaki3d-dock {
    position: fixed;
    left: var(--zaki-margin);
    bottom: var(--zaki-margin);
    width: var(--zaki-size);
    height: var(--zaki-size);
    z-index: 10045;
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
    direction: rtl;
    user-select: none;
    touch-action: none;
    perspective: 720px;
    overflow: visible;
}

.ag-zaki3d-dock[data-zaki-mode="admin"] {
    cursor: grab;
}

.ag-zaki3d-dock[data-zaki-mode="admin"].is-dragging {
    cursor: grabbing;
}

/* Soft Floating Shadow Underneath */
.ag-zaki3d-shadow {
    position: absolute;
    left: 50%;
    bottom: -15px;
    width: 66%;
    height: 12px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(2, 27, 77, 0.56) 0%, rgba(2, 27, 77, 0.16) 55%, transparent 80%);
    filter: blur(4px);
    pointer-events: none;
    animation: agZakiShadowPulse 3.6s ease-in-out infinite;
}

@keyframes agZakiShadowPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.72; }
    50% { transform: translateX(-50%) scale(0.8); opacity: 0.42; }
}

/* Interactive 3D Floating Button Stage */
.ag-zaki3d-orb-btn {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    animation: agZakiLevitate 3.6s ease-in-out infinite;
    transition: filter 0.25s ease;
}

.ag-zaki3d-orb-btn:focus-visible {
    outline: 3px solid var(--zaki-gold-bright);
    outline-offset: 6px;
    border-radius: 50%;
}

.ag-zaki3d-dock:hover .ag-zaki3d-orb-btn,
.ag-zaki3d-dock[data-zaki-state="hover"] .ag-zaki3d-orb-btn,
.ag-zaki3d-dock.is-dragging .ag-zaki3d-orb-btn {
    animation-play-state: paused;
}

@keyframes agZakiLevitate {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-7px); }
}

/* Inner 3D Tilt Wrapper (controlled smoothly by pointer tracking) */
.ag-zaki3d-tilt {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(var(--zaki-rx, 0deg)) rotateY(var(--zaki-ry, 0deg));
    transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 3D Glassmorphic Sphere Core */
.ag-zaki3d-sphere {
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    overflow: hidden;
    transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

/* MODE 2: ZAKI Bot (Admin / Arabia ERP — Deep Royal Navy + Metallic Gold + Red-Blue Reflections) */
.ag-zaki3d-dock[data-zaki-mode="admin"] .ag-zaki3d-sphere {
    background:
        radial-gradient(circle at var(--zaki-gx, 32%) var(--zaki-gy, 24%), rgba(125, 211, 252, 0.42) 0%, transparent 38%),
        radial-gradient(circle at 18% 66%, rgba(239, 68, 68, 0.32) 0%, transparent 40%),
        radial-gradient(circle at 82% 74%, rgba(0, 229, 255, 0.34) 0%, transparent 45%),
        radial-gradient(circle at 46% 42%, #0C2D6E 0%, #05163B 58%, #020A1E 100%);
    border: 1.8px solid rgba(245, 183, 0, 0.72);
    box-shadow:
        0 14px 30px rgba(2, 15, 48, 0.56),
        0 0 20px rgba(0, 229, 255, 0.25),
        inset 0 6px 14px rgba(255, 255, 255, 0.34),
        inset 0 -10px 18px rgba(2, 10, 30, 0.82),
        inset 4px 0 12px rgba(239, 68, 68, 0.24);
}

/* MODE 1: ZAKI Chat (Client / Website & eCommerce — Bright Sky Blue + Glassy White + Friendly Glow) */
.ag-zaki3d-dock[data-zaki-mode="client"] .ag-zaki3d-sphere {
    background:
        radial-gradient(circle at var(--zaki-gx, 32%) var(--zaki-gy, 22%), rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.22) 34%, transparent 52%),
        radial-gradient(circle at 78% 78%, rgba(0, 229, 255, 0.55) 0%, transparent 50%),
        radial-gradient(circle at 48% 45%, #38BDF8 0%, #0284C7 55%, #0B5ED7 100%);
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 14px 28px rgba(14, 165, 233, 0.42),
        0 0 22px rgba(56, 189, 248, 0.45),
        inset 0 6px 14px rgba(255, 255, 255, 0.65),
        inset 0 -8px 14px rgba(2, 27, 77, 0.35);
}

/* Top Glass Specular Rim Highlight */
.ag-zaki3d-specular {
    position: absolute;
    top: 7%;
    left: 16%;
    width: 68%;
    height: 36%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.56) 0%, rgba(255, 255, 255, 0.04) 100%);
    pointer-events: none;
    z-index: 2;
}

/* Glowing Metallic 3D "Z" Emblem Inside Sphere */
.ag-zaki3d-z-svg {
    position: relative;
    z-index: 3;
    width: 54%;
    height: 54%;
    filter: drop-shadow(0 0 8px rgba(255, 230, 128, 0.72)) drop-shadow(0 3px 6px rgba(2, 12, 36, 0.65));
    transition: transform 0.25s ease, filter 0.25s ease;
}

.ag-zaki3d-dock[data-zaki-mode="client"] .ag-zaki3d-z-svg {
    filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.9)) drop-shadow(0 3px 6px rgba(2, 27, 77, 0.42));
}

/* Two Intersecting 3D Orbital Rings (Electric Cyan + Brushed Metallic Gold) */
.ag-zaki3d-ring {
    position: absolute;
    inset: -12%;
    border-radius: 50%;
    pointer-events: none;
    transform-style: preserve-3d;
}

.ag-zaki3d-ring-cyan {
    border: 2.2px solid #00E5FF;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.85), inset 0 0 8px rgba(0, 229, 255, 0.45);
    animation: agZakiOrbitCyan 6.5s linear infinite;
}

.ag-zaki3d-ring-gold {
    inset: -10%;
    border: 2.4px solid #F5B700;
    box-shadow: 0 0 11px rgba(245, 183, 0, 0.78), inset 0 0 6px rgba(255, 230, 0, 0.45);
    animation: agZakiOrbitGold 8.2s linear infinite;
}

.ag-zaki3d-dock[data-zaki-mode="client"] .ag-zaki3d-ring-gold {
    border-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.85), 0 0 18px rgba(56, 189, 248, 0.55);
}

/* Luminous Orbital Spark Node */
.ag-zaki3d-ring::after {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transform: translateX(-50%);
}

.ag-zaki3d-ring-cyan::after {
    background: #FFFFFF;
    box-shadow: 0 0 10px 3px #00E5FF;
}

.ag-zaki3d-ring-gold::after {
    background: #FFFBEB;
    box-shadow: 0 0 10px 2px #F5B700;
}

@keyframes agZakiOrbitCyan {
    0%   { transform: rotateX(68deg) rotateY(-28deg) rotateZ(0deg); }
    100% { transform: rotateX(68deg) rotateY(-28deg) rotateZ(360deg); }
}

@keyframes agZakiOrbitGold {
    0%   { transform: rotateX(66deg) rotateY(32deg) rotateZ(360deg); }
    100% { transform: rotateX(66deg) rotateY(32deg) rotateZ(0deg); }
}

/* ==================== STATE MACHINE VISUALS ==================== */
/* 1. LISTENING STATE (Sonic Cyan Waves) */
.ag-zaki3d-sonic {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #00E5FF;
    opacity: 0;
    pointer-events: none;
}

.ag-zaki3d-dock[data-zaki-state="listening"] .ag-zaki3d-sonic {
    animation: agZakiSonicWave 1.25s ease-out infinite;
}

.ag-zaki3d-dock[data-zaki-state="listening"] .ag-zaki3d-sonic.s2 {
    animation-delay: 0.45s;
}

@keyframes agZakiSonicWave {
    0%   { transform: scale(0.95); opacity: 0.92; }
    100% { transform: scale(1.62); opacity: 0; }
}

.ag-zaki3d-dock[data-zaki-state="listening"] .ag-zaki3d-z-svg {
    transform: scale(1.12);
    filter: drop-shadow(0 0 14px #00E5FF);
}

/* 2. THINKING STATE (Fast Counter-Spinning Rings + Shimmer Core) */
.ag-zaki3d-dock[data-zaki-state="thinking"] .ag-zaki3d-ring-cyan {
    animation-duration: 1.15s;
}

.ag-zaki3d-dock[data-zaki-state="thinking"] .ag-zaki3d-ring-gold {
    animation-duration: 1.45s;
}

.ag-zaki3d-dock[data-zaki-state="thinking"] .ag-zaki3d-z-svg {
    animation: agZakiThinkPulse 0.8s ease-in-out infinite alternate;
}

@keyframes agZakiThinkPulse {
    from { transform: scale(0.94); opacity: 0.78; }
    to   { transform: scale(1.14); opacity: 1; }
}

/* 3. ALERT STATE (Live Incoming Customer / Cost Alert Pulse) */
.ag-zaki3d-dock[data-zaki-state="alert"] .ag-zaki3d-sphere {
    border-color: #EF4444 !important;
    animation: agZakiAlertGlow 1.1s ease-in-out infinite;
}

@keyframes agZakiAlertGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75), 0 0 24px rgba(245, 183, 0, 0.65);
    }
    55% {
        box-shadow: 0 0 0 16px rgba(239, 68, 68, 0), 0 0 32px rgba(0, 229, 255, 0.6);
    }
}

/* Mode Label Pill Underneath */
.ag-zaki3d-pill {
    position: absolute;
    bottom: -11px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.3px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 6;
    box-shadow: 0 4px 10px rgba(2, 27, 77, 0.36);
}

.ag-zaki3d-dock[data-zaki-mode="admin"] .ag-zaki3d-pill {
    background: linear-gradient(135deg, #F5B700, #FFE600);
    color: #021B4D;
    border: 1.5px solid #021B4D;
}

.ag-zaki3d-dock[data-zaki-mode="client"] .ag-zaki3d-pill {
    background: linear-gradient(135deg, #FFFFFF, #E0F2FE);
    color: #021B4D;
    border: 1.5px solid #0284C7;
}

/* Alert Counter Badge */
.ag-zaki3d-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    font-size: 10.5px;
    font-weight: 900;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 8;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.5);
}

.ag-zaki3d-badge.visible {
    display: flex;
}

/* ==================== QUICK ORBIT ACTIONS (3 Mini Radial Action Buttons) ==================== */
.ag-zaki3d-orbit-actions {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 7;
}

.ag-zaki3d-orbit-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    border: 1.8px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translate(0px, 0px) scale(0.35);
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.22s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    box-shadow: 0 8px 20px rgba(2, 27, 77, 0.34);
}

.ag-zaki3d-dock[data-zaki-mode="admin"] .ag-zaki3d-orbit-btn {
    background: linear-gradient(135deg, #021B4D, #0B409C);
    color: #FFE600;
    border-color: #F5B700;
}

.ag-zaki3d-dock[data-zaki-mode="client"] .ag-zaki3d-orbit-btn {
    background: linear-gradient(135deg, #FFFFFF, #E0F2FE);
    color: #021B4D;
    border-color: #0EA5E9;
}

/* Reveal Orbit Buttons on Hover / Focus / Orbit-Open */
.ag-zaki3d-dock:hover .ag-zaki3d-orbit-btn,
.ag-zaki3d-dock.orbit-open .ag-zaki3d-orbit-btn,
.ag-zaki3d-dock[data-zaki-state="hover"] .ag-zaki3d-orbit-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Default Fan Arc (for bottom-left placement: fan UP and RIGHT cleanly inside viewport) */
.ag-zaki3d-dock:not(.flip-x):hover .ag-zaki3d-orbit-btn[data-slot="0"],
.ag-zaki3d-dock:not(.flip-x).orbit-open .ag-zaki3d-orbit-btn[data-slot="0"],
.ag-zaki3d-dock:not(.flip-x)[data-zaki-state="hover"] .ag-zaki3d-orbit-btn[data-slot="0"] {
    transform: translate(4px, -64px) scale(1);
    transition-delay: 0.02s;
}
.ag-zaki3d-dock:not(.flip-x):hover .ag-zaki3d-orbit-btn[data-slot="1"],
.ag-zaki3d-dock:not(.flip-x).orbit-open .ag-zaki3d-orbit-btn[data-slot="1"],
.ag-zaki3d-dock:not(.flip-x)[data-zaki-state="hover"] .ag-zaki3d-orbit-btn[data-slot="1"] {
    transform: translate(50px, -46px) scale(1);
    transition-delay: 0.06s;
}
.ag-zaki3d-dock:not(.flip-x):hover .ag-zaki3d-orbit-btn[data-slot="2"],
.ag-zaki3d-dock:not(.flip-x).orbit-open .ag-zaki3d-orbit-btn[data-slot="2"],
.ag-zaki3d-dock:not(.flip-x)[data-zaki-state="hover"] .ag-zaki3d-orbit-btn[data-slot="2"] {
    transform: translate(66px, 2px) scale(1);
    transition-delay: 0.1s;
}

/* Flipped Fan Arc (when dragged near right edge of screen: fan UP and LEFT) */
.ag-zaki3d-dock.flip-x:hover .ag-zaki3d-orbit-btn[data-slot="0"],
.ag-zaki3d-dock.flip-x.orbit-open .ag-zaki3d-orbit-btn[data-slot="0"],
.ag-zaki3d-dock.flip-x[data-zaki-state="hover"] .ag-zaki3d-orbit-btn[data-slot="0"] {
    transform: translate(-4px, -64px) scale(1);
    transition-delay: 0.02s;
}
.ag-zaki3d-dock.flip-x:hover .ag-zaki3d-orbit-btn[data-slot="1"],
.ag-zaki3d-dock.flip-x.orbit-open .ag-zaki3d-orbit-btn[data-slot="1"],
.ag-zaki3d-dock.flip-x[data-zaki-state="hover"] .ag-zaki3d-orbit-btn[data-slot="1"] {
    transform: translate(-50px, -46px) scale(1);
    transition-delay: 0.06s;
}
.ag-zaki3d-dock.flip-x:hover .ag-zaki3d-orbit-btn[data-slot="2"],
.ag-zaki3d-dock.flip-x.orbit-open .ag-zaki3d-orbit-btn[data-slot="2"],
.ag-zaki3d-dock.flip-x[data-zaki-state="hover"] .ag-zaki3d-orbit-btn[data-slot="2"] {
    transform: translate(-66px, 2px) scale(1);
    transition-delay: 0.1s;
}

.ag-zaki3d-orbit-btn:hover {
    border-color: #00E5FF !important;
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.28), 0 10px 22px rgba(2, 27, 77, 0.42);
    z-index: 12;
}

/* Tooltip Label on Orbit Buttons */
.ag-zaki3d-orbit-btn::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #021B4D;
    color: #FFFFFF;
    border: 1px solid #00E5FF;
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
    box-shadow: 0 4px 12px rgba(2, 27, 77, 0.35);
}

.ag-zaki3d-orbit-btn:hover::after {
    opacity: 1;
}

/* Hover Invisible Hit-Bridge so moving cursor from Orb to Orbit Actions never closes the arc */
.ag-zaki3d-dock::before {
    content: "";
    position: absolute;
    inset: -74px -74px -22px -22px;
    pointer-events: none;
    z-index: 0;
}
.ag-zaki3d-dock:hover::before,
.ag-zaki3d-dock.orbit-open::before {
    pointer-events: auto;
}

/* ==================== COMPACT INTERACTIVE DRAWER ==================== */
.ag-zaki3d-panel {
    position: fixed;
    left: var(--zaki-margin);
    bottom: calc(var(--zaki-margin) + var(--zaki-size) + 18px);
    width: 332px;
    max-width: calc(100vw - 32px);
    background: #FFFFFF;
    border-radius: 20px;
    border: 2px solid #0B5ED7;
    border-top: 4px solid #F5B700;
    box-shadow: 0 22px 52px rgba(2, 27, 77, 0.34);
    z-index: 10048;
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
    direction: rtl;
    overflow: hidden;
    display: none;
}

.ag-zaki3d-panel.open {
    display: block;
    animation: agZakiPanelIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes agZakiPanelIn {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ag-zaki3d-panel-head {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #FFFFFF;
}

.ag-zaki3d-panel[data-zaki-mode="admin"] .ag-zaki3d-panel-head {
    background: linear-gradient(135deg, #021B4D 0%, #08307A 65%, #0B5ED7 100%);
    border-bottom: 2px solid #F5B700;
}

.ag-zaki3d-panel[data-zaki-mode="client"] .ag-zaki3d-panel-head {
    background: linear-gradient(135deg, #0284C7 0%, #0EA5E9 55%, #0B5ED7 100%);
    border-bottom: 2px solid #7DD3FC;
}

.ag-zaki3d-panel-body {
    padding: 12px 14px 14px;
    background: #F8FBFF;
    font-size: 12.5px;
    color: #0F172A;
}

.ag-zaki3d-state-chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ag-zaki3d-chip {
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #021B4D;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}

.ag-zaki3d-chip.active {
    background: #021B4D;
    color: #FFE600;
    border-color: #F5B700;
}

.ag-zaki3d-action-list {
    display: grid;
    gap: 7px;
}

.ag-zaki3d-act-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 12px;
    background: #FFFFFF;
    border: 1.5px solid #DCE6F5;
    color: #021B4D !important;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.ag-zaki3d-act-link:hover {
    border-color: #0B5ED7;
    background: #EFF6FF;
    transform: translateX(-2px);
}

.ag-zaki3d-act-link.primary {
    background: linear-gradient(135deg, #021B4D, #0B5ED7);
    color: #FFFFFF !important;
    border-color: #F5B700;
}

.ag-zaki3d-feedback {
    margin-top: 9px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #021B4D;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.55;
}

/* ==================== HYBRID REDUCED-MOTION FALLBACK ==================== */
@media (prefers-reduced-motion: reduce) {
    .ag-zaki3d-orb-btn,
    .ag-zaki3d-ring-cyan,
    .ag-zaki3d-ring-gold,
    .ag-zaki3d-shadow,
    .ag-zaki3d-sonic,
    .ag-zaki3d-z-svg,
    .ag-zaki3d-sphere,
    .ag-zaki3d-panel {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
    .ag-zaki3d-ring-cyan {
        transform: rotateX(68deg) rotateY(-28deg) rotateZ(24deg);
    }
    .ag-zaki3d-ring-gold {
        transform: rotateX(66deg) rotateY(32deg) rotateZ(-18deg);
    }
}

/* Hide redundant floating website update pill so it never overlaps ZAKI 3D or confuses public visitors */
#agc-version-pill-btn { display: none !important; visibility: hidden !important; pointer-events: none !important; }

/* === AGC Website Contrast & Readability Polish (2026-12-01) === */
header#top .ag-header-cart-pill,
header#top .ag-header-wish-pill {
    background: #ffffff !important;
    color: #021B4D !important;
    border: 1.5px solid #93C5FD !important;
    box-shadow: 0 3px 10px rgba(2,27,77,0.16) !important;
}
header#top .ag-header-cart-pill *,
header#top .ag-header-wish-pill *,
header#top a[href="/shop/cart"] span,
header#top a[href="/shop/wishlist"] span {
    color: #021B4D !important;
    font-weight: 800 !important;
}
header#top .ag-header-wish-pill .fa-heart,
header#top .ag-header-wish-pill svg {
    color: #E11D48 !important;
    fill: #E11D48 !important;
}
header#top .ag-header-cart-pill .ag-pill-icon-wrap {
    background: #021B4D !important;
    color: #FFE600 !important;
}
header#top .ag-header-cart-pill .ag-pill-icon-wrap svg {
    color: #FFE600 !important;
    fill: #FFE600 !important;
}
/* Footer white card ('روابط تهمك') crisp dark navy text contrast */
footer#bottom .o_cc1,
footer#bottom .bg-white,
footer#bottom [style*="background-color: rgb(255, 255, 255)"],
footer#bottom [style*="background:#fff"],
footer#bottom [style*="background: #fff"],
footer#bottom .s_col_no_bgcolor.bg-white,
footer#bottom .o_colored_level[style*="background-color: white"],
footer#bottom .o_cc2 {
    color: #021B4D !important;
}
footer#bottom .o_cc1 a,
footer#bottom .bg-white a,
footer#bottom .o_cc1 font,
footer#bottom .o_cc1 strong,
footer#bottom .o_cc1 span,
footer#bottom .o_cc1 p,
footer#bottom .o_cc1 li,
footer#bottom .o_cc2 a,
footer#bottom .o_cc2 p,
footer#bottom .o_cc2 li {
    color: #021B4D !important;
}
footer#bottom .o_cc1 a:hover,
footer#bottom .bg-white a:hover,
footer#bottom .o_cc2 a:hover {
    color: #0B5ED7 !important;
    text-decoration: underline !important;
}

/* === AGC Performance Optimization: Stop Continuous 60fps Idle GPU/CPU Repaints === */
.ag-zaki3d-dock .ag-zaki3d-shadow,
.ag-zaki3d-dock .ag-zaki3d-orb,
.ag-zaki3d-dock .ag-zaki3d-ring-1,
.ag-zaki3d-dock .ag-zaki3d-ring-2,
.ag-zaki3d-dock .ag-zaki3d-wave,
.ag-zaki3d-dock .ag-zaki3d-badge {
    animation: none !important;
    transform-style: flat !important;
}
.ag-zaki3d-dock[data-zaki-state="listening"] .ag-zaki3d-wave {
    animation: agZakiSonicWave 1.4s ease-out infinite !important;
}


/* === AGC FLOATING UI ZERO-OVERLAP & ZERO-FLICKER POLISH (2026-12-02) === */
/* 1) Permanently suppress default Odoo Livechat launcher button (ZERO flicker!) */
.o-livechat-root .o-livechat-LivechatButton,
.o-livechat-LivechatButton,
.o_livechat_button,
.o-livechat-root button[aria-label*="livechat"],
.o-livechat-root button[aria-label*="الدردشة الحية"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}
/* 2) Position Client ZAKI Chat safely ABOVE the ERP Entry Button ("دخول المنظومة") with safe left margin */
.ag-zaki3d-dock[data-zaki-mode="client"] {
    left: 38px !important;
    right: auto !important;
    bottom: 92px !important;
    top: auto !important;
    z-index: 10045 !important;
}
/* 3) Position ERP Entry Bar ("دخول المنظومة") cleanly DIRECTLY UNDER ZAKI Chat with generous vertical spacing */
#ag_internal_erp_bar {
    position: fixed !important;
    bottom: 14px !important;
    left: 14px !important;
    right: auto !important;
    top: auto !important;
    z-index: 10042 !important;
}
#ag_internal_erp_bar a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: linear-gradient(135deg, #021B4D, #0B5ED7) !important;
    color: #FFE600 !important;
    border: 1.5px solid #F5B700 !important;
    padding: 7px 14px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    box-shadow: 0 6px 18px rgba(2, 27, 77, 0.32) !important;
    white-space: nowrap !important;
}
/* 4) Razor-sharp, dead-centered, RTL-immune label pill underneath ZAKI Orb (NEVER clipped or shifted!) */
.ag-zaki3d-pill {
    position: absolute !important;
    bottom: -23px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    direction: ltr !important;
    unicode-bidi: isolate !important;
    width: max-content !important;
    min-width: 82px !important;
    text-align: center !important;
    padding: 2px 11px !important;
    font-size: 10.5px !important;
    font-weight: 900 !important;
    line-height: 1.35 !important;
    letter-spacing: 0.25px !important;
    white-space: nowrap !important;
    z-index: 9 !important;
    box-shadow: 0 4px 12px rgba(2, 27, 77, 0.34) !important;
    pointer-events: none !important;
}
/* 5) Prevent PWA install banner & other floating widgets from colliding with bottom-left ZAKI + ERP stack */
#ag_pwa_install_banner {
    left: auto !important;
    right: 18px !important;
    bottom: 18px !important;
    z-index: 10040 !important;
}
/* 6) Ensure open Livechat Window never covers ZAKI Orb, 3 Orbit Icons, or ERP Entry Button */
.o-livechat-root .o-mail-ChatWindow,
.o-mail-ChatHub .o-mail-ChatWindow {
    left: 158px !important;
    right: auto !important;
    bottom: 20px !important;
    z-index: 10049 !important;
}
@media (max-width: 600px) {
    .ag-zaki3d-dock[data-zaki-mode="client"] {
        left: 24px !important;
        bottom: 82px !important;
    }
    .o-livechat-root .o-mail-ChatWindow,
    .o-mail-ChatHub .o-mail-ChatWindow {
        left: 10px !important;
        right: 10px !important;
        bottom: 195px !important;
    }
}
/* ============================================================================
   ZAKI LIVE VOICE STUDIO — Gemini Live-Style Light Glassmorphic Royal Overlay
   ============================================================================ */
#ag_zaki_live_overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    background: radial-gradient(circle at 20% 15%, rgba(239, 246, 255, 0.94), rgba(255, 255, 255, 0.96) 55%, rgba(255, 251, 235, 0.95));
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
    direction: rtl;
    color: #0F172A;
    animation: agZakiLiveFadeIn 0.25s ease;
}
@keyframes agZakiLiveFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}
.ag-zlive-card {
    width: min(560px, 96vw);
    max-height: 92vh;
    background: rgba(255, 255, 255, 0.88);
    border: 1.8px solid rgba(11, 94, 215, 0.22);
    border-radius: 28px;
    box-shadow: 0 28px 70px rgba(2, 27, 77, 0.16), 0 0 0 1px rgba(245, 183, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ag-zlive-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #FFFFFF 0%, #EFF6FF 65%, #FFFBEB 100%);
    border-bottom: 1.5px solid #DBEAFE;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.ag-zlive-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ag-zlive-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0B5ED7, #00A3FF);
    color: #FFFFFF;
    font-size: 11.5px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(11, 94, 215, 0.28);
}
.ag-zlive-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F5B700;
    box-shadow: 0 0 8px #F5B700;
    animation: agZliveBlink 1.3s infinite;
}
@keyframes agZliveBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.75); }
}
.ag-zlive-icon-btn {
    border: 1.5px solid #CBD5E1;
    background: #FFFFFF;
    color: #021B4D;
    border-radius: 12px;
    padding: 6px 11px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s ease;
}
.ag-zlive-icon-btn:hover {
    background: #EFF6FF;
    border-color: #0B5ED7;
}
.ag-zlive-icon-btn.active {
    background: #0B5ED7;
    color: #FFFFFF;
    border-color: #0B5ED7;
}
.ag-zlive-stage {
    padding: 22px 20px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}
.ag-zlive-orb-wrap {
    position: relative;
    width: 152px;
    height: 152px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 12px;
}
.ag-zlive-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2.5px solid rgba(0, 163, 255, 0.35);
    pointer-events: none;
    transition: transform 0.12s ease, opacity 0.2s ease, border-color 0.25s ease;
}
.ag-zlive-ring.r2 {
    inset: -10px;
    border-color: rgba(245, 183, 0, 0.28);
}
#ag_zaki_live_overlay[data-live-state="listening"] .ag-zlive-ring {
    animation: agZliveRipple 2s ease-out infinite;
    border-color: rgba(0, 163, 255, 0.65);
}
#ag_zaki_live_overlay[data-live-state="listening"] .ag-zlive-ring.r2 {
    animation: agZliveRipple 2s ease-out 0.7s infinite;
    border-color: rgba(11, 94, 215, 0.45);
}
#ag_zaki_live_overlay[data-live-state="speaking"] .ag-zlive-ring {
    animation: agZliveSpeakPulse 1.1s ease-in-out infinite;
    border-color: rgba(245, 183, 0, 0.85);
}
#ag_zaki_live_overlay[data-live-state="thinking"] .ag-zlive-ring {
    border: 3px dashed #F5B700;
    animation: agZliveSpin 2.4s linear infinite;
}
@keyframes agZliveRipple {
    0% { transform: scale(0.92); opacity: 0.9; }
    100% { transform: scale(1.32); opacity: 0; }
}
@keyframes agZliveSpeakPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.16); opacity: 0.45; }
}
@keyframes agZliveSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.ag-zlive-orb {
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #FFFFFF 0%, #BAE6FD 28%, #00A3FF 64%, #0B5ED7 100%);
    border: 3px solid #FFFFFF;
    box-shadow: 0 18px 42px rgba(11, 94, 215, 0.34), inset 0 6px 14px rgba(255, 255, 255, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    transition: transform 0.14s ease, background 0.3s ease;
    position: relative;
    z-index: 2;
}
#ag_zaki_live_overlay[data-live-state="speaking"] .ag-zlive-orb {
    background: radial-gradient(circle at 30% 28%, #FFFBEB 0%, #FDE68A 28%, #F5B700 66%, #0B5ED7 100%);
    box-shadow: 0 18px 46px rgba(245, 183, 0, 0.42), inset 0 6px 14px rgba(255, 255, 255, 0.8);
}
#ag_zaki_live_overlay[data-live-state="paused"] .ag-zlive-orb {
    background: radial-gradient(circle at 35% 30%, #F8FAFC 0%, #CBD5E1 65%, #64748B 100%);
    box-shadow: 0 10px 26px rgba(100, 116, 139, 0.25);
}
.ag-zlive-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
}
.ag-zlive-bar {
    width: 5px;
    height: 10px;
    border-radius: 999px;
    background: #FFFFFF;
    transition: height 0.09s ease;
}
.ag-zlive-state-label {
    font-size: 16px;
    font-weight: 900;
    color: #021B4D;
    margin-bottom: 4px;
}
.ag-zlive-sub-hint {
    font-size: 12px;
    color: #475569;
    font-weight: 700;
}
.ag-zlive-captions {
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #F8FAFC;
    border: 1.5px solid #DBEAFE;
    text-align: right;
    min-height: 64px;
    max-height: 170px;
    overflow-y: auto;
    font-size: 13.5px;
    line-height: 1.75;
    color: #0F172A;
}
.ag-zlive-msg {
    margin-bottom: 8px;
    padding: 7px 11px;
    border-radius: 12px;
}
.ag-zlive-msg.user {
    background: #EFF6FF;
    border-inline-start: 3.5px solid #0B5ED7;
    color: #021B4D;
    font-weight: 800;
}
.ag-zlive-msg.zaki {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-inline-start: 3.5px solid #F5B700;
    color: #0F172A;
}
.ag-zlive-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
    margin-top: 10px;
}
.ag-zlive-chip-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #EFF6FF;
    border: 1.3px solid #93C5FD;
    color: #0B5ED7 !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}
.ag-zlive-chip-link:hover {
    background: #0B5ED7;
    color: #FFFFFF !important;
}
.ag-zlive-settings {
    padding: 12px 18px;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    display: none;
    flex-direction: column;
    gap: 10px;
    font-size: 12.5px;
}
.ag-zlive-settings.open {
    display: flex;
}
.ag-zlive-personas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
}
.ag-zlive-persona-btn {
    border: 1.5px solid #CBD5E1;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 8px 10px;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    color: #0F172A;
}
.ag-zlive-persona-btn.active {
    background: linear-gradient(135deg, #EFF6FF, #FFFBEB);
    border-color: #0B5ED7;
    color: #0B5ED7;
    box-shadow: 0 3px 10px rgba(11, 94, 215, 0.14);
}
.ag-zlive-controls {
    padding: 12px 18px 16px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ag-zlive-btn-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ag-zlive-main-btn {
    border: none;
    border-radius: 999px;
    padding: 11px 22px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: transform 0.15s ease;
}
.ag-zlive-main-btn:active { transform: scale(0.96); }
.ag-zlive-main-btn.primary {
    background: linear-gradient(135deg, #0B5ED7, #00A3FF);
    color: #FFFFFF;
    box-shadow: 0 8px 20px rgba(11, 94, 215, 0.3);
}
.ag-zlive-main-btn.interrupt {
    background: linear-gradient(135deg, #F5B700, #EA580C);
    color: #FFFFFF;
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.28);
}
.ag-zlive-main-btn.end {
    background: #FEE2E2;
    color: #991B1B;
    border: 1.5px solid #FCA5A5;
}
.ag-zlive-type-row {
    display: flex;
    gap: 7px;
}
.ag-zlive-type-row input {
    flex: 1;
    border: 1.5px solid #CBD5E1;
    border-radius: 12px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    color: #0F172A;
    background: #F8FAFC;
}
.ag-zlive-type-row button {
    border: none;
    border-radius: 12px;
    padding: 8px 14px;
    background: #021B4D;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 900;
    cursor: pointer;
}
