/*
 * [td_lang] language switcher (inc/lang-switcher.php).
 *
 * bar   - header row (option C+): globe + current language + chevron that
 *         opens a small dropdown. White over a dark hero until scrolled,
 *         like the links.
 * names - mobile panel (light) and footer (dark): "Български · English".
 */

.td-lang {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  font-family: var(--td-font-body, "Inter", sans-serif);
  font-style: normal;
}

.td-lang__item {
  display: inline-block;
  text-decoration: none;
  transition: color 0.3s, opacity 0.3s;
}

a.td-lang__item:hover,
a.td-lang__item:focus-visible {
  color: #E8247C;
  opacity: 1;
}

/* ---- bar: header row, option C+ ----
 * Button: globe + current code + chevron, nav-link type, after "Записване"
 * (desktop) or before the burger (mobile). Panel: the header-dropdown look
 * (td-hdr-dd-box / td-hdr-dd-link), right-aligned so it never leaves the
 * screen. Opens on :hover with a mouse and on .td-is-open (lang-switcher.js).
 */

.td-lang--bar {
  position: relative;
}

.td-lang--bar button.td-lang__toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.5rem 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
  color: #111111;
  font: inherit;
  font-family: var(--td-font-body, "Inter", sans-serif);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.3s;
}

.td-lang--bar button.td-lang__toggle:hover,
.td-lang--bar button.td-lang__toggle:focus,
.td-lang--bar button.td-lang__toggle:focus-visible,
.td-lang--bar button.td-lang__toggle:active {
  background: transparent;
  color: #E8247C;
}

.td-lang__globe {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  flex: 0 0 auto;
}

.td-lang__code {
  margin-right: -0.2em; /* letter-spacing trails the last letter */
}

.td-lang__chev {
  width: 8px;
  height: 8px;
  margin-left: 0.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  opacity: 0.6;
  transition: transform 0.2s;
}

.td-lang--bar.td-is-open .td-lang__chev {
  transform: rotate(180deg);
}

.td-lang__panel {
  display: none;
  position: absolute;
  top: 100%;
  right: -0.75rem;
  z-index: 60;
  padding-top: 0.75rem;
}

.td-lang--bar.td-is-open .td-lang__panel {
  display: block;
}

@media (hover: hover) {
  .td-lang--bar:hover .td-lang__panel {
    display: block;
  }
}

.td-lang__menu {
  width: 190px;
  margin: 0;
  padding: 0.75rem 0;
  list-style: none;
  border: 1px solid rgba(17, 17, 17, 0.05);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.td-lang__menu li {
  margin: 0;
  padding: 0;
}

.td-lang__menu .td-lang__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 1.5rem;
  font-weight: 300;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #111111;
  transition: color 0.15s, background-color 0.15s;
}

.td-lang__menu a.td-lang__item:hover,
.td-lang__menu a.td-lang__item:focus-visible {
  color: #E8247C;
  background-color: rgba(232, 36, 124, 0.05);
}

.td-lang__menu .td-lang__item--current {
  color: #E8247C;
}

.td-lang__menu small {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

.td-lang__check {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: #E8247C;
  stroke-width: 2;
}

@media (max-width: 767px) {
  .td-lang--bar button.td-lang__toggle {
    padding: 0.875rem 0.25rem; /* 44px tap target */
  }

  .td-lang__panel {
    right: -0.5rem;
    padding-top: 0.25rem;
  }
}

/* Dark hero, not yet scrolled (header.css td-header-dark state). The panel
   stays white with dark text, like the other header dropdowns. */
body.td-new.td-header-dark [data-id="292bf84d"]:not(.td-header--scrolled) .td-lang--bar button.td-lang__toggle {
  color: #fff;
}

body.td-new.td-header-dark [data-id="292bf84d"]:not(.td-header--scrolled) .td-lang--bar button.td-lang__toggle:hover,
body.td-new.td-header-dark [data-id="292bf84d"]:not(.td-header--scrolled) .td-lang--bar button.td-lang__toggle:focus-visible {
  color: #E8247C;
}

/* ---- names: mobile panel (light) ---- */

.td-lang--names {
  justify-content: center;
  gap: 0.25rem;
}

.td-lang--names .td-lang__item {
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.05em;
  color: #666666;
  padding: 0.75rem 0.5rem;
}

.td-lang--names .td-lang__item--current {
  color: #E8247C;
}

.td-lang--names .td-lang__sep::before {
  content: "\00B7";
  color: rgba(17, 17, 17, 0.3);
}

.td-hdr-sheet-in .td-lang--names {
  width: 100%;
  margin-top: 1rem;
}

/* ---- names: footer (dark) ---- */

.td-ftr .td-lang--names {
  justify-content: flex-start;
}

.td-ftr .td-lang--names .td-lang__item {
  font-weight: 300;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0;
  color: #6b7280;
  padding: 0.25rem;
}

.td-ftr .td-lang--names .td-lang__item--current {
  color: rgba(255, 255, 255, 0.8);
}

.td-ftr .td-lang--names .td-lang__sep::before {
  color: rgba(255, 255, 255, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .td-lang__item,
  .td-lang--bar button.td-lang__toggle,
  .td-lang__chev {
    transition: none;
  }
}
