/* ==========================================================================
   Tisira — widgets.css (W6Q, lane L6Q.D; tools/site/widgets.mjs draws the markup, src/js/widgets.js wakes it)
   The helpers both sites share, after AGX (E:/Al Ghafaq X/site: .soc, .scrollnav, .agxwa) in Tisira's tokens:
   - round social icons that lift and fill with the network's own colour (Instagram's gradient),
   - the "Secure payment methods" row (only where a checkout is live),
   - the floating WhatsApp chat card at the bottom inline-end and the scroll up/down buttons at the bottom
     inline-start (habiix-v2 src/lib/contracts/store-widgets.ts: the storefront's layout, so both feel like one product).
   Loaded after site.css on every page; light by default, dark by prefers-color-scheme; logical properties throughout.
   ========================================================================== */

:root {
  --tw-wa: #1DA851;                     /* WhatsApp green, deepened so its white mark reads (3.1:1) */
  --tw-wa-glow: rgba(37, 211, 102, .45);
  --tw-x: 20px;                         /* the helpers' distance from the inline edges */
  --tw-y: 20px;                         /* and from the bottom (SF_WA_CHAT.edgePx) */
  --tw-gap: 10px;                       /* between the scroll buttons (SF_SCROLL_BUTTONS.gapPx) */
  --tw-head: #262420;                   /* the chat card's header: Basalt, like the site's bands */
  --tw-chat: var(--ground-2);
  --tw-bubble: var(--card);
  --tw-shadow: 0 24px 60px -18px rgba(20, 18, 15, .45), 0 2px 8px rgba(20, 18, 15, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --tw-head: #1B1A17;
    --tw-chat: #22201D;
    --tw-bubble: #36332E;
    --tw-shadow: 0 24px 60px -16px rgba(0, 0, 0, .75), 0 2px 8px rgba(0, 0, 0, .4);
  }
}

/* --------------------------------------------------------------- social links */

