/* ========================================================================
   ОСНОВНЫЕ СТИЛИ ШАПКИ
   ======================================================================== */

.trad-header {
    color: var(--trds-text-primary);
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    background: var(--trds-background);
}

.home .trad-header {
    box-shadow: none;
}

.trad-header__container {
    max-width: var(--trds-header-container-max);
    margin-inline: auto;
    padding-inline: var(--trds-container-padding);
}

/* ========================================================================
   ВЕРХНЯЯ ЧАСТЬ ШАПКИ
   ======================================================================== */

.trad-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
    gap: 30px;
}

/* ========================================================================
   ОРГАНИЗАЦИЯ (ЦЕНТРАЛЬНЫЙ БЛОК)
   ======================================================================== */

.trad-organization {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.trad-organization__wrapper {
    display: flex;
    align-items: center;
    gap: clamp(20px, 2.5vw, 30px);
}

/* Логотип */
.trad-organization__logo {
    flex-shrink: 0;
}

.trad-organization__logo .custom-logo-link {
    display: block;
    line-height: 0;
}

.trad-organization__logo img,
.trad-organization__logo .custom-logo {
    width: clamp(70px, 7vw, 100px);
    height: auto;
    max-height: 100px;
    object-fit: contain;
    display: block;
    border: 2px solid var(--trds-accent);
    border-radius: 50%;
}

.trad-logo {
    width: clamp(70px, 7vw, 100px);
    height: clamp(70px, 7vw, 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--trds-background);
    border-radius: 50%;
}

.trad-logo__icon {
    color: var(--trds-primary);
    font-size: clamp(35px, 4vw, 50px);
}

/* Текст организации */
.trad-organization__text {
    text-align: center;
}

.trad-organization__line1 {
    font-size: clamp(11px, 1.1vw, 16px);
    color: var(--trds-text-primary);
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.3;
    text-transform: uppercase;
}

.trad-organization__line2 {
    font-size: clamp(12px, 1.3vw, 16px);
    color: var(--trds-text-primary);
    font-weight: 600;
    line-height: 1.3;
    margin: 0.3em 0;
}

.trad-organization__line3 {
    font-size: clamp(26px, 3vw, 38px);
    color: var(--trds-primary);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

/* ========================================================================
   ПРАВЫЙ БЛОК С ДЕЙСТВИЯМИ
   ======================================================================== */

.trad-header__actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

/* Социальные сети */
.trad-social {
    display: flex;
    gap: 12px;
}

.trad-social__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--trds-social-icon-size);
    height: var(--trds-social-icon-size);
    border-radius: 50%;
    background: var(--trds-accent);
    color: var(--trds-background);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: var(--trds-social-icon-font);
}
.trad-social__icon {
    width: 21px;
    height: auto;
    vertical-align: middle;
}.trad-social__icon:hover {
    color: #333;
 }

.trad-social__link:hover {
    background: var(--trds-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
    color: var(--trds-background);
}

.trad-social__link:focus {
    outline: 2px solid var(--trds-primary);
    outline-offset: 2px;
}

/* Поиск */
.trad-search {
    position: relative;
    display: flex;
    align-items: center;
}

.trad-search__icon {
    color: var(--trds-text-secondary);
    font-size: 2rem;
    cursor: pointer;
}

.trad-search__input {
    width: 0;
    padding: 0;
    border: none!important;
    border-bottom: 2px solid transparent;
    background: transparent!important;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--trds-text-primary);
}

.trad-search:hover .trad-search__input,
.trad-search__input:focus {
    width: 180px;
    padding: 8px 5px;
    border-bottom-color: var(--trds-accent);
    margin-left: 10px;
}

.trad-search__input:focus {
    outline: none;
}

.trad-search__input::placeholder {
    color: var(--trds-text-muted);
}

/* Кнопка помощи */
.trad-help-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--trds-accent);
    color: var(--trds-background);
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.trad-help-btn:hover {
    background: var(--trds-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
    color: var(--trds-text-primary);
}

.trad-help-btn:focus {
    outline: 2px solid var(--trds-primary);
    outline-offset: 2px;
}

/* ========================================================================
   НАВИГАЦИЯ
   ======================================================================== */

.trad-nav {
    padding: 0;
}

.trad-nav__list {
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.trad-nav__item {
    position: relative;
}

.trad-nav__link {
    display: block;
    padding: .5rem clamp(10px, 1.8vw, 35px) .2rem;
    color: var(--trds-text-primary);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    font-size: clamp(10px, 1vw, 16px);
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    font-family: 'PT Sans Narrow', system-ui;
}

.trad-nav__link:hover {
    background: rgba(212, 165, 116, 0.1);
    border-bottom-color: var(--trds-accent);
    color: var(--trds-primary);
}

.trad-nav__link:focus {
    outline: 2px solid var(--trds-primary);
    outline-offset: -2px;
}

/* Выпадающие меню */
.trad-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--trds-background);
    color: var(--trds-text-primary);
    min-width: 280px;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.15);
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.trad-nav__item:hover .trad-dropdown,
.trad-nav__item:focus-within .trad-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.trad-dropdown__list {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.trad-dropdown__item {
    border-bottom: 1px solid rgba(212, 165, 116, 0.1);
}

.trad-dropdown__item:last-child {
    border-bottom: none;
}

.trad-dropdown__link {
    display: block;
    padding: 10px 20px;
    color: var(--trds-text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.4;
}

.trad-dropdown__link:hover {
    background: rgba(212, 165, 116, 0.1);
    color: var(--trds-primary);
}

.trad-dropdown__link:focus {
    outline: 2px solid var(--trds-primary);
    outline-offset: -2px;
}

/* ========================================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ======================================================================== */

/* Мобильные элементы управления */
.trad-mobile-controls {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--trds-background);
    padding: 15px 20px;
    z-index: 2000;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.1);
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.trad-mobile-controls__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.trad-mobile-help {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--trds-primary);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 15px;
    background: rgba(212, 165, 116, 0.1);
    font-weight: 500;
    border: 1px solid rgba(212, 165, 116, 0.3);
}

