/* FD Menu – styl „pasek na całą szerokość”. Kolory i rozmiary przez zmienne CSS z panelu. */

.fdh {
  --c-bg: var(--fdh-top-bg);
  --c-text: var(--fdh-top-text);
  --c-hover: var(--fdh-top-hover);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  font-family: var(--fdh-font);
  text-align: left;
}
/* Po przewinięciu, na stronach bez zdjęcia u góry, przy otwartym menu lub wyszukiwarce. */
.fdh.is-solid,
.fdh.is-scrolled,
.fdh.is-open,
.fdh.is-search {
  --c-bg: var(--fdh-sc-bg);
  --c-text: var(--fdh-sc-text);
  --c-hover: var(--fdh-sc-hover);
}
/* Rozwinięte menu (telefon): własne kolory paska i wybór logo. */
.fdh.is-open {
  --c-bg: var(--fdh-m-bg);
  --c-text: var(--fdh-m-text);
  --c-hover: var(--fdh-m-text);
}
.fdh.is-open.logo-open-top .fdh-logo-top { display: block !important; }
.fdh.is-open.logo-open-top .fdh-logo-main:not(.is-only) { display: none !important; }
body.admin-bar .fdh { top: 32px; }
@media (max-width: 782px) { body.admin-bar .fdh { top: 46px; } }

.fdh *, .fdh *::before, .fdh *::after { box-sizing: border-box; }
.fdh button { font-family: inherit; }
.fdh .fdm-sr {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; white-space: nowrap;
}
.fdh-spacer { height: calc(max(var(--fdh-h, 100px), var(--fdh-logo-c, 0px)) + var(--fdh-pt, 0px) + var(--fdh-pb, 0px)); }

/* ---------- Pasek ---------- */
.fdh .fdh-bar {
  background-color: var(--c-bg);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.fdh.has-shade.is-overlay:not(.is-scrolled):not(.is-open):not(.is-search) .fdh-bar {
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
}
.fdh.has-shadow:is(.is-solid, .is-scrolled, .is-open, .is-search) .fdh-bar { box-shadow: 0 2px 18px rgba(0, 0, 0, .08); }

.fdh .fdh-inner {
  max-width: var(--fdh-max);
  margin: 0 auto;
  padding: var(--fdh-pt, 0px) 32px var(--fdh-pb, 0px);
  min-height: calc(max(var(--fdh-h), var(--fdh-logo), var(--fdh-logo-c, 0px)) + var(--fdh-pt, 0px) + var(--fdh-pb, 0px));
  display: flex;
  align-items: center;
  gap: 28px;
  transition: min-height .3s ease, padding .3s ease;
}
.fdh.is-scrolled .fdh-inner { min-height: var(--fdh-h-sc); padding-top: calc(var(--fdh-pt, 0px) / 2); padding-bottom: calc(var(--fdh-pb, 0px) / 2); }
/* Pozycje dokładnie na środku ekranu: logo | menu | przyciski */
.fdh.fdh--align-center .fdh-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.fdh.fdh--align-center .fdh-logo { justify-self: start; }
.fdh.fdh--align-center .fdh-actions { justify-self: end; margin-left: 0; }

/* ---------- Logo (zamiana na kolorowe po przewinięciu) ---------- */
/* Na komputerze logo nigdy nie jest ściskane – zawsze skaluje się proporcjonalnie. */
.fdh .fdh-logo { display: flex; align-items: center; flex: 0 0 auto; text-decoration: none; line-height: 0; }
.fdh .fdh-logo img { width: auto; max-width: none; display: block; transition: height .3s ease; }
.fdh .fdh-logo-top { height: var(--fdh-logo); }
.fdh .fdh-logo-main { height: var(--fdh-logo-c, var(--fdh-logo)); }
.fdh.is-overlay:not(.is-scrolled):not(.is-open):not(.is-search) .fdh-logo-main.is-only { height: var(--fdh-logo); }
.fdh.is-scrolled .fdh-logo img { height: var(--fdh-logo-sc); }
.fdh .fdh-logo-main:not(.is-only) { display: none; }
.fdh:is(.is-solid, .is-scrolled, .is-open, .is-search) .fdh-logo-top { display: none; }
.fdh:is(.is-solid, .is-scrolled, .is-open, .is-search) .fdh-logo-main { display: block; }
.fdh .fdh-logo-text { font-weight: 700; font-size: 20px; color: var(--c-text); line-height: 1.2; }

/* ---------- Pozycje menu ---------- */
.fdh .fdh-nav { flex: 1; display: flex; justify-content: flex-end; min-width: 0; transform: translateX(var(--fdh-shift, 0px)); }
.fdh.fdh--align-center .fdh-nav { justify-content: center; }
.fdh.fdh--align-left .fdh-nav { justify-content: flex-start; }
.fdh .fdh-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.fdh .fdh-links > li { position: relative; margin: 0; padding: 0; list-style: none; }

.fdh .fdh-top {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  margin: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--c-text);
  font-size: var(--fdh-fs);
  font-weight: var(--fdh-fw);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: normal;
  transition: color .2s ease;
}
.fdh.is-upper .fdh-top { text-transform: uppercase; letter-spacing: .04em; }
.fdh .fdh-top::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.fdh .fdh-top:hover,
.fdh .fdh-links > li:hover > .fdh-top,
.fdh .fdh-links > li.is-open > .fdh-top { color: var(--c-hover); }
.fdh .fdh-top:hover::after,
.fdh .fdh-links > li:hover > .fdh-top::after,
.fdh .fdh-links > li.is-open > .fdh-top::after { transform: scaleX(1); }

