.floating-nav {
  position: fixed;

  /* Theme conflict guard: prevent an invisible full-page overlay if the theme styles .floating-nav */
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  pointer-events: none;

  top: 50% !important;
  right: 1.5rem !important;
  bottom: auto !important;
  left: auto !important;

  transform: translateY(-50%);
  z-index: 9999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.5rem;
}

/* Tylko elementy menu mają przechwytywać kliknięcia */
.floating-nav__toggle,
.floating-nav__panel {
  pointer-events: auto;
}

/* Główny przycisk - ikona, szare tło */
.floating-nav__toggle {
  border: none;
  border-radius: 0.5rem;
  width: 3rem;
  height: 3rem;
  font-size: 1.4rem;
  background: #666666;                   /* szare tło guzika */
  color: #f9fafb;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


.floating-nav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  line-height: 1;
}

/* Ikona: trzy kropki + trzy kreski w stanie zamkniętym */
.floating-nav:not(.is-open) .floating-nav__icon {
  position: relative;
  font-size: 0;
}

.floating-nav:not(.is-open) .floating-nav__icon::before,
.floating-nav:not(.is-open) .floating-nav__icon::after {
  content: "";
  position: absolute;
  left: 0;
}

/* kropki */
.floating-nav:not(.is-open) .floating-nav__icon::before {
  top: 0.35rem;
  left: 0.2rem;
  width: 0.22rem;
  height: 0.22rem;
  border-radius: 999px;
  background: #f9fafb;
  box-shadow:
    0 0.42rem 0 0 #f9fafb,
    0 0.84rem 0 0 #f9fafb;
}

/* kreski */
.floating-nav:not(.is-open) .floating-nav__icon::after {
  top: 0.38rem;
  left: 0.65rem;
  width: 0.95rem;
  height: 0.18rem;
  border-radius: 999px;
  background: #f9fafb;
  box-shadow:
    0 0.42rem 0 0 #f9fafb,
    0 0.84rem 0 0 #f9fafb;
}

/* W stanie otwartym pokazujemy tylko tekst (>) */
.floating-nav.is-open .floating-nav__icon {
  font-size: 1.2rem;
}

.floating-nav.is-open .floating-nav__icon::before,
.floating-nav.is-open .floating-nav__icon::after {
  content: none;
}
/* Panel z linkami – domyślnie schowany */
.floating-nav__panel {
  margin: 0;
  padding: 0.6rem;
  border-radius: 0.75rem;
  background: rgba(20, 29, 29, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, 0.6);
  min-width: 220px;
  max-height: min(70vh, 540px);
  overflow: auto;
  transform-origin: bottom right;
  transform: scale(0.9) translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease-out, transform 0.16s ease-out;
}

/* Panel widoczny po otwarciu */
.floating-nav.is-open .floating-nav__panel {
  opacity: 1;
  transform: scale(1) translateY(-8px);
  pointer-events: auto;
}

.floating-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.floating-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  margin-bottom: 0.2rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: #e5e7eb;
  border: 1px solid rgba(45, 48, 48, 0.7);
  background: transparent;
}
.floating-nav__link-content {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.floating-nav__link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.floating-nav__link-label {
  flex: 1 1 auto;
}
.floating-nav__link-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgb(99 223 239);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(1px);
}

.floating-nav__link.is-active .floating-nav__link-badge {
  opacity: 1;
}


/* Ogólny styl dla wbudowanych ikon SVG */
.fsm-icon {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}


/* Hover */
.floating-nav__link:hover {
  background: rgba(40, 64, 66, 0.78);
  border-color: rgba(44, 50, 50, 0.9);
  color: #ffffff;
}

/* Aktywna sekcja (scrollspy) */
.floating-nav__link.is-active {
  border-color: rgba(30, 52, 54, 0.95);
  background: rgba(30, 52, 54, 0.9);
  color: #e5e7eb;
}

/* Kolor ikony dla aktywnego elementu */
.floating-nav__link.is-active .floating-nav__link-icon {
  color: rgb(89 199 213);
}


/* Mobile drobne poprawki */
@media (max-width: 768px) {
  .floating-nav {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }

  .floating-nav__panel {
    min-width: 200px;
  }
}


/* Override theme button styles for floating menu toggle */
.floating-nav .floating-nav__toggle {
  border: none;
  border-radius: 999px !important;
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.6rem;
  background: #666666 !important;
  color: #f9fafb !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* Ukrycie pływającego menu na tabletach i telefonach */
@media (max-width: 1024px) {
  .floating-nav {
    display: none !important;
  }
}
