/* Przełącznik języka w głównym menu (inc/language-switcher.php).
   Typografia i wysokość linii jak pozycje menu (#menu-menu > li > a: GeneralSans 14px/700, wielkie litery,
   line-height 28px), bez własnego tła - wygląda jak kolejna pozycja menu z rozwijaną listą. */

.custom-language-switcher {
    position: relative;
    display: inline-block;
    font-family: 'GeneralSans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 28px;
    text-transform: uppercase;
    color: #000;
    user-select: none;
    z-index: 99;
}

/* Odstęp od "Kontakt" i od ikon społecznościowych: 32px z obu stron (między pozycjami menu jest 20px).
   Pozycje menu mają już po 10px paddingu (ul#menu-menu li w style.css), stąd 12px + 10px + 10px. */
#menu-menu > li.menu-item-language {
    margin-left: 12px;
    margin-right: 22px;
}

.lang-switcher-current,
.lang-switcher-dropdown a.lang-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switcher-current {
    cursor: pointer;
    background: transparent;
}

/* Strzałka w tym samym rzędzie co tekst (wcześniej pozycjonowana absolutnie) */
.lang-switcher-current::after {
    content: '';
    width: 10px;
    height: 10px;
    background: url("arrow-down.svg") center / 10px no-repeat;
    transition: transform 0.2s;
}

.custom-language-switcher.is-open .lang-switcher-current::after {
    transform: rotate(180deg);
}

.lang-switcher-current:hover,
.lang-switcher-current:focus-visible,
.custom-language-switcher.is-open .lang-switcher-current {
    color: #FF2E00;
}

.lang-switcher-current:focus-visible {
    outline: 2px solid #FF2E00;
    outline-offset: 4px;
}

.flag-icon {
    width: 16px;
    height: 16px !important;
    border: 1px solid #000;
    border-radius: 50% !important;
    object-fit: cover;
    display: block;
    flex: none;
}

/* Lista: bez tła, wyrównana do lewej krawędzi bieżącego języka */
.lang-switcher-dropdown {
    list-style: none;
    margin: 0;
    padding: 4px 0 0 !important;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.custom-language-switcher.is-open .lang-switcher-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* #menu-menu - żeby wygrać z "ul#menu-menu li { padding: 0 10px }" ze style.css */
#menu-menu .lang-switcher-dropdown li,
.lang-switcher-dropdown li {
    padding: 0;
    white-space: nowrap;
}

.lang-switcher-dropdown a.lang-content {
    color: #000;
    text-decoration: none;
    transition: color 0.2s;
}

.lang-switcher-dropdown a.lang-content:hover,
.lang-switcher-dropdown a.lang-content:focus-visible {
    color: #FF2E00;
}


@media (max-width: 767px) {
  /* Menu mobilne: jak pozycje menu na telefonie, wyśrodkowane */
  .custom-language-switcher {
    font-size: 26px;
    line-height: 20px;
    font-weight: 600;
    margin-top: 10px;
  }

  #menu-menu > li.menu-item-language {
    margin: 0;
  }

  .lang-switcher-current,
  .lang-switcher-dropdown a.lang-content {
    justify-content: center;
  }

  .lang-switcher-current:hover,
  .custom-language-switcher.is-open .lang-switcher-current {
    color: #000;
  }

  .lang-switcher-dropdown {
    position: static;
    display: none;
    padding: 16px 0 0 !important;
  }

  .custom-language-switcher.is-open .lang-switcher-dropdown {
    display: block;
  }
}