.fdh .fdh-chev { width: 10px; height: 10px; flex: 0 0 auto; transition: transform .25s ease; }
.fdh .fdh-has-sub:hover .fdh-top .fdh-chev,
.fdh .fdh-has-sub.is-open .fdh-top .fdh-chev { transform: rotate(180deg); }

/* Podmenu */
.fdh .fdh-sub {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 270px;
  margin: 0;
  padding: 10px;
  list-style: none;
  background: var(--fdh-sub-bg);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.fdh .fdh-sub::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.fdh .fdh-links > li:hover > .fdh-sub,
.fdh .fdh-links > li:focus-within > .fdh-sub,
.fdh .fdh-links > li.is-open > .fdh-sub { opacity: 1; visibility: visible; transform: none; }
.fdh .fdh-links > li.is-suppressed > .fdh-sub { opacity: 0; visibility: hidden; transform: translateY(8px); }
.fdh .fdh-sub li { margin: 0; padding: 0; list-style: none; }
.fdh .fdh-sub a {
  display: block;
  padding: 11px 16px;
  border-radius: 8px;
  color: var(--fdh-sub-text);
  font-size: calc(var(--fdh-fs) - 1px);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: color .2s ease, background-color .2s ease;
}
.fdh .fdh-sub a:hover { color: var(--fdh-sub-hover); background: color-mix(in srgb, var(--fdh-sub-hover) 9%, transparent); }

.fdh .fdm-badge {
  background: var(--fdh-btn-bg);
  color: var(--fdh-btn-text);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
  line-height: 1.2;
}

/* ---------- Prawa strona: social, lupa, przycisk ---------- */
.fdh .fdh-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; margin-left: auto; }
.fdh .fdh-socials { display: flex; gap: 6px; }
.fdh .fdh-socials a {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text);
  border: 1.5px solid color-mix(in srgb, currentColor 45%, transparent);
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease;
}
.fdh .fdh-socials a:hover { color: var(--c-hover); border-color: var(--c-hover); }
.fdh .fdm-ico { width: 16px; height: 16px; display: block; }
.fdh .fdm-ico-img { object-fit: contain; }
.fdh .fdm-ico-mask { background-color: currentColor; -webkit-mask: var(--fdm-mask) center / contain no-repeat; mask: var(--fdm-mask) center / contain no-repeat; }

.fdh .fdh-icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--c-text);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.fdh .fdh-icon-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); color: var(--c-hover); }
.fdh .fdh-ico { width: 21px; height: 21px; display: block; }

