/*
 * Floating action stack (inc/floating-action-buttons.php), bottom-right: back to top · Zalo · call.
 * Anchored at the bottom, so the back-to-top button fading in above never shifts the contact buttons.
 * Sits to the right of the bottom-centre toast.
 */

.floating-actions {
  position: fixed;
  right: max(var(--space-4), env(safe-area-inset-right));
  bottom: max(var(--space-4), env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.floating-actions__button {
  display: grid;
  place-items: center;
  width: var(--control-height-lg);
  height: var(--control-height-lg);
  padding: 0;
  border: 2px solid var(--color-surface); /* ring keeps the buttons visible over the dark footer */
  border-radius: 50%;
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.floating-actions__button:hover {
  transform: translateY(-2px);
  background: var(--button-bg-hover);
  color: var(--button-text); /* override base a:hover (dark = icon vanishes) */
}

.floating-actions__button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Zalo in its own brand blue, so visitors recognise it at a glance. */
.floating-actions__button--zalo,
.floating-actions__button--zalo:hover {
  background: #0068ff;
}

.floating-actions__zalo {
  font-size: 0.8rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.01em;
}

/* Back to top: secondary look, fades in after scrolling (back-to-top.js toggles hidden + .is-visible). */
.back-to-top {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-primary);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base), background-color var(--transition-fast);
}

.back-to-top:hover {
  background: var(--color-surface-muted);
  color: var(--color-primary);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* While the mobile filter drawer is open the page behind is locked: hide the whole stack. */
body.shop-filter-lock .floating-actions,
body.mobile-drawer-lock .floating-actions {
  display: none;
}

@media (min-width: 900px) {
  .floating-actions {
    right: max(var(--space-5), env(safe-area-inset-right));
    bottom: max(var(--space-5), env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-actions__button,
  .back-to-top {
    transition: none;
    transform: none;
  }
}
