/* ─────────────────────────────────────────────────────────────────────────────
   Floating bottom-left cluster: language selector + Waze + Google Maps.
   Purely additive — scoped under .az-fab so it cannot affect existing layout.
   Visual treatment mirrors .site-header-inner (the shyen glass header) so the
   cluster reads as part of the same brand system: deep-forest glass, hairline
   white border, forest-tinted shadow, pistachio accent.
   ───────────────────────────────────────────────────────────────────────────── */

.az-fab {
  /* brand tokens (mirrored from tailwind.config.js — do not invent new ones) */
  --az-forest-950: #091814;
  --az-forest-900: #112115;
  --az-forest-800: #1b3320;
  --az-pistachio: #becb6d;
  --az-pistachio-soft: #eaf1c1;
  --az-cream: #fbfdea;
  --az-glass: rgba(9, 24, 20, 0.42);
  --az-glass-solid: linear-gradient(180deg, rgba(22, 42, 28, 0.95) 0%, rgba(9, 24, 20, 0.95) 100%);
  --az-hairline: rgba(255, 255, 255, 0.15);
  --az-shadow: 0 16px 44px -16px rgba(9, 24, 20, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --az-size: 48px;
  --az-gap: 10px;
  /* lifts above the /rendez-vous mobile contact bar when that bar is present */
  --az-bottom: 24px;

  position: fixed;
  z-index: 70; /* under the ask-widget popup (95) and its bubble (80) */
  left: 16px;
  bottom: calc(var(--az-bottom) + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: var(--az-gap);
  direction: ltr; /* cluster order stays stable even on RTL pages */
}

@media (min-width: 640px) {
  .az-fab { left: 24px; --az-bottom: 24px; }
}

/* the rdv page renders a full-width mobile contact bar (76px) — clear it */
html.has-rdv-mobile-contact .az-fab { --az-bottom: 92px; }
@media (min-width: 768px) {
  html.has-rdv-mobile-contact .az-fab { --az-bottom: 24px; }
}

/* ── shared button ───────────────────────────────────────────────────────── */
.az-fab__btn {
  position: relative;
  width: var(--az-size);
  height: var(--az-size);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--az-hairline);
  border-radius: 16px;
  background: var(--az-glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--az-shadow);
  color: var(--az-cream);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
}

.az-fab__btn:hover {
  transform: translateY(-2px);
  border-color: rgba(190, 203, 109, 0.55);
  box-shadow: 0 22px 52px -18px rgba(9, 24, 20, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.az-fab__btn:focus-visible {
  outline: 2px solid var(--az-pistachio);
  outline-offset: 3px;
}

.az-fab__btn img,
.az-fab__btn svg {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

/* brand marks keep their own colours and clear space — never recoloured */
.az-fab__btn--brand {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(9, 24, 20, 0.12);
}
.az-fab__btn--brand:hover { background: #fff; }

/* ── language trigger ────────────────────────────────────────────────────── */
.az-fab__lang {
  width: auto;
  min-width: var(--az-size);
  padding: 0 14px;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.az-fab__lang .az-fab__chev {
  width: 12px;
  height: 12px;
  opacity: 0.75;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.az-fab__lang[aria-expanded="true"] .az-fab__chev { transform: rotate(180deg); }

/* ── expanding menu (upward) ─────────────────────────────────────────────── */
.az-fab__menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  min-width: 190px;
  padding: 6px;
  margin: 0;
  list-style: none;
  border-radius: 18px;
  overflow: hidden;
  background: var(--az-glass-solid);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transform-origin: bottom left;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.2s;
}

.az-fab__menu[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.az-fab__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--az-cream);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.az-fab__opt:hover,
.az-fab__opt:focus-visible { background: rgba(190, 203, 109, 0.16); }
.az-fab__opt:focus-visible { outline: 2px solid var(--az-pistachio); outline-offset: -2px; }

.az-fab__opt[aria-current="true"] {
  background: rgba(190, 203, 109, 0.22);
  font-weight: 600;
}
.az-fab__opt[aria-current="true"]::after {
  content: "";
  margin-inline-start: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--az-pistachio);
}

.az-fab__code {
  flex: 0 0 auto;
  min-width: 26px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--az-pistachio-soft);
  opacity: 0.9;
}

/* option labels render in their own script/direction */
.az-fab__opt[lang="ar"] .az-fab__native { direction: rtl; font-size: 15px; }

/* ── tooltip ─────────────────────────────────────────────────────────────── */
.az-fab__tip {
  /* Left-anchored, not centred: the cluster sits ~16-24px from the viewport
     edge, so a centred tooltip would be clipped off-screen. */
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  transform: translateY(4px);
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--az-forest-950);
  color: var(--az-cream);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 24px -12px rgba(9, 24, 20, 0.6);
}

.az-fab__btn:hover .az-fab__tip,
.az-fab__btn:focus-visible .az-fab__tip {
  opacity: 1;
  transform: translateY(0);
}

/* coarse pointers get no hover tooltip (it would stick after tap) */
@media (hover: none) {
  .az-fab__tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .az-fab__btn,
  .az-fab__menu,
  .az-fab__tip,
  .az-fab__chev { transition: none; }
}
