/* Navbar — 1:1 z menu */

.nav {
  --nav-h: 76px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #eeeef0;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.nav.is-nav-hidden {
  transform: translateY(-100%);
}

body.is-nav-open .nav {
  transform: none;
}

.nav a {
  text-decoration: none;
  color: inherit;
}

.nav__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  flex: none;
  line-height: 0;
}

.logo__img {
  display: block;
  width: auto;
  height: 58px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav__links a,
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  color: #3f3f46;
  padding: 9px 14px;
  border-radius: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, color 0.18s;
}

.nav__links a:hover,
.nav__link:hover {
  background: #f4f4f5;
  color: #18181b;
}

.nav__link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.nav__item {
  position: static;
}

.nav__item:hover .nav__link {
  background: #f4f4f5;
  color: #18181b;
}

.nav__item:hover .nav__link svg {
  transform: rotate(180deg);
}

.nav__cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #18181b;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  transition: border-color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  border-color: #18181b;
  background: #fafafa;
}

.btn-black {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #09090b;
  padding: 12px 20px;
  border-radius: 12px;
  transition: background 0.2s, transform 0.15s;
}

.nav a.btn-black,
.mobile a.btn-black {
  color: #fff;
}

.btn-ghost svg,
.btn-black svg {
  width: 16px;
  height: 16px;
}

.btn-black:hover,
.nav a.btn-black:hover,
.mobile a.btn-black:hover {
  background: #27272a;
  color: #fff;
}

.btn-black:active {
  transform: scale(0.97);
}

/* ---- MEGA MENU ---- */
.mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border-top: 1px solid #eeeef0;
  box-shadow: 0 30px 60px -30px rgba(24, 24, 27, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: 0.22s ease;
}

.nav__item:hover .mega {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.mega__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 60px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.05fr;
  gap: 60px;
}

.mega__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mega__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a1a1aa;
  margin-bottom: 18px;
}

.mega__link {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  transition: background 0.18s;
}

.mega__link:hover {
  background: #f6f6f7;
}

