/* Alzar Engage — logo-fade loader, popups, chat. RTL-first, mobile-first. */
:root { --aze-navy: var(--wp--preset--color--primary, #222D65); --aze-green: var(--wp--preset--color--green, #1A994A); --aze-r: 20px; }
/* v1.9.9 loader (owner request): the logo fades in and out but NEVER to
   zero — it dips to opacity .3 ("تقلل الأوبيستي شوية بس في الاختفاء") on a
   lively 1.2s cycle so even a short-lived veil visibly breathes "loading".
   The veil stays .93 white + blur 6px. Two soft halo rings + one rotating
   pharmacy tip below (never repeats within the session nor in the browser
   until the whole list has been shown). */
.aze-loader__logo { position: relative; display: grid; place-items: center; width: 148px; height: 148px; }
.aze-loader__logo img { position: relative; z-index: 1; width: 120px; height: 120px; object-fit: contain; animation: aze-fade 1.2s ease-in-out infinite; filter: drop-shadow(0 10px 18px rgba(10,16,48,.18)); }
.aze-loader__dot { width: 88px; height: 88px; border-radius: 50%; background: var(--aze-green); animation: aze-fade 1.2s ease-in-out infinite; }
.aze-loader__ring { position: absolute; inset: 6px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--aze-green) 32%, transparent); animation: aze-ring 1.7s cubic-bezier(.2,.7,.3,1) infinite; }
.aze-loader__ring--2 { animation-delay: .85s; }
@keyframes aze-fade { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes aze-ring { from { transform: scale(.58); opacity: .95; } to { transform: scale(1.12); opacity: 0; } }
.aze-loader__tip { margin: .9rem 0 0; max-width: 86vw; color: var(--aze-navy); font-size: .98rem; font-weight: 700; text-align: center; line-height: 1.7; opacity: 0; transform: translateY(7px); transition: opacity .35s, transform .35s; direction: rtl; }
.aze-loader__tip.is-in { opacity: 1; transform: none; }
@supports not (color: color-mix(in srgb, red 10%, blue)) { .aze-loader__ring { border-color: rgba(26,153,74,.32); } }
/* v1.9.9: the loader shows instantly (no fade-in delay on .is-on) so the
   40ms trigger is already breathing at full veil opacity when the unload
   comes; hiding keeps the smooth fade. */
.aze-loader { position: fixed; inset: 0; z-index: 99998; display: grid; place-content: center; justify-items: center; background: rgba(255,255,255,.93); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.aze-loader.is-on { opacity: 1; visibility: visible; transition: none; }
.aze-busy { position: relative; color: transparent !important; pointer-events: none; }
.aze-busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; animation: aze-spin .7s linear infinite; }
@keyframes aze-spin { to { transform: rotate(360deg); } }
.aze-btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: .4rem; background: var(--aze-green); color: #fff !important; font-weight: 700; border-radius: 999px; padding: .8rem 1.4rem; text-align: center; text-decoration: none; transition: transform .15s, filter .15s; }
.aze-btn:hover { filter: brightness(1.06); } .aze-btn:active { transform: scale(.97); }
.aze-btn:focus-visible { outline: 3px solid var(--aze-navy); outline-offset: 2px; }
/* Popups */
.aze-modal { position: fixed; inset: 0; z-index: 99990; display: grid; place-items: center; padding: 1rem; background: rgba(10,16,48,.55); opacity: 0; transition: opacity .3s; direction: rtl; }
.aze-modal.is-on { opacity: 1; }
.aze-pop { position: relative; width: min(420px, 100%); background: #fff; border-radius: 24px; padding: 2rem 1.5rem 1.25rem; text-align: center; box-shadow: 0 30px 60px -20px rgba(10,16,48,.5); transform: translateY(30px) scale(.96); transition: transform .35s cubic-bezier(.2,.9,.3,1.3); }
.aze-modal.is-on .aze-pop { transform: none; }
.aze-pop h3 { margin: .5rem 0; color: var(--aze-navy); font-size: 1.35rem; }
.aze-pop p { margin: 0 0 1rem; opacity: .8; line-height: 1.7; }
.aze-pop__icon { font-size: 3rem; line-height: 1; animation: aze-pop-in .6s cubic-bezier(.2,.9,.3,1.5); }
.aze-pop__icon--ok { font-size: 4rem; }
@keyframes aze-pop-in { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.aze-pop__form { display: flex; flex-direction: column; gap: .6rem; }
.aze-pop__form input { box-sizing: border-box; width: 100%; padding: .8rem 1rem; border-radius: 14px; border: 1.5px solid rgba(34,45,101,.18); font: inherit; font-size: 16px; }
.aze-pop__form input:focus { outline: none; border-color: var(--aze-green); box-shadow: 0 0 0 3px rgba(26,153,74,.15); }
.aze-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.aze-err { color: #c0392b; font-size: .9rem; margin: 0; }
.aze-x { all: unset; cursor: pointer; position: absolute; top: .6rem; inset-inline-end: .8rem; font-size: 1.6rem; line-height: 1; opacity: .5; padding: .25rem; }
.aze-pop .aze-btn.aze-x { position: static; opacity: 1; font-size: 1rem; }
.aze-later { all: unset; cursor: pointer; display: block; margin: .8rem auto 0; font-size: .85rem; opacity: .6; }
/* Chat — v1.9.8 (owner request): the button is HALF-TUCKED into the screen's
   RIGHT edge at mid-height, LOW opacity (.45) — quiet, never in the way, yet
   always visible and usable while scrolling; hover/focus slides it out and
   up to full opacity. It politely disappears while the mobile menu or the
   cart drawer is open (JS toggles .az-hide; the :has() rules are the CSS
   safety net). The glyph is an expressive frameless chat bubble (three dots). */
.aze-fab { all: unset; box-sizing: border-box; cursor: pointer; position: fixed; z-index: 9990; right: -12px; top: 50%; bottom: auto; width: 60px; height: 60px; border-radius: 50%; background: var(--aze-green); color: #fff; display: grid; place-items: center; font-size: 1.6rem; opacity: .45; transform: translateY(-50%); box-shadow: -10px 0 26px -12px rgba(26,153,74,.6); transition: opacity .25s, right .25s cubic-bezier(.2,.8,.3,1); }
.aze-bubble { width: 30px; height: 30px; color: #fff; }
.aze-fab img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-sizing: border-box; }
.aze-fab:hover, .aze-fab:focus-visible { right: -4px; opacity: 1; }
.aze-fab.is-open { right: -4px; opacity: 1; transform: translateY(-50%) scale(.9); }
.aze-fab.az-hide, .aze-nudge.az-hide,
body:has(.wp-block-navigation__responsive-container.is-menu-open) .aze-fab,
body:has(.az-drawer.is-open) .aze-fab,
body:has(.wp-block-navigation__responsive-container.is-menu-open) .aze-nudge,
body:has(.az-drawer.is-open) .aze-nudge { opacity: 0; visibility: hidden; pointer-events: none; }
.aze-fab__dot { position: absolute; bottom: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--aze-green); }
.aze-fab__dot.is-off { background: #f39c12; border-color: #fff; }
.aze-fab__n { position: absolute; top: -4px; left: -4px; background: #e74c3c; color: #fff; font-size: .75rem; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; }
.aze-fab.is-ping { animation: aze-ping 1.4s ease-in-out infinite; }
@keyframes aze-ping { 50% { box-shadow: 0 0 0 12px rgba(26,153,74,.18); } }
.aze-nudge { all: unset; box-sizing: border-box; cursor: pointer; position: fixed; z-index: 9989; right: 44px; top: 50%; transform: translateY(-50%); max-width: 260px; background: #fff; border-radius: 18px 4px 18px 18px; padding: .8rem 1rem; box-shadow: 0 16px 40px -14px rgba(10,16,48,.45); direction: rtl; font-size: .92rem; line-height: 1.6; animation: aze-pop-in .5s; transition: opacity .25s, visibility .25s; }
.aze-nudge b { display: block; color: var(--aze-navy); }
/* v1.9.8 (owner request): the chat panel opens beside the half-tucked button —
   vertically centered on the right on desktop. */
.aze-chat { position: fixed; z-index: 9995; right: 16px; top: 50%; bottom: auto; transform: translateY(-50%); width: min(370px, calc(100vw - 32px)); height: min(580px, calc(100dvh - 32px)); background: #fff; border-radius: var(--aze-r); box-shadow: 0 30px 70px -20px rgba(10,16,48,.5); display: flex; flex-direction: column; overflow: hidden; direction: rtl; }
.aze-chat[hidden] { display: none; }
.aze-chat__h { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; background: linear-gradient(135deg, var(--aze-navy), #161D47); color: #fff; }
.aze-chat__h small { display: block; opacity: .8; font-size: .78rem; }
.aze-chat__av { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.15); display: grid; place-items: center; flex: none; color: #fff; }
.aze-chat__av img { width: 100%; height: 100%; object-fit: cover; }
.aze-chat__av .aze-bubble { width: 24px; height: 24px; }
.aze-chat__x { all: unset; cursor: pointer; margin-inline-start: auto; font-size: 1.6rem; opacity: .8; padding: 0 .3rem; }
/* v1.9.8 (owner request): the WhatsApp-by-the-specialized-pharmacist note — a
   slim green bar right under the header, always on. */
.aze-chat__note { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .8rem; background: #E9F7EF; background: color-mix(in srgb, var(--aze-green) 12%, #fff); color: var(--aze-green-deep, #137A3A); font-size: .74rem; font-weight: 700; line-height: 1.5; text-align: center; border-bottom: 1px solid color-mix(in srgb, var(--aze-green) 14%, transparent); }
.aze-chat__m { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; background: #F5F7FB; overscroll-behavior: contain; }
.aze-msg { max-width: 82%; padding: .6rem .9rem; border-radius: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }
.aze-msg small { display: block; font-size: .68rem; opacity: .55; margin-top: 2px; }
/* v1.9.8 (owner request — WhatsApp style): the CUSTOMER's words sit on the
   RIGHT (RTL flex-start), the agent's on the LEFT (RTL flex-end) — the tails
   follow their bubbles. */
.aze-msg.is-a { align-self: flex-end; background: #fff; border: 1px solid rgba(34,45,101,.08); border-top-left-radius: 4px; }
.aze-msg.is-c { align-self: flex-start; background: var(--aze-green); color: #fff; border-top-right-radius: 4px; }
.aze-msg.is-pending { opacity: .6; }
.aze-chat__q { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 1rem; background: #F5F7FB; }
.aze-chat__q[hidden] { display: none; }
.aze-chip { all: unset; cursor: pointer; font-size: .85rem; padding: .4rem .8rem; border-radius: 999px; background: #fff; border: 1.5px solid rgba(26,153,74,.35); color: var(--aze-green); font-weight: 600; }
.aze-chip:hover { background: var(--aze-green); color: #fff; }
.aze-chat__who { display: flex; gap: .4rem; padding: .5rem .75rem 0; }
.aze-chat__who input { flex: 1; min-width: 0; padding: .5rem .7rem; border-radius: 10px; border: 1px solid rgba(34,45,101,.15); font: inherit; font-size: 14px; }
.aze-chat__f { display: flex; gap: .5rem; padding: .6rem .75rem; align-items: flex-end; }
.aze-chat__f textarea { flex: 1; resize: none; border: 1.5px solid rgba(34,45,101,.15); border-radius: 14px; padding: .65rem .9rem; font: inherit; font-size: 16px; max-height: 110px; }
.aze-chat__f .aze-btn { width: 46px; height: 46px; padding: 0; transform: scaleX(-1); }
.aze-chat__wa { text-align: center; font-size: .8rem; padding: 0 0 .6rem; color: var(--aze-green); }
@media (max-width: 781px) {
        /* v1.9.8 (owner request): on mobile the chat button is HALF-TUCKED
           into the right edge at mid-height too — same quiet behaviour as
           desktop, just smaller. The chat screen itself opens DEAD CENTER:
           equal margins left/right and top/bottom (a floating panel, never a
           full-screen takeover).
           v2.2.2 (owner note: «الوندو… مش ملىء شاشة الموبايل، في نص الشاشة
           وفيه هوامش من كل الاتجاهات وتحتها خلفية تفصل الويبسايت عن الوندو»):
           16px هوامش من كل الاتجاهات + ارتفاع أقصى 72dvh/560px — نافذة
           حقيقية مش شاشة كاملة، والطبقة الخلفية (azux-chat-backdrop) تفصل
           الموقع عنها تحت. */
        .aze-fab { right: -10px; top: 50%; width: 48px; height: 48px; font-size: 1.1rem; transform: translateY(-50%); opacity: .45; }
        .aze-bubble { width: 24px; height: 24px; }
        .aze-fab img { border-width: 2px; }
        .aze-fab:hover, .aze-fab:focus-visible, .aze-fab.is-open { right: -2px; opacity: 1; }
        .aze-nudge { right: 34px; top: 50%; transform: translateY(-50%); max-width: min(230px, calc(100vw - 90px)); border-radius: 18px 4px 18px 18px; }
        .aze-chat { left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: calc(100vw - 32px); height: min(72dvh, 560px); border-radius: 20px; box-shadow: 0 24px 60px -18px rgba(10,16,48,.55); }
}
/* v2.2.1 (owner note: الأوباسيتي بتاعة الأزرار الجانبية متساوية) ثم v2.2.2
   (owner note: «الايقونات الجانبية تكون اوباستي ضعيف»): كل الأزرار الجانبية
   (الشات + الكاميرا + تطبيق) رجعت لنمط السكون الهادي: 0.45 في السكون،
   1.0 بالهوفر/التركيز، نفس الإيقاع 52px على الحافة. */
@media (prefers-reduced-motion: reduce) { .aze-loader__logo img, .aze-loader__dot, .aze-loader__ring, .aze-fab.is-ping, .aze-pop__icon { animation: none !important; } }
