/* ============================================================
   HEADER — top-strip, logo, nav, mega-menu, search
   ============================================================ */

/* TOP STRIP */
.top-strip {
  background: var(--black);
  color: rgba(255,255,255,0.85);
  padding: 9px 0;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 51;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.3s ease;
}
.top-strip.hidden-on-scroll {
  transform: translateY(-100%);
}
header.site-header {
  top: 0; /* nadpisane przez JS gdy top-strip znika */
}
.top-strip-inner {
  max-width: 1340px; margin: 0 auto; padding: 0 28px;
  display: flex; justify-content: space-between; align-items: center;
}
.top-strip a { color: rgba(255,255,255,0.85); transition: color var(--transition-fast); }
.top-strip a:hover { color: var(--yellow); }
.top-strip .left { display: flex; gap: 26px; align-items: center; }
.top-strip .left .phone strong { color: var(--yellow); }
.top-strip .top-social {
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.22); border-radius: 3px; color: rgba(255,255,255,0.9);
  text-decoration: none; transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.top-strip .top-social:hover { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.top-strip .right { display: flex; gap: 18px; align-items: center; }


/* LANG SWITCHER */
.lang { position: relative; }
.lang-toggle {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 5px 10px; border: 1px solid rgba(255,255,255,0.2); border-radius: 3px;
  transition: all var(--transition-fast); user-select: none; color: rgba(255,255,255,0.85);
  font-size: 13px; line-height: 1;
}
.lang-toggle:hover { border-color: var(--yellow); color: white; }
.lang-toggle .lang-emoji { font-size: 16px; line-height: 1; }
.lang-toggle .code { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; }
.lang-toggle .chev { font-size: 9px; opacity: 0.55; transition: transform var(--transition-fast); margin-left: 1px; }
.lang.open .lang-toggle .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15); border-radius: 6px;
  overflow: hidden; min-width: 148px;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s; z-index: 200;
}
.lang.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none;
  border-bottom: 1px solid var(--line); transition: background 0.12s;
}
.lang-menu a:last-child { border-bottom: none; }
.lang-menu a:hover { background: var(--bone); color: var(--navy); }
.lang-menu a.active { background: var(--bone); }
.lang-menu a .lang-emoji { font-size: 18px; line-height: 1; flex-shrink: 0; }
.lang-menu a .lang-name { flex: 1; }
.lang-menu a .lang-code { font-size: 10px; font-weight: 700; color: var(--steel); background: var(--line); padding: 2px 6px; border-radius: 3px; letter-spacing: 0.06em; }

/* HEADER */
header.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
header.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(20,21,28,0.10);
}
/* Logo zmniejsza się po scroll */
header.site-header.scrolled .logo-img {
  width: 72px; height: 72px; margin-bottom: 0;
  transition: width 0.3s ease, height 0.3s ease, margin-bottom 0.3s ease;
}
header.site-header .logo-img {
  transition: width 0.3s ease, height 0.3s ease, margin-bottom 0.3s ease;
}
.header-inner {
  max-width: 1340px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; gap: 24px; min-height: 92px;
}

/* LOGO */
.logo-link { width: 142px; flex-shrink: 0; display: block; }
.logo-img {
  width: 142px; height: 142px;
  margin-bottom: -56px;
  position: relative; z-index: 51;
  display: block; object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,0.22));
}

/* NAWIGACJA */
nav.nav-main { flex: 1; display: flex; justify-content: center; }
nav.nav-main > ul { display: flex; gap: 2px; align-items: center; }
nav.nav-main > ul > li { position: relative; }
nav.nav-main > ul > li > a {
  display: block; padding: 12px 15px;
  color: var(--ink); font-weight: 700; font-size: 13.5px;
  letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap;
  transition: color var(--transition-fast); position: relative;
}
nav.nav-main > ul > li > a:hover { color: var(--navy); }
nav.nav-main > ul > li.has-mega > a::after { content: ' ▾'; font-size: 9px; color: var(--steel); }
nav.nav-main > ul > li > a.active,
nav.nav-main > ul > li:hover > a { color: var(--navy); }
nav.nav-main > ul > li:hover > a::before,
nav.nav-main > ul > li > a.active::before {
  content: ''; position: absolute; bottom: 0; left: 15px; right: 15px; height: 3px; background: var(--yellow);
}

/* MEGA MENU */
.mega {
  position: fixed; left: 0; right: 0;
  top: var(--mega-top, 92px);
  background: var(--white); border-top: 3px solid var(--yellow);
  box-shadow: 0 30px 60px rgba(20,21,28,0.25);
  padding: 0; opacity: 0; visibility: hidden;
  transform: translateY(4px); transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease; z-index: 80;
}
nav.nav-main > ul > li.has-mega:hover .mega { opacity: 1; visibility: visible; transform: translateY(0); }