.mega__ic {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #52525b;
  background: rgba(244, 244, 245, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  backdrop-filter: blur(8px) saturate(150%);
  box-shadow:
    0 4px 12px -6px rgba(24, 24, 27, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: color 0.2s, background 0.2s;
}

.mega__link:hover .mega__ic {
  color: #18181b;
  background: rgba(255, 255, 255, 0.95);
}

.mega__ic svg {
  width: 18px;
  height: 18px;
}

.mega__t {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #18181b;
}

.mega__d {
  display: block;
  font-size: 13px;
  color: #8a8a92;
  margin-top: 2px;
}

.mega__promo {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 28px;
  color: #fff;
  background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 46%, #2563eb 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.mega__promo::after {
  content: "";
  position: absolute;
  right: -46px;
  top: -46px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.mega__promo > * {
  position: relative;
  z-index: 1;
}

.promo-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.mega__promo-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.mega__promo p {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 8px;
}

.promo-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.promo-price {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.promo-from {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 3px;
}

.mega__promo a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  background: #fff;
  color: #4f46e5;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 999px;
  transition: transform 0.15s;
}

.mega__promo a:hover {
  transform: translateY(-2px);
}

.mega__promo a svg {
  width: 15px;
  height: 15px;
}

.burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  border: 1px solid #ececed;
  background: #f7f7f8;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.burger:hover {
  background: #efeff1;
}

.burger span {
  display: block;
  width: 19px;
  height: 2px;
  background: #18181b;
  border-radius: 2px;
  margin: 0;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s;
}

.mobile {
  display: none;
}

.mobile a {
  text-decoration: none;
  color: inherit;
}

body.is-nav-open {
  overflow: hidden;
  touch-action: none;
}

body.is-nav-open .nav {
  background: #fff;
  z-index: 100002;
}

body.is-nav-open .site-content,
body.is-nav-open .foot-image,
body.is-nav-open .site-foot {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.is-nav-open .fab {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 1200px) {
  .nav__links,
  .nav__cta {
    display: none;
  }

  .nav {
    --nav-h: 72px;
  }

  .burger {
    display: inline-flex;
  }

  .nav__inner {
    padding: 0 20px;
  }

  .logo__img {
    height: 44px;
  }

  .mobile {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100010; /* nad paskiem nav — całkowicie go zasłania */
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: radial-gradient(130% 130% at 100% 0%, #ffffff 0%, #f6f4ff 52%, #ece7ff 100%);
    overflow: hidden;
    overflow-anchor: none;
    /* animacja odsłaniania spod hamburgera; clip-path (w przeciwieństwie do transform) nie psuje position:fixed */
    clip-path: circle(0% at calc(100% - 43px) 36px);
    visibility: hidden;
    pointer-events: none;
    transition:
      clip-path 0.6s cubic-bezier(0.66, 0, 0.2, 1),
      visibility 0.6s;
  }

  .mobile.open {
    clip-path: circle(150% at calc(100% - 43px) 36px);
    visibility: visible;
    pointer-events: auto;
  }

  /* wewnętrzny pasek nakładki: logo + zamknij */
  .m-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
    height: var(--nav-h);
    padding: 0 20px;
    border-bottom: 1px solid #ececf0;
  }

  .m-top .logo__img {
    height: 44px;
  }

  .m-close {
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 13px;
    border: 1px solid #e6e2f5;
    background: rgba(255, 255, 255, 0.65);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #18181b;
    padding: 0;
    transition: background 0.2s, transform 0.15s;
  }

  .m-close:hover {
    background: #fff;
  }

  .m-close:active {
    transform: scale(0.94);
  }

  .m-close svg {
    width: 24px;
    height: 24px;
  }

  /* przewijany obszar treści menu */
  .m-body {
    flex: 1 1 auto;
    min-height: 0; /* KLUCZOWE dla flex-kolumny: pozwala się skurczyć i przewijać wewnątrz; bez tego treść ucieka pod pasek */
    overflow-y: auto;
    overflow-anchor: none;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
  }

  /* kaskadowe wejście elementów (opóźnienia ustawia JS) */
  .mobile .m-item,
  .mobile .m-cta,
  .mobile .m-contact {
    opacity: 0;
    transform: translateY(22px);
    transition:
      opacity 0.5s ease,
      transform 0.55s cubic-bezier(0.2, 0.75, 0.2, 1);
  }

  .mobile.open .m-item,
  .mobile.open .m-cta,
  .mobile.open .m-contact {
    opacity: 1;
    transform: none;
  }

  .admin-bar .nav {
    top: 32px;
  }

  .m-links {
    display: flex;
    flex-direction: column;
  }

  .mobile a.m-item,
  .mobile button.m-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
    color: #18181b;
    padding: 14px 12px;
    border-radius: 14px;
    border-bottom: 1px solid #f2f2f4;
    transition:
      background 0.15s,
      opacity 0.5s ease,
      transform 0.55s cubic-bezier(0.2, 0.75, 0.2, 1);
  }

  .mobile .m-item:active {
    background: #f6f6f7;
  }

  .m-item .chev {
    width: 20px;
    height: 20px;
    flex: none;
    color: #c4c4c9;
    transition: transform 0.25s, color 0.2s;
  }

  .m-item.open .chev {
    transform: rotate(180deg);
    color: var(--color-accent);
  }

  .m-sub {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    overflow-anchor: none;
    transition: grid-template-rows 0.32s ease;
  }

  .m-sub.open {
    grid-template-rows: 1fr;
  }

  .m-sub-inner {
    min-height: 0;
    overflow: hidden;
    padding: 6px 0 10px;
  }

  .mobile a.m-slink {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px;
    border-bottom: none;
    border-radius: 12px;
    font-size: 15.5px;
    font-weight: 600;
    color: #3f3f46;
  }

  .mobile a.m-slink:active {
    background: #f6f6f7;
  }

  .m-slink .sic {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--color-accent);
    background: rgba(244, 244, 245, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.9);
  }

  .m-slink .sic svg {
    width: 17px;
    height: 17px;
  }

  .mobile .m-cta {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile .m-cta .btn-ghost,
  .mobile .m-cta .btn-black {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    border-radius: 15px;
    padding: 16px;
    font-size: 16px;
  }

  .m-contact {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #f0f0f2;
  }

  .m-social {
    display: flex;
    gap: 11px;
    flex-wrap: wrap;
  }

  .mobile a.m-soc {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: #f4f4f5;
    color: #3f3f46;
    border-bottom: none;
    padding: 0;
    transition: background 0.2s, color 0.2s;
  }

  .mobile a.m-soc:active {
    background: #ececed;
    color: #18181b;
  }

  .m-soc svg {
    width: 19px;
    height: 19px;
  }

  .burger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .burger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .burger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (max-width: 782px) {
  .admin-bar .nav {
    top: 46px;
  }
}

@media (max-width: 380px) {
  .m-body {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  .m-top {
    padding-left: 14px;
    padding-right: 14px;
  }

  .mobile a.m-item,
  .mobile button.m-item {
    font-size: 16.5px;
    padding: 14px 10px;
  }

  .mobile a.m-soc {
    width: 46px;
    height: 46px;
  }

  .m-slink .sic {
    width: 34px;
    height: 34px;
  }
}

/* ---- pływający przycisk kontaktu ---- */
.fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 200;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.fab-btn {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(140deg, var(--color-accent, #a855f7), var(--color-accent-hover, #9333ea));
  display: grid;
  place-items: center;
  box-shadow: 0 16px 34px -10px rgba(168, 85, 247, 0.55);
  animation: fabFloat 3s ease-in-out infinite;
  will-change: transform;
}

.fab-btn svg {
  width: 26px;
  height: 26px;
  position: relative;
  z-index: 1;
}

.fab-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(168, 85, 247, 0.45);
  animation: fabPulse 2.4s ease-out infinite;
  will-change: transform, opacity;
  pointer-events: none;
}

@keyframes fabFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes fabPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.55);
    opacity: 0;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

.fab-pop {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 290px;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 24px 55px -18px rgba(24, 24, 27, 0.4);
  border: 1px solid #eee;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.97);
  transform-origin: bottom right;
  transition: 0.22s ease;
}

.fab.open .fab-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.fab-pop::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-right: 1px solid #eee;
  border-bottom: 1px solid #eee;
  transform: rotate(45deg);
}

.fab-pop__t {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a1a1aa;
  padding: 4px 6px 8px;
}

.fab-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-radius: 13px;
  color: #18181b;
  text-decoration: none;
  transition: background 0.18s;
}

.fab-row:hover {
  background: #f6f6f7;
}

.fab-row .ic {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #7c3aed;
  background: rgba(244, 244, 245, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.fab-row .ic svg {
  width: 18px;
  height: 18px;
}

.fab-row .k {
  display: block;
  font-size: 12px;
  color: #a1a1aa;
  font-weight: 500;
}

.fab-row .v {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

@media (max-width: 760px) {
  .fab {
    right: 18px;
    bottom: 18px;
  }

  .fab-btn {
    width: 56px;
    height: 56px;
  }
}

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

  .fab-btn::before {
    animation: none;
  }
}
