/* =========================
   BASE
========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111;
    background: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================
   HEADER
========================= */

.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar {
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #22d3ee);
}

.header-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* =========================
   BRAND
========================= */

.header-brand,
.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-logo {
    max-height: 30px;
    width: auto;
}

.site-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

/* =========================
   DESKTOP MENU
========================= */

.desktop-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-menu {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-menu li a {
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.header-menu li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: #2563eb;
    transition: width .25s ease;
}

.header-menu li a:hover::after {
    width: 100%;
}

/* =========================
   HEADER BUTTON
========================= */

.header-action {
    display: flex;
    align-items: center;
}

.header-button {
    padding: 8px 16px;
    background: #2563eb;
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: background .2s ease;
}

.header-button:hover {
    background: #1e4ed8;
}

/* =========================
   BURGER
========================= */

.burger {
    display: none;
    width: 32px;
    height: 32px;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 110;
}

.burger span {
    position: absolute;
    left: 4px;
    width: 24px;
    height: 2px;
    background: #111;
    transition: .3s ease;
}

.burger span:nth-child(1) { top: 8px; }
.burger span:nth-child(2) { top: 15px; }
.burger span:nth-child(3) { top: 22px; }

/* BURGER → X */

.burger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 15px;
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 15px;
}

/* =========================
   OFFCANVAS MOBILE MENU
========================= */

.mobile-nav {
    position: fixed;
    top: 0;
    bottom: 0; /* растягиваем меню по всей видимой высоте */
    left: 0;
    width: 260px;
    background: #fff;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column; /* важно для кнопки снизу */
    padding: 80px 20px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav .header-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav .header-menu li a {
    font-size: 16px;
}

/* =========================
   MOBILE MENU BOTTOM BUTTON
========================= */

.mobile-nav-bottom {
    margin-top: auto; /* кнопка всегда прижата к низу */
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: linear-gradient(to top, rgba(255,255,255,0.98), rgba(255,255,255,0.85));
}

.mobile-subscribe-btn {
    display: block;
    width: 100%;
    padding: 14px 16px;
    text-align: center;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    transition: background .2s ease;
}

.mobile-subscribe-btn:hover {
    background: #1e4ed8;
}

/* =========================
   OVERLAY
========================= */

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 90;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* BLOCK SCROLL WHEN MENU OPEN */

body.menu-open {
    overflow: hidden;
}

/* =========================
   MOBILE STYLES
========================= */

@media (max-width: 768px) {

    .desktop-nav,
    .header-action {
        display: none;
    }

    .burger {
        display: block;
    }
}

/* =========================
   DESKTOP ONLY
========================= */

@media (min-width: 769px) {

    .desktop-nav {
        display: flex;
    }

    .mobile-nav,
    .menu-overlay,
    .burger,
    .mobile-nav-bottom {
        display: none;
    }
}

/* =========================
   FOOTER
========================= */

.site-footer {
    margin-top: 64px;
    background: #fff;
}

/* Разделители */
.footer-divider {
    height: 1px;
    background: #e5e7eb;
    width: 100%;
}

/* Общий контейнер */
.site-footer .site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* =========================
   FOOTER MENU
========================= */

.footer-inner {
    display: flex;
    justify-content: center;
}

.footer-menu {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu li a {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.footer-menu li a:hover {
    color: #2563eb;
}

/* =========================
   FOOTER EXTRA (2 строки)
========================= */

.footer-extra {
    padding: 16px 0;
}

.footer-extra-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.footer-extra-left,
.footer-extra-right {
    font-size: 14px;
    color: #374151;
}

.footer-extra-right {
    text-align: right;
}

/* Иконки */
.footer-extra-center {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.footer-icon {
    font-size: 18px;
    line-height: 1;
}

/* =========================
   FOOTER BOTTOM
========================= */

.footer-bottom {
    padding: 12px 0;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

/* =========================
   MOBILE FOOTER
========================= */

@media (max-width: 768px) {

    .footer-menu {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px 16px;
    }

    .footer-extra-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .footer-extra-left,
    .footer-extra-right {
        text-align: center;
        width: 100%;
    }

    .footer-extra-center {
        justify-content: center;
        flex-wrap: wrap;
    }
}