/* =============================================================
   ОБЩИЕ КОМПОНЕНТЫ: шапка, навигация, кнопки, футер, секции.
   Используется на всех страницах сайта.
   ============================================================= */

/* ------------------------------------------------------------
   Кнопки
   ------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    font-size: var(--fs-body);
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--dur) var(--ease),
                border-color var(--dur) var(--ease),
                color var(--dur) var(--ease),
                transform var(--dur-fast) var(--ease),
                box-shadow var(--dur) var(--ease);
    /* Комфортная зона нажатия на тач-экранах */
    min-height: 44px;
}

.btn:active {
    transform: translateY(1px);
}

.btn--sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--fs-small);
    min-height: 38px;
}

.btn--lg {
    padding: var(--space-4) var(--space-7);
    font-size: var(--fs-lead);
    min-height: 54px;
}

.btn--primary {
    background: var(--brand-blue);
    color: var(--white);
    box-shadow: var(--shadow-blue);
}

.btn--primary:hover {
    background: var(--brand-blue-600);
    color: var(--white);
}

.btn--light {
    background: var(--white);
    color: var(--brand-blue-700);
    box-shadow: var(--shadow-md);
}

.btn--light:hover {
    background: var(--brand-blue-050);
    color: var(--brand-blue-700);
}

.btn--outline {
    background: transparent;
    border-color: currentColor;
    color: var(--white);
}

.btn--outline:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.55);
    color: var(--white);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.24);
    color: var(--white);
}

/* ------------------------------------------------------------
   Шапка
   ------------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--brand-blue);
    color: var(--white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.site-header__inner {
    position: relative;
    max-width: var(--shell-max);
    margin-inline: auto;
    padding-inline: var(--shell-pad);
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.site-header__brand img {
    height: clamp(34px, 30px + 1vw, 46px);
    width: auto;
    object-fit: contain;
}

/* --- Гамбургер (только на узких экранах) --- */

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 9px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.12);
}

.nav-toggle__bar {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--white);
    border-radius: 2px;
    transition: transform var(--dur) var(--ease), opacity var(--dur-fast) var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Навигация --- */

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(var(--space-4), 1.6vw, var(--space-6));
    flex: 1 1 auto;
}

.site-nav__links {
    display: flex;
    align-items: center;
    gap: clamp(var(--space-3), 1.4vw, var(--space-5));
    margin: 0;
}

.site-nav__links a {
    color: var(--white);
    font-size: var(--fs-small);
    font-weight: var(--fw-semibold);
    line-height: 1.4;
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
    transition: border-color var(--dur) var(--ease), opacity var(--dur-fast) var(--ease);
}

.site-nav__links a:hover {
    color: var(--white);
    border-bottom-color: var(--brand-yellow);
}

.site-nav__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 0 0 auto;
}

/* --- Переключатель языка --- */

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.14);
    font-family: var(--font-display);
    font-size: var(--fs-tiny);
    font-weight: var(--fw-bold);
}

.lang-switcher__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 28px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-pill);
    color: var(--white);
    opacity: 0.75;
    transition: background var(--dur) var(--ease), opacity var(--dur-fast) var(--ease);
}

.lang-switcher__link:hover {
    color: var(--white);
    opacity: 1;
}

.lang-switcher__link.is-active {
    background: var(--white);
    color: var(--brand-blue-700);
    opacity: 1;
}

/* --- Мобильная раскладка шапки --- */

@media (max-width: 899px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
        padding: var(--space-5) var(--shell-pad) var(--space-6);
        background: var(--brand-blue-600);
        box-shadow: var(--shadow-lg);
        /* Меню не должно уезжать за экран на маленьких телефонах */
        max-height: calc(100dvh - var(--header-h));
        overflow-y: auto;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav__links {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    /* display: block — иначе разделитель обрывается по ширине текста ссылки */
    .site-nav__links a {
        display: block;
        padding: var(--space-3) 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.18);
        font-size: var(--fs-body);
    }

    .site-nav__links li:last-child a {
        border-bottom: none;
    }

    .site-nav__links a:hover {
        border-bottom-color: var(--brand-yellow);
    }

    .site-nav__actions {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: var(--space-4);
        padding-top: var(--space-2);
    }
}

/* ------------------------------------------------------------
   Секции: общие примитивы
   ------------------------------------------------------------ */

.section {
    padding-block: var(--section-pad);
    background: var(--bg);
}

.section--muted {
    background: var(--bg-muted);
}

.section__head {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 46rem;
    margin-bottom: var(--space-8);
}

.section__head--center {
    margin-inline: auto;
    text-align: center;
    align-items: center;
}

.section__title {
    font-size: var(--fs-h2);
    letter-spacing: -0.01em;
}

.section__title--invert {
    color: var(--white);
}

.section__lead {
    font-size: var(--fs-lead);
    color: var(--text-soft);
    max-width: 60ch;
}

.section__lead--invert {
    color: rgba(255, 255, 255, 0.88);
}

/* ------------------------------------------------------------
   Футер
   ------------------------------------------------------------ */

.site-footer {
    background: var(--brand-blue-900);
    color: var(--white);
    padding-block: var(--space-9) var(--space-6);
}

.site-footer__inner {
    max-width: var(--shell-max);
    margin-inline: auto;
    padding-inline: var(--shell-pad);
    display: grid;
    gap: var(--space-7);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.site-footer__brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.site-footer__logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    margin-bottom: var(--space-4);
    /* Логотип цветной — на тёмном фоне выводим его белым */
    filter: brightness(0) invert(1);
}

.site-footer__tagline {
    color: rgba(255, 255, 255, 0.75);
    font-size: var(--fs-small);
    max-width: 30ch;
}

.site-footer__heading {
    font-size: var(--fs-body);
    font-weight: var(--fw-bold);
    color: var(--brand-yellow);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.site-footer__col .site-footer__heading + .site-footer__list + .site-footer__heading {
    margin-top: var(--space-5);
}

.site-footer__address,
.site-footer__list {
    display: grid;
    gap: var(--space-3);
    font-size: var(--fs-small);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.55;
}

.site-footer__address strong {
    color: var(--white);
    font-weight: var(--fw-bold);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 3px;
    /* Длинная почта не должна распирать колонку */
    overflow-wrap: anywhere;
}

.site-footer a:hover {
    color: var(--white);
    text-decoration-color: var(--brand-yellow);
}

.site-footer__legal {
    max-width: var(--shell-max);
    margin-inline: auto;
    padding-inline: var(--shell-pad);
    margin-top: var(--space-8);
    padding-top: var(--space-5);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: var(--fs-tiny);
    color: rgba(255, 255, 255, 0.6);
}
