/* ============================================
   MC-TOPBAR + MC-HEADER
   Mobile-first, Брейкпоинты: 640px, 992px, 1200px
   ============================================ */

/* ===== Верхняя полоса ===== */
.mc-topbar {
    background: var(--mc-green-dark);
    color: var(--mc-white);
    font-size: 14px;
    display: none;
}

.mc-topbar__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding-top: 6px;
    padding-bottom: 6px;
}

.mc-topbar__contacts {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.mc-topbar a {
    transition: .4s;
}

.mc-topbar a:hover {
    color: var(--mc-gold);
}

/* ===== Шапка ===== */
.mc-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--mc-green);
    color: var(--mc-white);
    border-bottom: 1px solid rgba(255, 255, 255, .13);
}

.mc-header__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    padding-top: clamp(10px, 2vw, 14px);
    padding-bottom: clamp(10px, 2vw, 14px);
}

/* ВЕРХНЯЯ СТРОКА */
.mc-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(12px, 3vw, 24px);
    width: 100%;
}

/* Логотип */
.mc-header__logo {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 14px);
    color: var(--mc-white);
    min-width: 0;
    text-decoration: none;
    transition: .4s;
}

.mc-header__logo:hover,
.mc-header__logo:focus-visible { color: var(--mc-gold); }

.mc-header__logo-icon {
    flex: none;
    width: clamp(26px, 6vw, 30px);
    height: auto;
    transition: .4s;
}

.mc-header__logo-text {
    min-width: 0;
    overflow: hidden;
}

.mc-header__logo-name {
    display: block;
    font-size: clamp(18px, 2.4vw, 22px);
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
    transition: .3s;
}

.mc-header__logo-tagline {
    display: block;
    font-family: var(--mc-font-accent);
    font-size: clamp(12px, 1.6vw, 14px);
    font-weight: 300;
    letter-spacing: .4px;
    opacity: .95;
    line-height: 1.1;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 380px) {
    .mc-header__logo-tagline { display: none; }
}

/* ===== Телефоны (скрыты по умолчанию) ===== */
.mc-header__phones {
    display: none;
}

/* ===== Бургер ===== */
.mc-header__burger {
    display: flex;
    flex: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 6px;
    cursor: pointer;
    color: var(--mc-white);
}

.mc-header__burger span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
}

.mc-header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mc-header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mc-header__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Навигация (выпадающая) ===== */
.mc-header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 8px clamp(12px, 4vw, 20px) 16px;
    background: var(--mc-green);
    border-top: 1px solid rgba(255, 255, 255, .13);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
    font-weight: 500;
    z-index: 10;
    max-height: calc(100dvh - 100%);
    overflow-y: auto;
}

.mc-header__nav.is-open { display: flex; }
.mc-header__nav a {
    padding: clamp(10px, 2.5vw, 14px) 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    white-space: normal;
    transition: .4s;
}
.mc-header__nav a:last-of-type { border-bottom: 0; }
.mc-header__nav a:hover { color: var(--mc-gold); }

/* --- КНОПКИ --- */

/* Кнопка внутри выпадающего меню */
.mc-header__nav .mc-btn {
    display: none;
    justify-content: center;
    width: 100%;
    margin-top: 12px;
}

/* Кнопка для планшета (ваша правка) */
.mc-btn--tablet {
    display: none;
}

/* Кнопка для десктопа */
.mc-btn--header {
    display: none;
}

/* ПРИ ОТКРЫТОМ МЕНЮ (на мобилке): показываем кнопку в меню, прячем остальные */
.mc-header.is-menu-open .mc-header__nav .mc-btn {
    display: inline-flex;
}
.mc-header.is-menu-open .mc-btn--tablet,
.mc-header.is-menu-open .mc-btn--header {
    display: none !important;
}

/* ===== Фокус ===== */
.mc-topbar a:focus-visible,
.mc-header__nav a:focus-visible,
.mc-header__logo:focus-visible,
.mc-header .mc-btn:focus-visible,
.mc-header__burger:focus-visible {
    outline: 2px solid var(--mc-gold);
    outline-offset: 3px;
    border-radius: 2px;
}
.mc-header__nav a:focus:not(:focus-visible) { outline: none; }


/* ============================================
   ПЛАНШЕТ: от 640px
   ============================================ */
