/* filters and to top btns */

.fdock-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transform: translateY(calc(100% + 28px));
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.2s ease;
}

.fdock-wrap.is-visible {
  transform: none;
  opacity: 1;
}

.fdock {
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 20px 0 18px;
  box-sizing: border-box;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #8f4ad8, #6f2fb9);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(79, 36, 140, 0.36), 0 2px 6px rgba(79, 36, 140, 0.22);
  transition: padding 0.25s ease, gap 0.25s ease, transform 0.12s ease, filter 0.15s ease;
}

.fdock-wrap.is-visible .fdock {
  pointer-events: auto;
}

.fdock:hover { filter: brightness(1.07); }
.fdock:active { transform: scale(0.97); }

.fdock__icon {
  display: block;
  flex: none;
}

.fdock__label {
  display: block;
  max-width: 80px;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.25s ease;
}

.fdock__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #ffffff;
  color: #6b3bb5;
  font-family: "Space Grotesk", Montserrat, system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 700;
}

/* shrink on scroll down */
.fdock-wrap.is-compact .fdock {
  gap: 6px;
  padding: 0 16px;
}

.fdock-wrap.is-compact .fdock__label {
  max-width: 0;
}

.ftop {
  position: fixed;
  right: 16px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 21;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid #e6daf6;
  border-radius: 50%;
  background: #ffffff;
  color: #6b3bb5;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(45, 30, 70, 0.18);
  transform: scale(0.6);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, background 0.15s ease;
}

.ftop.is-visible {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.ftop:hover { background: #f4effb; }
.ftop.is-visible:active { transform: scale(0.94); }

.ftop__icon {
  display: block;
}

.fdock:focus-visible,
.ftop:focus-visible {
  outline: 2px solid #8f4ad8;
  outline-offset: 2px;
}

.fdock-wrap[hidden],
.ftop[hidden],
.fdock__count[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .fdock-wrap,
  .fdock,
  .fdock__label,
  .ftop {
    transition: opacity 0.2s ease;
  }
}

/* Desktop: the filters are a sticky sidebar, so the pill has nothing to open. */
@media (min-width: 981px) {
  .fdock-wrap {
    display: none;
  }
}