.tw-soc {
  --tw-c: var(--ink);
  --tw-on: #FFFFFF;
  --tw-glow: rgba(20, 18, 15, .35);
  --tw-edge: transparent;
  position: relative;
  display: inline-grid; place-items: center; flex: none;
  inline-size: 40px; block-size: 40px; border-radius: 50%;
  color: var(--muted);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid var(--rule-2);
  text-decoration: none;
  transition: transform .22s var(--ease), background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.tw-soc__g { display: block; inline-size: 18px; block-size: 18px; fill: currentColor; }
.tw-soc:is(:hover, :focus-visible) {
  transform: translateY(-3px);
  color: var(--tw-on); background: var(--tw-c); border-color: var(--tw-edge);
  box-shadow: 0 6px 18px var(--tw-glow);
  text-decoration: none;
}
.tw-soc:focus-visible { border-radius: 50%; }
.site-footer .tw-soc:hover { text-decoration: none; }
/* the footer: four to a row (seven marks: 4 + 3, none left alone on its line) */
.site-footer .soc-list { display: grid; grid-template-columns: repeat(4, max-content); gap: 10px; }

/* each network lights up in its own colour (white marks keep 3:1 or more on every fill) */
.tw-soc--wa { --tw-c: var(--tw-wa); --tw-glow: var(--tw-wa-glow); }
.tw-soc--ig { --tw-c: radial-gradient(circle at 30% 107%, #FDF497 0%, #FD5949 45%, #D6249F 60%, #285AEB 90%); --tw-glow: rgba(214, 36, 159, .45); }
.tw-soc--fb { --tw-c: #0866FF; --tw-glow: rgba(8, 102, 255, .45); }
.tw-soc--x { --tw-c: #000000; --tw-glow: rgba(0, 0, 0, .5); --tw-edge: rgba(244, 242, 237, .4); }
.tw-soc--sc { --tw-c: #FFFC00; --tw-on: #111111; --tw-glow: rgba(255, 252, 0, .4); }
.tw-soc--tt { --tw-c: #000000; --tw-on: #25F4EE; --tw-glow: rgba(37, 244, 238, .35); --tw-edge: rgba(244, 242, 237, .4); }
.tw-soc--tt:is(:hover, :focus-visible) .tw-soc__g { filter: drop-shadow(1.2px 1.2px 0 #FE2C55); }
.tw-soc--th { --tw-c: #000000; --tw-glow: rgba(0, 0, 0, .5); --tw-edge: rgba(244, 242, 237, .4); }
.tw-soc--li { --tw-c: #0A66C2; --tw-glow: rgba(10, 102, 194, .45); }
.tw-soc--yt { --tw-c: #FF0000; --tw-glow: rgba(255, 0, 0, .4); }
.tw-soc--mail { --tw-c: linear-gradient(135deg, #E5662F, #B4471A); --tw-glow: rgba(229, 102, 47, .45); }

/* the contact page: the same round mark beside the network's name */
.socials { gap: 10px; }
.tw-soc--chip {
  display: inline-flex; gap: 10px;
  inline-size: auto; block-size: 46px; border-radius: 999px;
  padding-inline: 5px 18px;
  color: var(--ink); background: transparent; border-color: var(--rule-2);
  font: 600 .95rem/1 var(--f-text);
}
.tw-soc--chip .tw-soc__l:lang(ar) { font-family: var(--f-ar); }
.tw-soc__disc {
  display: grid; place-items: center; flex: none;
  inline-size: 34px; block-size: 34px; border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.tw-soc--chip .tw-soc__g { inline-size: 17px; block-size: 17px; }
.tw-soc--chip:is(:hover, :focus-visible) {
  transform: translateY(-2px);
  color: var(--ink); background: transparent; border-color: var(--ink); box-shadow: none;
}
.tw-soc--chip:focus-visible { border-radius: 999px; }
.tw-soc--chip:is(:hover, :focus-visible) .tw-soc__disc { background: var(--tw-c); color: var(--tw-on); box-shadow: 0 6px 16px var(--tw-glow); }

/* --------------------------------------------------------------- payment methods */

.tw-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.tw-pay__t {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font: 600 .76rem/1.3 var(--f-text); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.tw-pay__t:lang(ar) { font-family: var(--f-ar); font-size: .9rem; letter-spacing: 0; text-transform: none; }
.tw-pay__lock { inline-size: 16px; block-size: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tw-pay .tw-pay__list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.tw-pay__list img { display: block; inline-size: 46px; block-size: auto; border-radius: 6px; }
.tw-pay__note { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; max-inline-size: 46ch; text-wrap: pretty; }
.tw-pay--footer { padding-block: 26px; border-block-end: 1px solid var(--rule); }
.tw-pay--footer .tw-pay__note { margin-inline-start: auto; text-align: end; }
/* two classes: the sales page's embedded styles (inline, after this file) reset every margin with .acx * { margin: 0 },
   which tied with one class and won, so the row sat flush under the pricing cards (the live check) */
.tw-pay.tw-pay--academy { flex-direction: column; justify-content: center; text-align: center; gap: 10px; margin-block: 28px 0; color: inherit; }
.tw-pay--academy .tw-pay__t, .tw-pay--academy .tw-pay__note { color: inherit; opacity: .82; }
.tw-pay--academy .tw-pay__list { justify-content: center; }
.tw-pay--plans { flex-direction: column; align-items: flex-start; gap: 8px; margin-block: 20px 4px; }
.tw-pay--plans .tw-pay__list img { inline-size: 40px; }
.tw-pay--plans .tw-pay__note { font-size: .8rem; }
@media (max-width: 760px) {
  .tw-pay--footer { flex-direction: column; align-items: flex-start; }
  .tw-pay--footer .tw-pay__note { margin-inline-start: 0; text-align: start; }
}

/* --------------------------------------------------------------- floating helpers */

.tw-wa, .tw-scroll {
  position: fixed; z-index: 80;
  inset-block-end: calc(var(--tw-y) + env(safe-area-inset-bottom, 0px) + var(--tw-lift, 0px));
  transition: inset-block-end .3s var(--ease), opacity .2s ease, visibility .2s;
}
.tw-wa { inset-inline-end: calc(var(--tw-x) + env(safe-area-inset-right, 0px)); }
.tw-scroll { inset-inline-start: calc(var(--tw-x) + env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; }
[dir="rtl"] .tw-wa { inset-inline-end: calc(var(--tw-x) + env(safe-area-inset-left, 0px)); }
[dir="rtl"] .tw-scroll { inset-inline-start: calc(var(--tw-x) + env(safe-area-inset-right, 0px)); }
/* a helper never sits over a call to action, a small link or a form: widgets.js marks it shy while one is beneath it
   (verify-w6q N4: ".tw-scroll" in front, so a shy scroll button beats the shown state, .tw-scroll__btn.is-on, below) */
.tw-wa.is-shy:not(.is-open), .tw-scroll .tw-scroll__btn.is-shy, .tw-scroll.is-idle .tw-scroll__btn { opacity: 0; visibility: hidden; pointer-events: none; }
/* and steps aside while the menu, the cart or a dialog is open */
html:has(.menu.is-open, .cart.is-open, dialog[open]) .tw-float > * { opacity: 0; visibility: hidden; pointer-events: none; }
/* verify-w6q N4: the helpers never cover what the visitor is doing. While the chat card is open the scroll buttons wait
   (on a phone the card spans the screen); while a field of the page has the focus (widgets.js sets .tw-typing: on a
   phone the keyboard lifts the helpers over the form) both wait; over a form they step aside (widgets.js, is-shy) */
.tw-float:has(.tw-wa.is-open) .tw-scroll { opacity: 0; visibility: hidden; pointer-events: none; }
html.tw-typing .tw-scroll, html.tw-typing .tw-wa:not(.is-open) { opacity: 0; visibility: hidden; pointer-events: none; }
/* the Academy sales page brought its own WhatsApp button: the chat card replaces it */
.has-tw .acx .wa-fab { display: none !important; }
/* the last line of a page clears the helpers at the page's end (the chat button's 58 px, its 20 px corner and a margin),
   on a phone and a desktop alike (verify-w6q N4) */
.has-tw .site-footer { padding-block-end: calc(32px + 76px + env(safe-area-inset-bottom, 0px)); }

/* the scroll buttons: "up" wears the reading progress as a saffron ring */
.tw-scroll__btn {
  --p: 0;
  position: relative; display: grid; place-items: center;
  inline-size: 46px; block-size: 46px; margin: 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: var(--btn-ink);
  background: conic-gradient(var(--saffron) calc(var(--p) * 1%), color-mix(in srgb, var(--btn-bg) 26%, transparent) 0);
  box-shadow: 0 8px 20px -8px rgba(20, 18, 15, .55);
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(.9);
  transition: opacity .3s ease, transform .3s var(--ease), visibility .3s, block-size .3s var(--ease), margin .3s var(--ease);
}
.tw-scroll__btn + .tw-scroll__btn { margin-block-start: var(--tw-gap); }
/* a hidden button gives its place up, so the one left sits in the corner */
.tw-scroll__btn:not(.is-on) { block-size: 0; }
.tw-scroll__btn:not(.is-on) + .tw-scroll__btn, .tw-scroll__btn + .tw-scroll__btn:not(.is-on) { margin-block-start: 0; }
.tw-scroll__btn::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--btn-bg); transition: background .25s ease; }
.tw-scroll__btn--down { background: color-mix(in srgb, var(--btn-bg) 26%, transparent); }
.tw-scroll__btn svg { position: relative; inline-size: 20px; block-size: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.tw-scroll__btn.is-on { opacity: 1; visibility: visible; transform: none; }
.tw-scroll__btn.is-on:hover { transform: translateY(-3px); color: var(--btn-hover-ink); }
.tw-scroll__btn:hover::before { background: var(--btn-hover); }
.tw-scroll__btn--up:hover svg { transform: translateY(-2px); }
.tw-scroll__btn--down:hover svg { transform: translateY(2px); }
.tw-scroll__btn--up.is-far { box-shadow: 0 8px 24px -6px rgba(229, 102, 47, .6); }
.tw-scroll__btn:focus-visible { border-radius: 50%; }

/* the WhatsApp button */
.tw-wa__fab {
  position: relative; display: grid; place-items: center;
  inline-size: 58px; block-size: 58px; margin: 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: #FFFFFF; background: var(--tw-wa);
  box-shadow: 0 10px 24px -8px rgba(29, 168, 81, .7), 0 2px 6px rgba(20, 18, 15, .2);
  transition: transform .2s var(--ease), box-shadow .2s ease;
}
.tw-wa__fab:hover { transform: scale(1.06); box-shadow: 0 12px 30px -6px var(--tw-wa-glow), 0 2px 6px rgba(20, 18, 15, .2); }
.tw-wa__fab:focus-visible { border-radius: 50%; }
.tw-wa__fab > svg { grid-area: 1 / 1; transition: transform .25s var(--ease), opacity .2s ease; }
.tw-wa__g { inline-size: 30px; block-size: 30px; fill: currentColor; }
.tw-wa__x { inline-size: 22px; block-size: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.tw-wa__fab .tw-wa__x { opacity: 0; transform: rotate(-90deg) scale(.6); }
.tw-wa.is-open .tw-wa__fab .tw-wa__g { opacity: 0; transform: rotate(90deg) scale(.6); }
.tw-wa.is-open .tw-wa__fab .tw-wa__x { opacity: 1; transform: none; }
.tw-wa__dot {
  position: absolute; inset-block-start: 1px; inset-inline-end: 1px;
  inline-size: 15px; block-size: 15px; border-radius: 50%;
  background: var(--saffron); border: 2.5px solid var(--ground);
}
.tw-wa__dot[hidden] { display: none; }
.tw-wa__fab.is-pulse { animation: tw-pulse 2.6s ease-out 3; }
@keyframes tw-pulse {
  0% { box-shadow: 0 0 0 0 rgba(29, 168, 81, .55), 0 10px 24px -8px rgba(29, 168, 81, .7); }
  70% { box-shadow: 0 0 0 16px rgba(29, 168, 81, 0), 0 10px 24px -8px rgba(29, 168, 81, .7); }
  100% { box-shadow: 0 0 0 0 rgba(29, 168, 81, 0), 0 10px 24px -8px rgba(29, 168, 81, .7); }
}

/* the chat card */
.tw-wa__card {
  position: absolute; inset-block-end: calc(100% + 14px); inset-inline-end: 0;
  inline-size: min(344px, calc(100vw - 2 * var(--tw-x)));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 20px;
  box-shadow: var(--tw-shadow);
  transform-origin: 100% 100%;
  opacity: 0; transform: translateY(12px) scale(.96);
  transition: opacity .2s ease, transform .28s var(--ease);
}
[dir="rtl"] .tw-wa__card { transform-origin: 0 100%; }
.tw-wa__card[hidden] { display: none; }
.tw-wa.is-open .tw-wa__card { opacity: 1; transform: none; }
.tw-wa__card:focus { outline: none; }
.tw-wa__head { display: flex; align-items: center; gap: 12px; padding: 14px; padding-inline: 16px 12px; background: var(--tw-head); color: #F4F2ED; }
.tw-wa__ava {
  position: relative; display: grid; place-items: center; flex: none;
  inline-size: 46px; block-size: 46px; border-radius: 50%;
  background: #F4F2ED; box-shadow: 0 0 0 2px rgba(244, 242, 237, .22);
}
.tw-wa__sym { inline-size: 31px; block-size: 31px; }
.tw-wa__who { flex: 1; min-inline-size: 0; }
.tw-wa__name { margin: 0; font: 600 1.08rem/1.2 var(--f-display); color: #F4F2ED; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-wa__sub { margin: 2px 0 0; font-size: .8rem; line-height: 1.35; color: rgba(244, 242, 237, .78); }
.tw-wa__close {
  display: grid; place-items: center; flex: none;
  inline-size: 34px; block-size: 34px; margin: 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: #F4F2ED; background: rgba(244, 242, 237, .12);
  transition: background .2s ease;
}
.tw-wa__close:hover { background: rgba(244, 242, 237, .24); }
.tw-wa__close:focus-visible { border-radius: 50%; outline-color: #F07A45; }
.tw-wa__close .tw-wa__x { inline-size: 16px; block-size: 16px; }
.tw-wa__chat {
  display: flex; align-items: flex-start; min-block-size: 104px; padding: 18px 16px;
  background-color: var(--tw-chat);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1.3px);
  background-size: 14px 14px;
}
.tw-wa__bubble, .tw-wa__typing {
  position: relative; margin: 0; margin-inline-start: 7px;
  background: var(--tw-bubble); color: var(--ink);
  border-radius: 14px; border-start-start-radius: 3px;
  box-shadow: 0 1px 1.5px rgba(20, 18, 15, .14);
}
.tw-wa__bubble::before, .tw-wa__typing::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline-start: -7px;
  inline-size: 8px; block-size: 11px; background: var(--tw-bubble);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}
[dir="rtl"] :is(.tw-wa__bubble, .tw-wa__typing)::before { clip-path: polygon(0 0, 100% 0, 0 100%); }
.tw-wa__bubble { max-inline-size: 88%; padding: 10px 14px; font-size: .95rem; line-height: 1.55; }
.tw-wa__bubble[hidden], .tw-wa__typing[hidden] { display: none; }
.tw-wa__typing { display: flex; gap: 5px; padding: 13px 15px; }
.tw-wa__typing i { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--muted); opacity: .7; animation: tw-type 1.2s infinite; }
.tw-wa__typing i:nth-child(3) { animation-delay: .2s; }
.tw-wa__typing i:nth-child(4) { animation-delay: .4s; }
@keyframes tw-type { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }
.tw-wa__foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--card); border-block-start: 1px solid var(--rule); }
.tw-wa__input {
  flex: 1; min-inline-size: 0; block-size: 44px; margin: 0; padding-inline: 16px;
  font: inherit; font-size: 1rem;            /* 16 px: iOS does not zoom into the field */
  color: var(--ink); background: var(--ground);
  border: 1px solid var(--field-edge); border-radius: 999px;
  transition: border-color .2s ease;
}
.tw-wa__input::placeholder { color: var(--muted); opacity: 1; }
.tw-wa__input:focus-visible { outline-offset: 2px; border-radius: 999px; }
.tw-wa__send {
  display: grid; place-items: center; flex: none;
  inline-size: 44px; block-size: 44px; border-radius: 50%;
  color: #FFFFFF; background: var(--tw-wa);
  transition: transform .2s var(--ease), box-shadow .2s ease;
}
.tw-wa__send:hover { transform: scale(1.06); box-shadow: 0 6px 16px -4px var(--tw-wa-glow); }
.tw-wa__send:focus-visible { border-radius: 50%; }
.tw-wa__plane { inline-size: 20px; block-size: 20px; fill: currentColor; margin-inline-start: 2px; }
[dir="rtl"] .tw-wa__plane { transform: scaleX(-1); }

@media (max-width: 560px) {
  :root { --tw-x: 14px; --tw-y: 16px; }
  .tw-wa__fab { inline-size: 54px; block-size: 54px; }
  .tw-wa__g { inline-size: 28px; block-size: 28px; }
  .tw-scroll__btn { inline-size: 44px; block-size: 44px; }
  .tw-scroll__btn svg { inline-size: 18px; block-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .tw-soc, .tw-soc__disc, .tw-wa, .tw-scroll, .tw-scroll__btn, .tw-scroll__btn svg, .tw-wa__fab, .tw-wa__fab > svg, .tw-wa__card, .tw-wa__send { transition: none; }
  .tw-soc:is(:hover, :focus-visible), .tw-scroll__btn.is-on:hover, .tw-wa__fab:hover, .tw-wa__send:hover { transform: none; }
  .tw-wa__fab.is-pulse, .tw-wa__typing i { animation: none; }
}
.motion-paused .tw-wa__fab.is-pulse, .motion-paused .tw-wa__typing i { animation: none; }
@media print { .tw-float { display: none !important; } }