.trad-mobile-logo {
    width: clamp(40px, 13vw, 60px);
    height: clamp(40px, 13vw, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.trad-mobile-logo .custom-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 50%;
}

.trad-mobile-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 50%;
}

.trad-mobile-logo .ph {
    color: var(--trds-primary);
    font-size: clamp(24px, 5vw, 40px);
}

.trad-mobile-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.trad-mobile-btn {
    background: none;
    border: none;
    color: var(--trds-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
    font-size: 24px;
}

.trad-mobile-btn:hover {
    background: rgba(212, 165, 116, 0.1);
}

.trad-mobile-btn:focus {
    outline: 2px solid var(--trds-primary);
    outline-offset: 2px;
}

/* Мобильное меню */
.trad-mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--trds-background);
    z-index: 1500;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom), 40px);
}

.trad-mobile-menu.trad-mobile-menu--active {
    display: block;
}

.trad-mobile-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
    margin-bottom: 20px;
}

.trad-mobile-social__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--trds-primary);
    color: var(--trds-background);
    text-decoration: none;
    font-size: 24px;
}

.trad-mobile-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trad-mobile-nav__item {
    margin-bottom: 20px;
}

.trad-mobile-nav__title {
    font-weight: 600;
    color: var(--trds-primary);
    margin-bottom: 10px;
    padding: 5px 0;
    border-bottom: 2px solid var(--trds-primary);
    text-decoration: none;
    display: block;
}

.trad-mobile-nav__sublist {
    list-style: none;
    margin-left: 20px;
    padding: 0;
}

.trad-mobile-nav__subitem {
    margin-bottom: 8px;
}

.trad-mobile-nav__link {
    color: var(--trds-text-primary);
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
}

.trad-mobile-nav__link:hover {
    color: var(--trds-primary);
}

/* Мобильный поиск */
.trad-mobile-search {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.trad-mobile-search__content {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.trad-mobile-search__content form {
    display: flex;
    gap: 10px;
}

.trad-mobile-search__input {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    border: 2px solid var(--trds-accent);
    border-radius: 8px;
    background: var(--trds-background);
    color: var(--trds-text-primary);
}

.trad-mobile-search__submit {
    padding: 15px 20px;
    background: var(--trds-accent);
    color: var(--trds-background);
    border: none;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
}

.trad-mobile-search__close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

/* ========================================================================
   АДАПТИВНОСТЬ
   ======================================================================== */

/* Мобильные устройства */
@media (max-width: 768px) {
    /* Скрываем десктопные элементы */
    .trad-header__top,
    .trad-nav {
        display: none;
    }

    /* Показываем мобильные элементы */
    .trad-mobile-controls {
        display: block;
    }
}

/* ========================================================================
   TOUCH TARGETS
   ======================================================================== */

@media (pointer: coarse) {
    .trad-mobile-btn { min-width: 48px; min-height: 48px; }
    .trad-nav__link  { padding-block: var(--trds-space-md); }
}

/* ========================================================================
   WORDPRESS СПЕЦИФИЧНЫЕ СТИЛИ
   ======================================================================== */

/* Admin bar adjustments */
.admin-bar .trad-mobile-controls {
    top: 46px;
}

.admin-bar .trad-mobile-menu {
    top: 116px;
    padding-bottom: max(20px, env(safe-area-inset-bottom), 40px);
}

@media screen and (min-width: 783px) {
    .admin-bar .trad-mobile-controls {
        top: 32px;
    }

    .admin-bar .trad-mobile-menu {
        top: 102px;
        padding-bottom: max(20px, env(safe-area-inset-bottom), 40px);
    }
}

/* ========================================================================
   ДОСТУПНОСТЬ
   ======================================================================== */

/* Скрытие элементов для скрин-ридеров */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Уменьшение анимаций */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
