/* ======================================================
   HEADER — SPIRO (Wix inspired)
====================================================== */

.site-header{
  position: relative;
  background: var(--bg);
  padding: 10px 0;
}

/* FULL WIDTH LINES */
.site-header::before,
.site-header::after{
  content:"";
  position:absolute;
  left: 30px;
  right: 30px;
  height: 1px;
  background: var(--cta);
}

.site-header::before{ top: 15px; }
.site-header::after{ bottom: 15px; }

/* =========================================
   INNER WRAPPER
========================================= */

.wix-header__inner{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-left: 40px;
  padding-right: 40px;
}

/* =========================================
   BRAND — samo logo bez tła
========================================= */

.wix-header__brand{
  display:flex;
  align-items:center;
  gap: 22px;
  flex: 0 0 auto;
}

.wix-header__brand .logo{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: auto;
  height: auto;
  background: none;        
  padding: 0;
}

.wix-header__brand .logo-img,
.wix-header__brand .custom-logo{
  width: auto;
  height: 150px !important;      
  max-height: 160px !important;
  display:block;
  object-fit: contain;
  margin-top: -25px;
}

.wix-header__divider{
  width: 1px;
  height: 64px;
  background: var(--line);
}

/* =========================================
   NAVIGATION
========================================= */

.wix-nav{
  display:flex;
  align-items:center;
  gap: 22px;
  flex: 1;
}

.wix-nav__center{
  flex: 1;
  display:flex;
  justify-content:center;
}

.wix-nav__list{
  display:flex;
  align-items:center;
  gap: clamp(12px, 2vw, 32px);
  list-style:none;
  margin:0;
  padding:0;
  font-size: clamp(13px, 1.3vw, 16px);
  font-weight: 400;
}

/* =========================================
   MENU LINKS
========================================= */

.wix-nav__list a{
  position: relative;
  padding: 8px 4px;
  text-decoration: none;
  opacity: .85;
  transition: opacity .2s ease;
}

.wix-nav__list a:hover{
  opacity: 1;
}

.wix-nav__list a::after{
  content:"";
  position:absolute;
  left: 4px;
  right: 4px;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
  opacity: .85;
}

.wix-nav__list a:hover::after{
  transform: scaleX(1);
}

.wix-nav__list .current-menu-item > a::after{
  transform: scaleX(1);
  opacity: 1;
}

/* =========================================
   MENU SEPARATORS |
========================================= */

.wix-nav__list li{
  position: relative;
  display:flex;
  align-items:center;
}

.wix-nav__list li:not(:last-child)::after{
  content: "|";
  margin-left: clamp(8px, 1.2vw, 18px);
  color: var(--cta);
  opacity: .7;
  font-weight: 300;
}

/* =========================================
   CTA BUTTON — dostosowany do stylu strony
========================================= */

.wix-nav__cta{
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 11px clamp(14px, 1.8vw, 28px);
  border-radius: 999px;

  background: var(--cta);
  color: var(--cta-text);

  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  border: 1px solid var(--cta);

  transition: background .25s ease,
              color .25s ease,
              border-color .25s ease;
}

.wix-nav__cta:hover{
  background: var(--accent);
  color: var(--text);
  border-color: var(--accent);
}

/* =========================================
   BURGER
========================================= */

.wix-burger{
  display:none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 10px;
  align-items:center;
  justify-content:center;
  gap: 6px;
  cursor:pointer;
}

.wix-burger span{
  display:block;
  width: 18px;
  height: 2px;
  background: var(--text);
  opacity: .85;
}

/* ===== Overlay ===== */
.nav-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 999;
}

.nav-overlay.is-active{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ===== Close button ===== */
.wix-nav__close{
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.wix-nav__close::before,
.wix-nav__close::after{
  content:"";
  position:absolute;
  width: 22px;
  height: 2px;
  background: var(--text);
  opacity: .85;
}

.wix-nav__close::before{ transform: rotate(45deg); }
.wix-nav__close::after{ transform: rotate(-45deg); }

/* =========================================
   MOBILE DRAWER
========================================= */
@media (max-width: 1050px){

  .wix-header__inner{
    padding-left: 20px;
    padding-right: 20px;
  }

  .wix-burger{ display:inline-flex; }
  .wix-header__divider{ display:none; }

  .wix-nav{
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 50vw;
    max-width: 460px;
    min-width: 280px;
    background: var(--bg);
    padding: 92px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    transform: translateX(100%);
    transition: transform .32s ease;
    z-index: 1000;
    box-shadow: -22px 0 50px rgba(16,34,27,.18);
  }

  .wix-nav::before{
    content:"";
    position:absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--cta);
    opacity: .9;
  }

  .wix-nav.is-open{
    transform: translateX(0);
  }

  .wix-nav__center{
    justify-content:flex-start;
  }

  .wix-nav__list{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    font-size: 22px;
    font-weight: 500;
  }

  .wix-nav__list li::after{ content: none !important; }
  .wix-nav__list a::after{ content:none; }

  .wix-nav__cta{
    width: 100%;
    text-align: center;
    padding: 14px 18px;
  }
    
  .wix-header__brand .logo-img,
  .wix-header__brand .custom-logo{
  height: 90px;
  max-height: 90px;
 }
}

@media (max-width: 520px){
  .wix-nav{ width: 82vw; }
}

/* ======================================================
   SAFETY: CLOSE NEVER ON DESKTOP
====================================================== */

.wix-nav__close{ display:none !important; }

@media (max-width: 1050px){
  .wix-nav.is-open .wix-nav__close{ display:block !important; }
}


/* ══════════════════════════════════════════════════════════════
   LANGUAGE SWITCHER (Polylang)
   Polylang generuje <li> bezpośrednio w .lang-switcher (bez <ul>)
   Flagi mają inline style width/height — nadpisujemy przez !important
══════════════════════════════════════════════════════════════ */

.wix-nav__right {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Pill */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--text);
    border-radius: 40px;
    padding: 6px 12px;
    gap: 0;
    flex-shrink: 0;
    list-style: none;
    margin: 0;
}