.fdh .fdh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 26px;
  border-radius: var(--fdh-btn-radius);
  background: var(--fdh-btn-bg);
  color: var(--fdh-btn-text);
  font-size: var(--fdh-btn-fs);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.fdh .fdh-btn:hover {
  background: var(--fdh-btn-hbg);
  color: var(--fdh-btn-htext);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--fdh-btn-bg) 35%, transparent);
}

/* Hamburger */
.fdh .fdh-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 46px; height: 46px;
  padding: 0; margin: 0;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.fdh .fdh-toggle span { display: block; width: 26px; height: 2.5px; border-radius: 2px; background: var(--c-text); transition: transform .3s ease, opacity .3s ease; }
.fdh.is-open .fdh-toggle span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.fdh.is-open .fdh-toggle span:nth-child(2) { opacity: 0; }
.fdh.is-open .fdh-toggle span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Wyszukiwarka ---------- */
.fdh .fdh-search {
  background: var(--fdh-sc-bg);
  border-top: 1px solid rgba(0, 0, 0, .06);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
  display: none;
}
.fdh.is-search .fdh-search { display: block; animation: fdhDown .25s ease; }
@keyframes fdhDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.fdh .fdh-search-form {
  max-width: var(--fdh-max);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fdh .fdh-search-form input[type=search] {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 24px;
  font-family: inherit;
  font-size: 18px;
  color: #1a1a1a;
  background: #fff;
  border: 2px solid #d9d9de;
  border-radius: 999px;
  outline: none;
  margin: 0;
  box-shadow: none;
}
.fdh .fdh-search-form input[type=search]:focus { border-color: var(--fdh-btn-bg); }
.fdh .fdh-search-submit {
  height: 54px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--fdh-btn-bg);
  color: var(--fdh-btn-text);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.fdh .fdh-search-submit:hover { background: var(--fdh-btn-hbg); color: var(--fdh-btn-htext); }
.fdh .fdh-search-close { color: var(--fdh-sc-text); }

/* ---------- Menu na telefonie ---------- */
.fdh .fdh-mobile {
  display: none;
  background: var(--fdh-m-bg);
  max-height: calc(100vh - var(--fdh-h-sc));
  overflow-y: auto;
  padding: 10px 20px 28px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, .12);
}
.fdh.is-open .fdh-mobile { display: block; }
.fdh .fdh-m-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px 4px;
  margin: 0;
  background: none;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--fdh-m-text) 14%, transparent);
  color: var(--fdh-m-text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.fdh .fdh-m-top:hover { opacity: .8; }
.fdh .fdh-m-toggle .fdh-chev { width: 13px; height: 13px; }
.fdh .fdh-m-toggle[aria-expanded="true"] .fdh-chev { transform: rotate(180deg); }
.fdh .fdh-m-sub { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.fdh .fdh-m-link {
  display: block;
  padding: 13px 4px 13px 22px;
  color: var(--fdh-m-text);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--fdh-m-text) 8%, transparent);
}
.fdh .fdh-m-link:hover { opacity: .8; }
.fdh .fdh-btn-mobile { display: flex; width: 100%; height: 56px; margin-top: 24px; font-size: 18px; }
.fdh .fdh-m-socials { display: flex; justify-content: center; gap: 14px; margin-top: 24px; }
.fdh .fdh-m-socials a {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--fdh-btn-bg);
  color: var(--fdh-btn-text);
  text-decoration: none;
}
.fdh .fdh-m-socials .fdm-ico { width: 20px; height: 20px; }

.fdh a:focus-visible,
.fdh button:focus-visible,
.fdh input:focus-visible {
  outline: 3px solid var(--fdh-accent, #012f63);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .fdh .fdh-search-form { padding: 14px 18px; flex-wrap: wrap; }
  .fdh .fdh-search-submit { order: 3; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .fdh *, .fdh *::before, .fdh *::after { transition: none !important; animation: none !important; }
}

/* Podgląd w panelu */
.fdh.fdh-preview { position: relative; top: auto !important; z-index: 1; }
