/* ===== Quick Actions (glassy) ===== */
:root {
  --qa-elev: 2600;
  --qa-ink: #72480c; /* text color on lighter glass */
}

.qa-root {
  display: contents;
} /* keeps DOM flat; all elements fixed to viewport */

/* Mobile only (show). Desktop hidden by default (change if you want it on desktop) */
@media (min-width: 993px) {
  .qa-fab,
  .qa-overlay,
  .qa-sheet {
    display: none !important;
  }
}

/* ---- FAB (collapsed pill) ---- */
.qa-fab {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: var(--qa-elev);

  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font: 800 14px/1.1 Manrope, system-ui, sans-serif;
  color: var(--qa-ink);

  background: color-mix(in srgb, var(--main) 14%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid #ffffff35;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);

  transition: transform 0.22s ease, filter 0.2s ease, opacity 0.2s ease;
}
.qa-fab i {
  font-size: 16px;
  line-height: 1;
}
@media (hover: hover) {
  .qa-fab:hover {
    transform: translateX(-50%) translateY(-2px);
    filter: brightness(1.05);
  }
  .qa-fab:active {
    transform: translateX(-50%) translateY(0);
  }
}

/* ---- Overlay ---- */
.qa-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--qa-elev) + 1);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0s 0.22s;
}
.qa-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.22s ease;
}

/* ---- Bottom Sheet ---- */
.qa-sheet {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 5px;
  z-index: calc(var(--qa-elev) + 2);
  border-radius: 18px;
  padding: 14px;
  max-height: calc(70svh - env(safe-area-inset-bottom));
  overflow: auto;
  -webkit-overflow-scrolling: touch;

  color: var(--qa-ink);
  background: color-mix(in srgb, var(--main) 5%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid #ffffff45;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);

  transform: translateY(110%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.28s ease, opacity 0.28s ease, visibility 0s 0.28s;
}
.qa-sheet.is-open {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

/* header inside sheet */
.qa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #ffffff33;
  font-weight: 900;
}
.qa-close {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, #fff 14%, transparent);
  border: 1px solid #ffffff33;
  color: var(--qa-ink);
}
.qa-close span {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 2px;
  background: currentColor;
}
.qa-close span:first-child {
  transform: rotate(45deg);
}
.qa-close span:last-child {
  transform: rotate(-45deg);
}

/* grid of actions */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 480px) {
  .qa-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.qa-action {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
  color: var(--qa-ink);

  background: color-mix(in srgb, #fff 10%, transparent);
  border: 1px solid #ffffff33;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.08s ease;
}
.qa-action i {
  font-size: 20px;
  line-height: 1;
}
.qa-action:hover {
  background: color-mix(in srgb, #fff 18%, transparent);
  border-color: #ffffff55;
}
.qa-action:active {
  transform: translateY(1px);
}

/* lock page scroll while open */
body.qa-lock {
  overflow: hidden;
  touch-action: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .qa-fab,
  .qa-sheet,
  .qa-overlay {
    transition: none !important;
  }
}
