/**
 * AndrewDesign — Glass / Floating Header (v1.1)
 * Nie zmienia zawartości menu ani jego działania, tylko warstwę prezentacji.
 * Wczytywany globalnie na stronach motywu andrewdesign.
 */
:root {
  --ad-header-gap-x: clamp(0.75rem, 2.2vw, 1.5rem);
  --ad-header-gap-top: clamp(0.625rem, 1.25vw, 0.875rem);
  --ad-header-surface: rgba(5, 19, 30, 0.81);
  --ad-header-border: rgba(224, 183, 104, 0.25);
  --ad-header-text: #f6f5f1;
}

/* Pusta powierzchnia wokół „pigułki” ma pozostać przezroczysta. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  padding: var(--ad-header-gap-top) 0 0.5rem;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.site-header .site-header__inner {
  position: relative;
  width: min(calc(100% - 2 * var(--ad-header-gap-x)), 77.5rem);
  max-width: 77.5rem;
  min-height: var(--header-height, 4.25rem);
  margin-inline: auto;
  padding-inline: clamp(1rem, 2.3vw, 1.75rem);
  border: 1px solid var(--ad-header-border);
  border-radius: 999px;
  background: var(--ad-header-surface);
  color: var(--ad-header-text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.085);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.site-header .site-brand,
.site-header .primary-nav .menu a {
  color: var(--ad-header-text);
}



/* Header logo: sam symbol zamiast pełnego logotypu. */
.site-header .site-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.site-header .site-brand img {
  width: clamp(2.25rem, 2vw + 1.6rem, 3rem);
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

@media (max-width: 47.999rem) {
  .site-header .site-brand img {
    width: 2.25rem;
  }
}

.site-header .menu-toggle {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid rgba(224, 183, 104, 0.35);
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ad-header-text);
}

.site-header .menu-toggle__lines i {
  background: currentColor;
}

/* Rozwinięte menu pod kapsułą, a nie pasek rozciągnięty przez cały ekran. */
@media (max-width: 74.999rem) {
  .site-header .site-header__inner {
    border-radius: 1.375rem;
  }

  .site-header .primary-nav,
  .site-header .primary-nav.is-open {
    position: absolute;
    inset: calc(100% + 0.625rem) 0 auto;
    width: 100%;
    max-height: calc(100dvh - var(--header-height, 4rem) - 2.5rem);
    overflow-y: auto;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--ad-header-border);
    border-radius: 1.25rem;
    background: #061826;
    color: var(--ad-header-text);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.30);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .site-header .primary-nav .menu a {
    color: var(--ad-header-text);
    border-bottom-color: rgba(224, 183, 104, 0.14);
  }

  .site-header .primary-nav .header-cta {
    width: 100%;
  }
}

@media (max-width: 47.999rem) {
  :root {
    --ad-header-gap-x: 0.75rem;
    --ad-header-gap-top: 0.5rem;
  }

  .site-header .site-header__inner {
    min-height: var(--header-height, 3.875rem);
    padding-inline: 0.875rem;
    border-radius: 1.125rem;
  }

  .site-header .site-brand img {
    max-width: 2.5rem;
    max-height: 2.5rem;
  }

  .site-header .primary-nav,
  .site-header .primary-nav.is-open {
    border-radius: 1rem;
  }
}

/* Nie ograniczaj desktopowej nawigacji przez reguły mobilne. */
@media (min-width: 75rem) {
  .site-header .primary-nav,
  .site-header .primary-nav.is-open {
    position: static;
    inset: auto;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}





/* Strona główna: header startuje na Hero, bez osobnego pasa nad sekcją.
   Po scrollu dostaje klasę .ad-is-stuck i przykleja się do górnej krawędzi. */
.home .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 220;
}

.home .site-header.ad-is-stuck {
  position: fixed;
  top: 0;
}

.home .hero,
.home .site-main .hero,
.home main .hero {
  padding-top: calc(var(--header-height, 4.25rem) + var(--ad-header-gap-top) + 2rem);
}

@media (max-width: 47.999rem) {
  .home .hero,
  .home .site-main .hero,
  .home main .hero {
    padding-top: calc(var(--header-height, 3.875rem) + var(--ad-header-gap-top) + 1.25rem);
  }
}

/* Admin-bar: odstęp działa na desktopie; na bardzo małych ekranach pasek WP nie jest przyklejony. */
@media (min-width: 601px) {
  .admin-bar .site-header {
    top: var(--wp-admin--admin-bar--height, 32px);
  }

  .home.admin-bar .site-header.ad-is-stuck {
    top: var(--wp-admin--admin-bar--height, 32px);
  }
}

html {
  scroll-padding-top: calc(var(--header-height, 4.25rem) + var(--ad-header-gap-top) + 1.25rem);
}

.home-funnel [id],
main [id] {
  scroll-margin-top: calc(var(--header-height, 4.25rem) + var(--ad-header-gap-top) + 1.25rem);
}



/* Home funnel transition: jasna sekcja płynnie nasuwa się na Hero. */
.home .home-funnel {
  position: relative;
  z-index: 18;
  margin-top: clamp(-2.9rem, -3.8vw, -1.6rem);
  padding-top: 0;
  background: var(--color-bg, #f8fafb);
  border-radius: clamp(1.5rem, 2.5vw, 2.25rem) clamp(1.5rem, 2.5vw, 2.25rem) 0 0;
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.45),
    0 -18px 42px rgba(7, 17, 29, 0.08);
  overflow: clip;
}

.home .home-funnel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: clamp(2rem, 4vw, 3rem);
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(248,250,251,0) 100%);
  pointer-events: none;
}

.home .home-funnel > section:first-child,
.home .home-funnel > #uslugi,
.home .home-funnel > .services-section:first-child {
  padding-top: clamp(3.25rem, 4.8vw, 4.75rem);
}

@media (max-width: 63.999rem) {
  .home .home-funnel {
    margin-top: -2rem;
    border-radius: 1.5rem 1.5rem 0 0;
  }

  .home .home-funnel > section:first-child,
  .home .home-funnel > #uslugi,
  .home .home-funnel > .services-section:first-child {
    padding-top: clamp(2.75rem, 7vw, 3.5rem);
  }
}

@media (max-width: 47.999rem) {
  .home .home-funnel {
    margin-top: -1.375rem;
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -10px 26px rgba(7, 17, 29, 0.08);
  }

  .home .home-funnel::before {
    height: 1.5rem;
  }

  .home .home-funnel > section:first-child,
  .home .home-funnel > #uslugi,
  .home .home-funnel > .services-section:first-child {
    padding-top: 2.5rem;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header .site-header__inner { background: #071b2b; }
  .site-header .primary-nav { background: #071b2b; }
}