/* Li bezpośrednio w .lang-switcher */
.lang-switcher > li,
.lang-switcher ul,
.lang-switcher ul li {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.lang-switcher ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Ukryj bullet points */
.lang-switcher > li::marker,
.lang-switcher ul li::marker {
    display: none;
    content: none;
}

/* Separator między flagami */
.lang-switcher > li + li,
.lang-switcher ul li + li {
    margin-left: 0;
}

.lang-switcher > li + li::before,
.lang-switcher ul li + li::before {
    content: '';
    display: block;
    width: 1px;
    height: 13px;
    background: var(--text);
    opacity: 0.25;
    margin: 0 8px;
    flex-shrink: 0;
}

/* Ukryj nazwy języków */
.lang-switcher li a span,
.lang-switcher li span {
    display: none !important;
}

/* Link */
.lang-switcher li a {
    display: flex;
    align-items: center;
    padding: 1px 2px;
    opacity: 0.35;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    outline: none;
    border: none;
    background: none;
    line-height: 0;
}

.lang-switcher li a:hover { opacity: 1; transform: scale(1.08); }
.lang-switcher li.current-lang a { opacity: 1; }

/* Ukryj pikselowe base64 PNG z Polylangu */
.lang-switcher li a img {
    display: none !important;
}

/* Zastąp flagami z assets/img/ jako pseudo-element */
.lang-switcher li.lang-item-pl a::after {
    content: '';
    display: block;
    width: 26px;
    height: 17px;
    background: url('/wp-content/themes/spiro-pilates/assets/img/pl.png') center/cover no-repeat;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.lang-switcher li.lang-item-en a::after {
    content: '';
    display: block;
    width: 26px;
    height: 17px;
    background: url('/wp-content/themes/spiro-pilates/assets/img/gb.png') center/cover no-repeat;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

/* Placeholder (bez Polylangu) */
.lang-switcher--placeholder {
    gap: 0;
}
.lang-switcher__item {
    display: flex;
    align-items: center;
    padding: 1px 2px;
    opacity: 0.35;
    text-decoration: none;
}
.lang-switcher__item--active { opacity: 1; }
.lang-switcher__item + .lang-switcher__item::before {
    content: '';
    display: block;
    width: 1px;
    height: 13px;
    background: var(--text);
    opacity: 0.25;
    margin: 0 8px;
}
.lang-switcher__item img {
    width: 26px !important;
    height: 17px !important;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

/* ── Tablet ≤ 1200px ───────────────────────────────────────── */
@media (max-width: 1200px) {
    .wix-nav__right { gap: 20px; }
}

/* ── Mobile drawer ≤ 1050px ────────────────────────────────── */
@media (max-width: 1050px) {
    .wix-nav__right {
        flex-direction: column-reverse;
        align-items: center;
        gap: 24px;
        width: 100%;
        margin-left: 0;
        padding-bottom: 8px;
    }

    .lang-switcher {
        padding: 8px 16px;
    }

    .lang-switcher li a img { display: none !important; }
    .lang-switcher li.lang-item-pl a::after,
    .lang-switcher li.lang-item-en a::after {
        width: 32px;
        height: 21px;
    }

    .lang-switcher > li + li::before,
    .lang-switcher ul li + li::before {
        margin: 0 10px;
        height: 15px;
    }
}

/* ── Small phone ≤ 420px ───────────────────────────────────── */
@media (max-width: 420px) {
    .lang-switcher { padding: 7px 14px; }
    .lang-switcher li a img { display: none !important; }
    .lang-switcher li.lang-item-pl a::after,
    .lang-switcher li.lang-item-en a::after {
        width: 28px;
        height: 19px;
    }
}
