/* ==========================================================================
   Quick actions — global, one instance outside every section
   Booking sits alone on the right; WhatsApp + Call sit together on the left.
   ≥768px: floating in the two bottom corners. WhatsApp + Call are compact
           circles whose label slides out (toward the page) on hover / keyboard
           focus; booking is always a labelled gradient pill (primary action).
   <768px: one fixed bottom bar — booking pill on the right, the two circles on
           the left, above the home indicator (safe-area), with page padding.
   ========================================================================== */

.quick-actions {
  --qa-edge: var(--space-3);        /* 24px from the viewport edges */
  --qa-size: var(--space-7);        /* 56px button height */
  --qa-icon: var(--space-6);        /* 48px icon circle */
  --qa-inset: var(--space-0-5);     /* 4px ring around the icon circle */

  position: fixed;
  z-index: 40; /* above content, below the sticky header (50) and drawers (60+) */
  right: calc(var(--qa-edge) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--qa-edge) + env(safe-area-inset-bottom, 0px));
  left: calc(var(--qa-edge) + env(safe-area-inset-left, 0px));
  display: flex;
  align-items: flex-end;
  justify-content: space-between; /* RTL: booking → right corner, contact → left corner */
  pointer-events: none;           /* the empty middle never blocks the page */
}

.quick-actions__contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* RTL end: hugs the left edge */
  gap: var(--space-2);
}

.quick-action {
  display: inline-flex;
  align-items: center;
  height: var(--qa-size);
  padding: var(--qa-inset);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-neutral-100);
  color: var(--color-primary-700);
  font-size: var(--font-size-b2);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-b2);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 4px rgb(19 61 63 / 0.06), 0 8px 24px rgb(19 61 63 / 0.14);
  -webkit-tap-highlight-color: transparent;
  transition:
    box-shadow var(--duration-slow) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-smooth);
}

/* DOM order is [label][icon] → in RTL the icon sits on the left: against the
   left edge for the contact circles, at the end like the page CTAs for booking. */
.quick-action__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--qa-icon);
  height: var(--qa-icon);
  border-radius: var(--radius-circle);
  transition: transform var(--duration-slow) var(--ease-smooth);
}

.quick-action__label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-width var(--duration-slow) var(--ease-smooth),
    padding var(--duration-slow) var(--ease-smooth),
    opacity var(--duration-base) ease;
}

.quick-action--whatsapp .quick-action__icon {
  background: var(--color-secondary);   /* brand green */
  color: var(--color-text-on-brand);
}

.quick-action--call .quick-action__icon {
  background: var(--color-primary-100); /* light aqua */
  color: var(--color-primary-700);
}

/* Primary: always labelled, brand gradient, white icon circle like the CTAs */
.quick-action--book {
  background: var(--gradient-cta);
  color: var(--color-text-on-brand);
  box-shadow: 0 4px 16px rgb(46 146 151 / 0.28);
}

.quick-action--book .quick-action__icon {
  background: var(--color-neutral-100);
  color: var(--color-primary);
}

.quick-action--book .quick-action__label {
  max-width: none;
  opacity: 1;
  padding-inline: var(--space-3) var(--space-2);
}

.quick-action__arrow {
  transform: translate(var(--arrow-x, 0), var(--arrow-y, 0)) scaleX(-1);
  transition: transform var(--duration-slow) var(--ease-smooth);
}

/* ---- Hover / focus ---- */
.quick-action:hover,
.quick-action:focus-visible {
  box-shadow: 0 2px 4px rgb(19 61 63 / 0.06), 0 12px 32px rgb(19 61 63 / 0.18);
}

.quick-action--book:hover,
.quick-action--book:focus-visible {
  box-shadow: 0 8px 24px rgb(46 146 151 / 0.36);
}

/* Contact label opens to the right of its circle, toward the page */
.quick-actions__contact .quick-action:hover .quick-action__label,
.quick-actions__contact .quick-action:focus-visible .quick-action__label {
  max-width: 8em;
  opacity: 1;
  padding-inline: var(--space-2) var(--space-1);
}

.quick-actions__contact .quick-action:hover .quick-action__icon {
  transform: rotate(8deg);
}

.quick-action--book:hover .quick-action__arrow {
  --arrow-x: -2px;
  --arrow-y: -2px;
}

.quick-action:active {
  transform: scale(0.96);
}

.quick-action:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .quick-actions__contact .quick-action:hover .quick-action__icon {
    transform: none;
  }
}

@media print {
  .quick-actions {
    display: none;
  }
}

/* ==========================================================================
   Mobile: one fixed bottom bar
   ========================================================================== */
@media (max-width: 767.98px) {
  .quick-actions {
    --qa-size: var(--space-6);   /* 48px */
    --qa-icon: var(--space-5);   /* 40px */

    inset: auto 0 0;
    align-items: center;
    gap: var(--space-1);
    padding:
      var(--space-1)
      calc(var(--space-2) + env(safe-area-inset-right, 0px))
      calc(var(--space-1) + env(safe-area-inset-bottom, 0px))
      calc(var(--space-2) + env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--color-neutral-200);
    background: rgb(255 255 255 / 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 -8px 24px rgb(19 61 63 / 0.08);
    pointer-events: auto;
  }

  .quick-actions__contact {
    flex-direction: row;
    gap: var(--space-1);
  }

  .quick-action {
    box-shadow: none;
  }

  /* WhatsApp + Call: circles on a pale pill (label stays in the accessible name) */
  .quick-actions__contact .quick-action {
    background: var(--color-pill);
  }

  .quick-actions__contact .quick-action:hover .quick-action__label,
  .quick-actions__contact .quick-action:focus-visible .quick-action__label {
    max-width: 0;
    padding-inline: 0;
  }

  .quick-action--book,
  .quick-action--book:hover,
  .quick-action--book:focus-visible {
    flex: 1 1 auto;
    box-shadow: none;
  }

  .quick-action--book .quick-action__label {
    flex: 1 1 auto;
    text-align: start;
  }

  /* Keep the end of the page reachable above the bar */
  body {
    padding-bottom: calc(var(--space-6) + var(--space-2) + 1px + env(safe-area-inset-bottom, 0px));
  }
}
