/* =========================================
   FlexNet Header CSS
   Snapshot: v20260321-3
   Zakres: logo, header, desktop nav, mega-menu, mobile nav, toggle
   Uwaga: minimalny zestaw zmiennych jest powielony celowo, aby header
   mógł wyrenderować się poprawnie jeszcze przed pełnym style.css.
========================================= */
:root {
  --header-height: 72px;
  --radius: 4px;
  --bg-body: #f0f0f0;
  --bg-menu: #ffffff;
  --bg-card: #f8f9fa;
  --bg-footer-bar: #f1f5f9;
  --text-main: #2a2a2a;
  --text-muted: #555555;
  --border: #e0e0e0;
  --accent: #d33c14;
}
[data-theme="dark"] {
  --bg-body: #0e0f11;
  --bg-menu: #141518;
  --bg-card: #16181c;
  --bg-footer-bar: #202329;
  --text-main: #ffffff;
  --text-muted: #888888;
  --border: rgba(255,255,255,0.1);
  --accent: #d33c14;
}

/* =========================================
   v20260529-1 a11y: skip-link + reset hamburgera (button)
========================================= */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100000; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-family: "Rajdhani", sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; text-decoration: none; transition: top 0.2s ease; }
.skip-link:focus { top: 8px; outline: 2px solid #fff; outline-offset: 2px; }
.mobile-hamburger { -webkit-appearance: none; appearance: none; background: transparent; border: none; padding: 0; color: inherit; }
.mobile-hamburger:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }

