/* CSS pro původní HTML strukturu z Astra + WPML */
.ast-builder-language-switcher {
    position: relative;
    display: inline-block;
    z-index: 999;
}

/* Skrytí původního menu a vytvoření dropdown buttonu */
.ast-builder-language-switcher ul.ast-builder-language-switcher-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: transparent;
    list-style: none;
    margin: 0 0 5px 0;
    padding: 0;
    display: none;
    z-index: 1000;
    min-width: 120px;
    width: auto;
}

/* Zobrazení menu při aktivaci */
.ast-builder-language-switcher.dropdown-open ul.ast-builder-language-switcher-menu {
    display: block;
}

/* Styling pro položky menu */
.ast-builder-language-switcher li.ast-builder-language-switcher-menu-item-footer {
    margin: 0;
    padding: 0;
    list-style: none;
    display: block;
}

.ast-builder-language-switcher a.ast-builder-language-switcher-item {
    display: block;
    padding: 14px 20px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    border: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.4;
    position: relative;
    border-top: 1px solid #555;
}

.ast-builder-language-switcher li.ast-builder-language-switcher-menu-item-footer:first-child a.ast-builder-language-switcher-item {
    border-top: none;
}

.ast-builder-language-switcher a.ast-builder-language-switcher-item:focus {
    outline: none;
}

.ast-builder-language-switcher a.ast-builder-language-switcher-item.ast-builder-language-switcher-item__active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 700;
    position: relative;
}

.ast-builder-language-switcher a.ast-builder-language-switcher-item.ast-builder-language-switcher-item__active::after {
    content: '✓';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Vytvoření dropdown tlačítka */
.ast-builder-language-switcher::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    cursor: pointer;
}

/* Zobrazení aktuálního jazyka jako tlačítko */
.ast-builder-language-switcher.dropdown-initialized {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none;
    justify-content: space-between;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.ast-builder-language-switcher.dropdown-initialized::after {
    content: '';
    width: 6px;
    height: 5px;
    background-image: url('data:image/svg+xml;utf8,<svg width="6" height="5" viewBox="0 0 6 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.666992 1.33268L3.00033 3.66602L5.33366 1.33268" stroke="%23D2D2D6" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-left: 8px;
    display: inline-block;
}

.ast-builder-language-switcher.dropdown-open::after {
    transform: rotate(180deg);
}

/* WPML touch přepínače v mobilní hlavičce */
.mobile-lang-switch {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 2px !important; /* Mírně zvětšeno pro prostor kolem aktivního tlačítka */
    margin: 32px 16px 12px 16px;
    border-radius: var(--radius-xs);
    background: var(--background-secondary, #EEEEEF);
}

.mobile-lang-switch .mls-btn {
    /* KLÍČOVÁ ZMĚNA: Každý prvek si vezme 1 díl (tedy 50 %) */
    flex: 1;
    text-align: center;
    
    display: block;
    text-decoration: none;
    font-weight: 600;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;

    border-radius: var(--radius-xs);
    padding: var(--padding-12, 10px 14px); /* Sjednocení paddingu */
    border: 1px solid transparent; /* Prevence posunu při aktivaci */

    color: var(--text-positive-secondary, #52525B);
    transition: background 0.2s ease; /* Volitelné: hladší přepínání */
}

.mobile-lang-switch .mls-btn:is(:hover, :focus-visible) {
    text-decoration: none;
    outline: none
}

.mobile-lang-switch .mls-btn.is-active {
    background: #fff;
    color: var(--text-positive-primary, #022930);
    border-color: transparent;
    cursor: default;
    pointer-events: none;
    /* Volitelný stín pro lepší efekt "vyskočení" z pozadí */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

/* Animace pro položky - zjednodušené */
.ast-builder-language-switcher li.ast-builder-language-switcher-menu-item-footer {
    opacity: 1;
}

/* nav-open header bg (white) → MRTVÉ + duplikát: audit-fixes 794–797 dává #F7F7F7
   !important (po tomto souboru). Smazáno. Konsolidace #4 2026-09-07. */

#ast-mobile-header .content-align-flex-start {
    z-index: 1000;
    position: absolute;
}

.ast-mobile-header-wrap .menu-toggle .mobile-menu-toggle-icon {
    display: inline-flex;
    align-self: center;
    align-items: center;
}

[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg {
    width: 28px;
    height: 28px;
}

[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon {
    font-weight: 500;
    font-style: Medium;
    font-size: .75rem;
    leading-trim: NONE;
    line-height: 160%;
    letter-spacing: 2%;
    color: var(--text-positive-primary, #022930);
}

body.home [data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg {
  fill: #fff;
}

body.home [data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg path {
  stroke: #fff;
}

body [data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg {
  fill: var(--icon-positive);
}

body [data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg path,
body [data-section="section-header-mobile-trigger"] .ast-button-wrap .toggled .mobile-menu-toggle-icon .ast-mobile-svg path {
  stroke: var(--icon-positive);
}

body [data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon::before {
  content: "Menu";
  font-weight: 500;
  font-style: Medium;
  font-size: .75rem;
  line-height: 160%;
  letter-spacing: 2%;
  margin-right: 8px;
}

[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon::before,
body.home [data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon::before {
    content: "Menu";
}

[data-section="section-header-mobile-trigger"] .ast-button-wrap .toggled .mobile-menu-toggle-icon::before,
body.home [data-section="section-header-mobile-trigger"] .ast-button-wrap .toggled .mobile-menu-toggle-icon::before {
    content: "Zavřít";
}

[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon::before,
body.home [data-section="section-header-mobile-trigger"] .ast-button-wrap .toggled .mobile-menu-toggle-icon::before {
    color: var(--text-positive-primary, #022930);
}

[data-section="section-header-mobile-trigger"] .ast-button-wrap .toggled .mobile-menu-toggle-icon::before,
body.home [data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon::before {
    color: var(--text-negative-primary, #FFFFFF);
}

.main-header-menu-toggle:focus,
.main-header-menu-toggle:hover {
  outline: 0;
  border: 0;
}

.wpml-ls-legacy-dropdown .wpml-ls-item {
    background-color: var(--background-dark);
    padding: 3px 0 3px 10px !important;
    border-bottom-left-radius: var(--radius-xxs);
    border-bottom-right-radius: var(--radius-xxs);
}

.wpml-ls-legacy-dropdown .wpml-ls-sub-menu a {
    padding: 5px 24px 5px 0;
}

/* (Volitelné) zmenšení mezer v úzkých zobrazeních */
@media (max-width: 380px) {
  .mobile-lang-switch { gap: 6px; }
  .mobile-lang-switch .mls-btn { padding: 8px 12px; }
}