/* Most hover — wypełnia lukę między linkiem a menu */
nav.nav-main > ul > li.has-mega::after {
  content: '';
  position: absolute;
  bottom: -10px; left: -16px; right: -16px;
  height: 10px;
}
.mega-wrap {
  max-width: 1340px; margin: 0 auto; padding: 32px 28px;
  display: grid; grid-template-columns: 1.1fr 1.1fr 1.1fr 1.4fr; gap: 0;
}
.mega-col { padding: 0 28px; border-right: 1px solid var(--line); }
.mega-col:first-child { padding-left: 0; }
.mega-col:last-child { border-right: none; }
.mega-col h5 {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); font-weight: 800; margin-bottom: 16px;
}
.mega-col a.mi {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 7px 0;
  font-size: 14px; color: var(--ink); font-weight: 500;
  line-height: 1.25;
  transition: all 0.15s; border-bottom: 1px solid transparent;
}
.mega-col a.mi:hover { color: var(--navy); padding-left: 6px; }
.mega-col a.mi .mi-ico {
  width: 34px; height: 34px; flex-shrink: 0;
  background-size: cover; background-position: center; border-radius: 3px;
}
.mega-promo { padding-left: 28px; }
.mega-promo-card {
  position: relative; height: 100%; min-height: 240px;
  border-radius: 4px; overflow: hidden; text-decoration: none;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 24px;
}
.mega-promo-card .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.mega-promo-card .bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,21,28,0.2) 30%, rgba(20,21,28,0.92) 100%);
}
.mega-promo-card .c { position: relative; z-index: 2; }
.mega-promo-card .tag {
  display: inline-block; background: var(--red); color: white;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  padding: 4px 10px; text-transform: uppercase; margin-bottom: 12px;
}
.mega-promo-card h4 {
  font-family: var(--serif); font-size: 30px; font-weight: 800;
  line-height: 0.95; text-transform: uppercase; color: white; margin-bottom: 8px;
}
.mega-promo-card span { font-size: 13px; color: var(--yellow); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }

/* HEADER CTA */
.header-cta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.search-btn {
  width: 46px; height: 46px; border: 1px solid var(--line); background: var(--white);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
  transition: all var(--transition-fast); border-radius: 3px; font-size: 17px;
}
.search-btn:hover { background: var(--black); color: var(--yellow); border-color: var(--black); }

/* MOBILE SEARCH (lewa strona na mobile) */
.mob-search-btn {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--white);
  place-items: center; cursor: pointer; color: var(--ink);
  transition: all var(--transition-fast);
}
.mob-search-btn:hover { background: var(--black); color: var(--yellow); border-color: var(--black); }

/* HAMBURGER */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  width: 44px; height: 44px; justify-content: center; align-items: center;
  border: 1px solid var(--line); border-radius: 3px; background: var(--white);
  cursor: pointer; transition: all var(--transition-fast);
}
.hamburger span { width: 22px; height: 2px; background: var(--ink); transition: all 0.25s; display: block; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* SEARCH OVERLAY */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(20,21,28,0.88); backdrop-filter: blur(6px);
  z-index: 9998; display: none; align-items: flex-start; justify-content: center; padding-top: 13vh;
}
.search-overlay.open { display: flex; }
.search-box { width: 700px; max-width: 92vw; }
.search-field { position: relative; }
.search-field input {
  width: 100%; padding: 22px 60px 22px 24px; font-size: 22px;
  font-family: var(--sans); border: none;
  border-bottom: 4px solid var(--yellow); background: var(--white);
  color: var(--ink); outline: none; border-radius: 4px 4px 0 0;
}
.search-field .search-ico { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); color: var(--steel); font-size: 22px; }
.search-hint { color: rgba(255,255,255,0.6); font-size: 13px; margin-top: 12px; }
.search-hint kbd { background: rgba(255,255,255,0.15); padding: 2px 7px; border-radius: 3px; font-size: 11px; }

/* RESPONSIVE DESKTOP */
@media (max-width: 1200px) {
  nav.nav-main > ul > li > a { padding: 12px 11px; font-size: 13px; }
}

/* MOBILE BREAKPOINT */
@media (max-width: 1024px) {

  /* Topbar — schowany na mobile (info przeniesione do sidebara) */
  .top-strip { display: none; }

  /* Header: 3 kolumny — ikona | logo (center) | hamburger */
  .header-inner {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
    padding: 0 14px;
    min-height: 68px;
    align-items: center;
  }
  .mob-search-btn { display: grid; }

  /* Logo wyśrodkowane — 2.5× większe niż poprzednio, absolutnie w headerze */
  .logo-link {
    width: auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
  }
  .logo-img {
    width: 154px; height: 154px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -18%);
    margin: 0;
    z-index: 51;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.28));
    transition: width 0.3s ease, height 0.3s ease, transform 0.3s ease;
  }
  /* Scrolled — logo prawie całkowicie mieści się w headerze (2px margines) */
  header.site-header.scrolled .logo-img {
    width: 64px; height: 64px;
    transform: translate(-50%, -50%);
  }
  /* Podstrony — logo 1,5× mniejsze niż na stronie głównej */
  body:not(.home) .logo-img {
    width: 103px; height: 103px;
  }

  /* Nawigacja główna — schowana */
  nav.nav-main { display: none; }

  /* CTA — tylko hamburger */
  .header-cta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
  }
  .header-cta .btn,
  .header-cta .search-btn { display: none; }
  .hamburger { display: flex; }

}

/* ── SEARCH AUTOCOMPLETE SUGGESTIONS ─────────────── */
.search-suggestions {
  display: none;
  flex-direction: column;
  background: var(--white);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
  max-height: 360px;
  overflow-y: auto;
}
.search-suggestions.has-results { display: flex; }

.srch-sug-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
  cursor: pointer;
}
.srch-sug-item:last-child { border-bottom: none; }
.srch-sug-item:hover,
.srch-sug-item.active {
  background: var(--bone);
  color: var(--navy);
}
.srch-sug-title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.srch-sug-type {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  background: var(--line);
  padding: 3px 8px;
  border-radius: 3px;
}
.srch-sug-item.active .srch-sug-type,
.srch-sug-item:hover .srch-sug-type {
  background: rgba(62,64,143,0.12);
  color: var(--navy);
}