/* =========================================
   2. HEADER & NAVIGATION
========================================= */
header { position: fixed; top: 0; left: 0; width: 100%; height: var(--header-height); z-index: 10000; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 3vw, 42px); background-color: var(--bg-card); border-bottom: 1px solid var(--border); transition: 0.3s; }
header.scrolled { backdrop-filter: blur(14px); background-color: color-mix(in srgb, var(--bg-card) 88%, transparent); }
/* LOGO SVG */
.logo svg { height: 28px; width: auto; display: block; transition: opacity 0.3s; }
.logo:hover svg { opacity: 0.8; }
.logo img { height: 30px; width: auto; display: block; }
/* HEADER RIGHT ELEMENTS */
.header-right { display: flex; align-items: center; gap: 14px; }
/* THEME TOGGLE (ROLLING) - POPRAWKA (b) spowolniony obrót */
.theme-toggle { cursor: pointer; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 6px; background: transparent; padding: 0; color: var(--text-main); overflow: hidden; position: relative; z-index: 10001; }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-roll { width: 100%; height: 100%; transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1); pointer-events: none; }
.theme-face-normal,  .theme-face-hover { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.theme-face-hover { color: var(--accent); }
.theme-icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.theme-toggle:hover .theme-roll { transform: translateY(-100%); }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
/* --- DESKTOP NAVIGATION --- */
@media (min-width: 1100px) {
  .mobile-hamburger,  .mobile-menu-overlay { display: none !important; }
  .desktop-nav { display: block; height: 100%; margin-left: auto; margin-right: 24px; }
  .nav-wrapper { display: flex; height: 100%; align-items: center; gap: 5px; position: relative; }
  .nav-ink { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); border-radius: 2px; opacity: 0; transform: scaleX(0); transform-origin: left; transition: opacity .15s ease, transform .25s ease; pointer-events: none; z-index: 5; will-change: transform, width, left; }
  .nav-section-group { display: flex; flex-direction: column; justify-content: center; height: 100%; position: relative; padding-top: 13px; margin: 0 8px; }
  .group-label { position: absolute; top: 14px; left: 0; width: 100%; text-align: center; font-size: 0.58rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 1.45px; pointer-events: none; opacity: 1; }
  .group-content { display: flex; align-items: center; height: 100%; }
  .nav-item-has-mega { position: relative; height: 100%; display: flex; align-items: center; padding: 0 12px; cursor: pointer; transition: background 0.3s ease; border: none; background: transparent; }
  .nav-item-has-mega:hover,
  .nav-item-has-mega.is-open {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(211, 60, 20, 0.03) 60%, rgba(211, 60, 20, 0.15) 100%);
  }
  [data-theme="dark"] .nav-item-has-mega:hover,
  [data-theme="dark"] .nav-item-has-mega.is-open {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(211, 60, 20, 0.05) 60%, rgba(211, 60, 20, 0.3) 100%);
  }
  .nav-link-top { background: transparent; border: none; padding: 0; margin: 0; cursor: pointer; outline: none; display: block; height: 18px; line-height: 18px; overflow: hidden; font-family: "Rajdhani", sans-serif; font-size: 0.88rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.45px; color: var(--text-main); text-decoration: none; box-shadow: none; transition: color 0.3s ease; }
  .nav-link-top:hover,
  .nav-link-top:focus,
  .nav-link-top:active,
  .nav-link-top:visited { text-decoration: none; }
  /* v20260529-1 a11y: widoczny focus klawiaturowy (WCAG 2.4.7) */
  .nav-item-has-mega:focus-visible,
  .nav-link-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
  [data-theme="light"] .nav-highlight { color: var(--accent); }
  .nav-link-top span { display: block; height: 100%; transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1); pointer-events: none; }
  .nav-link-top::after { content: attr(data-text); display: block; height: 100%; color: var(--accent); transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1); pointer-events: none; }
  .nav-item-has-mega:hover .nav-link-top span,
  .nav-item-has-mega.is-open .nav-link-top span { transform: translateY(-100%); }
  .nav-item-has-mega:hover .nav-link-top::after,
  .nav-item-has-mega.is-open .nav-link-top::after { transform: translateY(-100%); }
  .nav-item-has-mega::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent);
    transform: scaleX(0);
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: center;
  }
  .nav-item-has-mega:hover::after,
  .nav-item-has-mega.is-open::after { transform: scaleX(1); }
  .mega-menu {
    position: absolute;
    top: calc(var(--header-height) + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 30px;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
    z-index: 900;
    min-width: 500px;
    overflow: visible;
  }
  .mega-menu::before {
    content: "";
    position: absolute;
    top: -24px;
    left: 0;
    width: 100%;
    height: 24px;
    background: transparent;
    display: block;
  }
  .mega-menu::after {
    content: "";
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background-color: var(--bg-card);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    z-index: 901;
  }
  .nav-item-has-mega:hover .mega-menu,
  .nav-item-has-mega.is-open .mega-menu,
  .nav-item-has-mega:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
  }
  .mega-menu.has-footer { padding: 0; display: flex; flex-direction: column; }
  .mega-content-wrapper { padding: 30px; }
  .mega-footer { background-color: var(--bg-footer-bar); border-top: 1px solid var(--border); width: 100%; padding: 0 30px; }
  .mega-grid,  .mega-footer .footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
  .mega-col { display: flex; flex-direction: column; gap: 10px; }
  .mega-header { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; display: block; }
  .mega-link { display: flex; align-items: center; gap: 15px; text-decoration: none; padding: 10px; border-radius: 6px; transition: 0.2s; }
  .mega-link:hover { background-color: rgba(211,60,20,0.05); }
  .mega-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg-body); border-radius: 6px; border: 1px solid var(--border); color: var(--text-main); transition: 0.2s; flex-shrink: 0; }
  .mega-link:hover .mega-icon { border-color: var(--accent); color: var(--accent); }
  .mega-icon svg { width: 20px; height: 20px; stroke-width: 1.5; }
  .mega-text { display: flex; flex-direction: column; }
  .mt-title { font-weight: 700; font-size: 0.95rem; color: var(--text-main); transition: 0.2s; display: flex; align-items: center; }
  .mega-link .mt-title::after { content: "›"; font-size: 1.2rem; line-height: 1; margin-left: 5px; opacity: 0; transform: translateX(-5px); transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1); color: var(--accent); }
  .mega-link:hover .mt-title { color: var(--accent); }
  .mega-link:hover .mt-title::after { opacity: 1; transform: translateX(0); }
  .mt-desc { font-size: 0.75rem; color: var(--text-muted); }
  .footer-link { text-decoration: none; display: flex; align-items: center; gap: 15px; transition: background 0.2s, color 0.2s; padding: 15px 10px; border-right: none; }
  .footer-link:hover { background-color: rgba(0,0,0,0.02); border-radius: 6px; }
  .footer-link:hover .mega-icon { border-color: var(--accent); color: var(--accent); }
  .footer-link:hover .mt-title { color: var(--accent); }
  .footer-link .mt-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-main); font-weight: 700; }
}
/* --- MOBILE & TABLET (< 1100px) --- */
@media (max-width: 1099px) {
  :root { --header-height: 66px; }
  .desktop-nav { display: none; }
  .mobile-hamburger { display: flex; flex-direction: column; gap: 5px; cursor: pointer; z-index: 10001; width: 26px; margin-left: 12px; }
  .hamburger-line { width: 100%; height: 2px; background-color: var(--text-main); transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); transform-origin: center; }
  .mobile-hamburger.active .line-1 { transform: translateY(7px) rotate(45deg); background-color: var(--accent); }
  .mobile-hamburger.active .line-2 { opacity: 0; }
  .mobile-hamburger.active .line-3 { transform: translateY(-7px) rotate(-45deg); background-color: var(--accent); }
  /* v20260512-7: overlay FLUSH (bez 8px bufora) pod headerem + topbar. Czarna przerwa wczesniej = mój buffer, usuniety. */
  .mobile-menu-overlay { display: block; position: fixed; top: calc(var(--fx-topbar-h, 0px) + var(--header-height)); left: 0; width: 100%; height: calc(100vh - var(--fx-topbar-h, 0px) - var(--header-height)); background-color: var(--bg-body); overflow: hidden; transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); z-index: 9999; border-top: 1px solid var(--border); }
  .mobile-menu-overlay.open { transform: translateX(0); }
  .mobile-slider-wrapper { display: flex; width: 200%; height: 100%; transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
  .mobile-view-main { width: 50%; height: 100%; overflow-y: auto; padding: 16px; border-right: 1px solid var(--border); }
  .mobile-view-sub { width: 50%; height: 100%; overflow-y: auto; background-color: var(--bg-body); padding: 16px; }
  .mobile-menu-overlay.slide-active .mobile-slider-wrapper { transform: translateX(-50%); }
  .mobile-group-title { font-size: 0.72rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 1.8px; margin-top: 22px; margin-bottom: 8px; padding-left: 8px; opacity: 0.9; }
  .mobile-main-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 12px; font-size: 1rem; font-weight: 700; color: var(--text-main); text-decoration: none; text-transform: uppercase; border-bottom: 1px solid var(--border); transition: background 0.2s; cursor: pointer; }
  .mobile-main-link:active { background-color: rgba(0,0,0,0.03); }
  /* chevron › po prawej stronie pozycji z sub-menu */
  .mobile-main-link .arrow-right { font-size: 1.4rem; color: var(--text-muted); line-height: 1; flex-shrink: 0; transition: color 0.15s, transform 0.15s; }
  .mobile-main-link:hover .arrow-right, .mobile-main-link:active .arrow-right { color: var(--accent); transform: translateX(2px); }
  .mobile-main-link .arrow-right { font-size: 1.2rem; color: var(--text-muted); }
  /* v20260512-7: padding-top zostaje 16px (oddech pod headerem), back-btn ze SVG ikona (← Unicode mial asymetryczny baseline -> niecentrowany w kolku) */
  .mobile-submenu-header { display: flex; align-items: center; gap: 12px; padding: 16px 0; margin-bottom: 12px; border-bottom: 1px solid var(--border); cursor: pointer; position: sticky; top: 0; background: var(--bg-body); z-index: 5; }
  .mobile-back-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--accent); border-radius: 50%; color: var(--accent); flex-shrink: 0; background: var(--bg-body); padding: 0; }
  .mobile-back-btn svg { width: 18px; height: 18px; display: block; }
  .mobile-back-btn:active { background: var(--accent); color: #fff; }
  .mobile-current-title { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; color: var(--text-main); }
  .mobile-sub-content { display: none; }
  .mobile-sub-content.active { display: block; animation: fadeIn 0.3s; }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .mobile-sublink { display: flex; align-items: center; gap: 15px; padding: 15px 10px; text-decoration: none; border-bottom: 1px solid rgba(0,0,0,0.03); border-radius: 6px; }
  .mobile-sublink:active { background-color: rgba(0,0,0,0.05); }
  [data-theme="dark"] .mobile-sublink { border-bottom: 1px solid rgba(255,255,255,0.03); }
  .mobile-icon-box { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background-color: var(--bg-body); border: 1px solid var(--border); border-radius: 8px; color: var(--text-main); flex-shrink: 0; }
  .mobile-text-box { display: flex; flex-direction: column; }
  .mt-title-mob { font-weight: 700; font-size: 0.95rem; color: var(--text-main); line-height: 1.2; }
  .mt-desc-mob { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
  .mobile-sublink.footer-style { background-color: var(--bg-footer-bar); margin-top: 10px; border: 1px solid transparent; }
  .mobile-contact-btn { display: flex; justify-content: center; align-items: center; width: 100%; padding: 15px; margin-top: 28px; background-color: var(--accent); color: #fff !important; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; border-radius: 6px; text-decoration: none; box-shadow: 0 4px 15px rgba(211, 60, 20, 0.3); }
  /* v20260526-1: 2 CTA side-by-side na dole mobile menu (Wyceń projekt + Kontakt) */
  .mobile-cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
  .mobile-cta-row .mobile-contact-btn { margin-top: 0; padding: 14px 10px; font-size: 0.82rem; letter-spacing: 0.6px; }
  .mobile-contact-btn--alt { background-color: transparent !important; color: var(--accent) !important; border: 1px solid var(--accent); box-shadow: none !important; }
}

.nav-contact-btn { display: flex; align-items: center; justify-content: center; padding: 7px 16px; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent); font-family: "Rajdhani", sans-serif; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; text-decoration: none; letter-spacing: 0.9px; transition: all 0.3s ease; margin-left: 8px; }
.nav-contact-btn:hover { background-color: var(--accent); color: #ffffff; box-shadow: 0 4px 15px rgba(211, 60, 20, 0.3); }
.nav-item-contact { display: flex; align-items: center; height: 100%; padding: 0 10px; }

/* === TEMPLATE UTILITIES (generated v20251231-1) === */
.mega-menu.mw-400 { min-width: 400px; }
.mega-menu.mw-550 { min-width: 550px; }
.mega-menu.mw-600 { min-width: 600px; }
.mega-menu.mw-650 { min-width: 650px; }
.mobile-group-title.is-first { margin-top: 0; }


/* ============================================================
   FX HEADER LAYOUT — logo L | nav center | cluster R
   ============================================================ */
@media (min-width: 1100px) {
  header {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
  .desktop-nav {
    margin: 0 !important;
    display: flex !important;
    justify-content: center;
  }
  .nav-wrapper {
    width: auto;
    justify-content: center;
  }
  .header-right {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    height: var(--header-height);
    gap: 18px;
  }
  /* v20260511-42: stretch do pelnej wysokosci headera, zeby underline ::after (3px accent na bottom) dotykal szarej linii. */
  .header-right .hdr-nav-item {
    display: flex;
    align-items: center;
    align-self: stretch;
    height: 100%;
    padding: 0 12px;
  }
  .header-right .hdr-nav-item .nav-link-top {
    height: 18px;
    line-height: 18px;
  }
  .header-right .hdr-cta,
  .header-right .theme-toggle {
    align-self: center;
  }
  /* v20260511-44: mega-menu O Nas obniżone o 15px zeby pasowalo do glownej nav.
     Glowny nav .nav-item-has-mega jest mniejszy (H=59) niz O Nas (H=72 stretched), wiec top:74px
     mierzony od parent.top daje mega 15px nizej dla glownego niz dla O Nas. Kompensujemy. */
  .header-right .hdr-mega-right .mega-menu {
    top: calc(var(--header-height) + 15px);
    left: auto;
    right: 0;
    transform: translateX(0) translateY(10px);
  }
  .header-right .hdr-mega-right:hover .mega-menu,
  .header-right .hdr-mega-right.is-open .mega-menu,
  .header-right .hdr-mega-right:focus-within .mega-menu {
    transform: translateX(0) translateY(0);
  }
  /* Niewidzialny pomost — standardowe 24px (jak inne mega-menus) */
  .header-right .hdr-mega-right .mega-menu::after {
    left: auto;
    right: 24px;
    transform: rotate(45deg);
  }
  /* v20260514-11: styling 1:1 z hover .fx-shop-footer-cta .btn-secondary
     (Fira Code mono + pomar tint bg + strzalka). Default = "highlighted". */
  .hdr-cta {
    font-family: 'Fira Code', ui-monospace, monospace;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 9px 16px;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: rgba(211, 60, 20, .05);
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
  }
  .hdr-cta:hover { background: var(--accent); color: #fff; }
}
@media (max-width: 1099px) {
  .hdr-nav-item, .hdr-cta { display: none; }
}