@media (min-width: 640px) {
    /* Телефоны между лого и бургером */
    .mc-header__phones {
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: clamp(13px, 2vw, 15px);
        font-weight: 500;
        line-height: 1.2;
        text-align: right;
        margin-left: auto;
        margin-right: clamp(16px, 4vw, 32px);
    }
    .mc-header__phones a {
        color: var(--mc-white);
        text-decoration: none;
        white-space: nowrap;
    }
    .mc-header__phones a:hover { color: var(--mc-gold); }

    /* Кнопка внутри меню на планшете не нужна */
    .mc-header__nav .mc-btn { display: none; }
    .mc-header.is-menu-open .mc-header__nav .mc-btn { display: none; }
}

/* ============================================
   ПЛАНШЕТ+ (ШИРОКИЙ): от 992px
   ============================================ */
@media (min-width: 992px) {
    /* Ваша кнопка для планшета */
    .mc-btn--tablet {
        display: inline-flex;
        min-height: 44px;
        flex: none;
    }
    
    /* Кнопку из меню всё еще не показываем */
    .mc-header.is-menu-open .mc-header__nav .mc-btn { display: none; }
}

/* ============================================
   ДЕСКТОП: от 1200px
   ============================================ */
@media (min-width: 1200px) {
    .mc-topbar { display: block; }
    
    .mc-topbar__inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        min-height: 48px;
        padding-top: 0;
        padding-bottom: 0;
        text-align: left;
    }

    .mc-topbar__contacts {
        flex-direction: row;
        gap: 28px;
    }

    /* Вся шапка в одну строку */
    .mc-header__inner {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: clamp(24px, 4vw, 48px);
        min-height: 80px;
        padding-top: 0;
        padding-bottom: 0;
    }

    /* Обертка исчезает, элементы встают в общий ряд */
    .mc-header__top { display: contents; }

    .mc-header__logo-icon { width: 30px; height: 48px; }
    .mc-header__logo-name { font-size: 26px; }
    .mc-header__logo-tagline { font-size: 15px; }
    
    /* Скрываем лишнее */
    .mc-header__burger { display: none; }
    .mc-header__phones { display: none; }
    .mc-btn--tablet { display: none !important; }
    .mc-header__nav .mc-btn { display: none; }

    /* Навигация в строку */
    .mc-header__nav {
        position: static;
        display: flex;
        flex: 1;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 10px;
        padding: 0;
        border-top: 0;
        box-shadow: none;
        background: transparent;
        max-height: none;
        overflow: visible;
        font-size: 16px;
    }

    .mc-header__nav a {
        border-bottom: 0;
        white-space: nowrap;
    }

    /* Показываем основную кнопку */
    .mc-btn--header {
        display: inline-flex;
        width: auto;
        margin-top: 0;
        order: 2;
        transition: .3s;
    }
}

/* ============================================
   СОСТОЯНИЕ ПРИ СКРОЛЛЕ (.is-scrolled)
   ============================================ */

/* 1. Тень (без псевдокласса sticky, просто при наличии класса) */
.mc-header.is-scrolled {
    box-shadow: 0 10px 40px rgb(55 43 43 / 30%);
    border-bottom: navajowhite;
    background: linear-gradient(180deg, var(--mc-green), #074c45e0);
}

/* 2. Общие правила для уменьшения */
.mc-header.is-scrolled .mc-header__inner {
    padding-top: 8px;
    padding-bottom: 8px;
    transition: .3s;
}

.mc-header.is-scrolled .mc-header__logo-icon {
    width: 24px; /* Уменьшаем иконку */
    height: auto;
}

.mc-header.is-scrolled .mc-header__logo-name {
    font-size: clamp(16px, 2.4vw, 24px);
}

/* 3. Адаптация под планшеты и десктоп */
@media (min-width: 640px) {
    .mc-header.is-scrolled .mc-header__phones {
        font-size: 13px; /* Уменьшаем телефоны */
    }
}

@media (min-width: 992px) {
    .mc-header.is-scrolled .mc-btn--tablet {
        min-height: 36px; /* Уменьшаем кнопку на планшете */
        padding-top: 6px;
        padding-bottom: 6px;
    }
}

@media (min-width: 1200px) {

    .mc-header.is-scrolled .mc-btn--header {
        min-height: 42px; 
    }
    .mc-header.is-scrolled .mc-header__inner {
        min-height: 70px; 
    }
}
/* ===== Меню WordPress (пункты выводятся <li> без обёртки <ul>) ===== */
.mc-header__nav ul,
.mc-header__nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}
