/* --- Floating action stack: call / WhatsApp / back-to-top ---
   Site-wide, loaded globally (see layouts/base.php) rather than via a
   page's extra_css, since it renders on every page. Button chrome matches
   .nav-toggle's existing floating-circle style (same radius/border/shadow
   tokens) so it reads as part of the same design system, not a bolted-on
   widget. WhatsApp is the one place this site uses a color outside its
   3-color brand palette (blue/black/white) — a third-party service mark
   like this needs its own recognizable brand color to actually read as
   "WhatsApp" at a glance, the same reasoning that let the Google Reviews
   badge keep Google's real four-color G elsewhere on the site. */

.floating-actions {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: calc(var(--z-toast) + 20);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-sm);
}

/* The cookie banner spans the full bottom edge while consent is undecided
   — nudge the stack up above it rather than letting the two overlap. Its
   three action buttons wrap onto their own rows on narrow phones (measured
   ~215px there vs. ~97px on desktop, where they fit on one row), so mobile
   needs a much bigger offset than desktop, not just a small tweak. */
body:has([data-cookie-banner]:not([hidden])) .floating-actions {
  bottom: 15rem;
}

@media (min-width: 48rem) {
  body:has([data-cookie-banner]:not([hidden])) .floating-actions {
    bottom: 7.5rem;
  }
}

.floating-actions__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), opacity var(--duration-fast) var(--ease-out);
}

.floating-actions__btn:hover {
  transform: translateY(-2px);
  background: var(--color-bg-surface);
}

.floating-actions__btn svg {
  width: 1.35rem;
  height: 1.35rem;
}

.floating-actions__btn--top {
  width: 2.75rem;
  height: 2.75rem;
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
}

.floating-actions__btn--top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.floating-actions__btn--whatsapp {
  width: 3.5rem;
  height: 3.5rem;
  background: #25d366;
  border-color: #25d366;
}

.floating-actions__btn--whatsapp svg {
  width: 1.75rem;
  height: 1.75rem;
}

.floating-actions__btn--whatsapp:hover {
  background: #20bd5a;
  border-color: #20bd5a;
}

/* Hover-reveal label — expands out to the left of the button rather than
   a generic title-attribute tooltip, per the brief. */
.floating-actions__label {
  position: absolute;
  right: calc(100% + var(--space-sm));
  top: 50%;
  transform: translateY(-50%) translateX(0.5rem);
  white-space: nowrap;
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-full);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.floating-actions__btn:hover .floating-actions__label,
.floating-actions__btn:focus-visible .floating-actions__label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .floating-actions__btn,
  .floating-actions__label {
    transition: none;
  }
}

/* --- WhatsApp compose panel --- */

.whatsapp-panel {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-toast) + 25);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: var(--space-md);
}

.whatsapp-panel[hidden] {
  display: none;
}

.whatsapp-panel__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.5);
}

.whatsapp-panel__card {
  position: relative;
  width: min(100%, 22rem);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  animation: whatsapp-panel-in var(--duration-base) var(--ease-out);
}

@keyframes whatsapp-panel-in {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-panel__card {
    animation: none;
  }
}

.whatsapp-panel__header {
  position: relative;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  background: var(--color-gradient-brand);
  text-align: center;
  color: #ffffff;
}

.whatsapp-panel__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.whatsapp-panel__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.whatsapp-panel__avatar {
  width: 3.5rem;
  height: 3.5rem;
  margin-inline: auto;
  margin-bottom: var(--space-xs);
  border-radius: var(--radius-full);
  background: #0a0f16;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.whatsapp-panel__avatar img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.whatsapp-panel__name {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-lg);
  letter-spacing: 0.02em;
}

.whatsapp-panel__sub {
  font-size: var(--fs-sm);
  opacity: 0.85;
}

.whatsapp-panel__body {
  padding: var(--space-md) var(--space-lg);
}

.whatsapp-panel__hint {
  font-size: var(--fs-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-sm);
}

.whatsapp-panel__textarea {
  width: 100%;
  resize: vertical;
  min-height: 5.5rem;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--fs-sm);
}

.whatsapp-panel__textarea:focus-visible {
  outline: none;
  border-color: var(--color-accent-blue);
  box-shadow: var(--shadow-focus);
}

.whatsapp-panel__footer {
  padding: 0 var(--space-lg) var(--space-lg);
}

@media (max-width: 26rem) {
  .whatsapp-panel {
    padding: 0;
  }

  .whatsapp-panel__card {
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}
