/* =========================================
   Top bar
   ========================================= */

.topbar {
    background: var(--color-navy);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.85rem;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 42px;
}

.topbar__area {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topbar__area .icon {
    width: 15px;
    height: 15px;
    color: var(--color-lime);
}

.topbar__contacts {
    display: flex;
    align-items: center;
    gap: 22px;
}

.topbar__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.82);
    transition: color 0.2s ease;
}

.topbar__link .icon {
    width: 14px;
    height: 14px;
    color: var(--color-lime);
}

.topbar__link strong {
    color: var(--color-white);
    font-weight: 600;
}

.topbar__link:hover {
    color: var(--color-white);
}


/* =========================================
   Navbar
   ========================================= */

.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    transition: box-shadow 0.25s ease;
}

.navbar.is-scrolled {
    box-shadow: 0 8px 24px rgba(10, 31, 68, 0.08);
}

.navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 80px;
}


/* =========================================
   Brand
   ========================================= */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--gradient-brand);
    color: var(--color-white);
    box-shadow: 0 6px 16px rgba(20, 85, 192, 0.3);
}

.brand__mark svg {
    width: 32px;
    height: 32px;
}

.brand__jc {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    font-style: italic;
    line-height: 1;
    letter-spacing: -0.03em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand__words {
    display: flex;
    flex-direction: column;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand__house {
    color: var(--color-text);
}

.brand__doctor {
    color: var(--color-primary);
}

.brand--light .brand__jc {
    background: linear-gradient(135deg, #ffffff 0%, #9cc3ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.brand--light .brand__house {
    color: var(--color-white);
}

.brand--light .brand__doctor {
    color: #9cc3ff;
}


/* =========================================
   Links
   ========================================= */

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

.navbar__links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.navbar__links a {
    display: block;
    padding: 8px 13px;
    border-radius: 999px;
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s ease, background 0.2s ease;
}

.navbar__links a:hover {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}

.navbar__links a.is-active {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}

.navbar__mobile-cta {
    display: none;
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* =========================================
   Mobile menu toggle
   ========================================= */

.navbar__toggle {
    display: none;
    position: relative;
    width: 46px;
    height: 46px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    cursor: pointer;
}

.navbar__toggle-bar {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-text);
    transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}

.navbar__toggle-bar:nth-of-type(2) { top: 15px; }
.navbar__toggle-bar:nth-of-type(3) { top: 21px; }
.navbar__toggle-bar:nth-of-type(4) { top: 27px; }

.navbar.is-open .navbar__toggle-bar:nth-of-type(2) {
    top: 21px;
    transform: rotate(45deg);
}

.navbar.is-open .navbar__toggle-bar:nth-of-type(3) {
    opacity: 0;
}

.navbar.is-open .navbar__toggle-bar:nth-of-type(4) {
    top: 21px;
    transform: rotate(-45deg);
}


/* =========================================
   Breakpoints
   ========================================= */

@media (max-width: 1120px) {
    .navbar__links a {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 980px) {
    .navbar__toggle {
        display: inline-block;
    }

    .navbar__nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        padding: 12px 20px 24px;
        background: var(--color-white);
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 24px 40px rgba(10, 31, 68, 0.14);
    }

    .navbar.is-open .navbar__nav {
        display: block;
    }

    .navbar__links {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .navbar__links a {
        padding: 14px 14px;
        border-radius: var(--radius-md);
        font-size: 1.05rem;
    }

    .navbar__mobile-cta {
        display: grid;
        gap: 10px;
        margin-top: 16px;
        padding-top: 18px;
        border-top: 1px solid var(--color-border);
    }
}

@media (max-width: 760px) {
    .topbar__area,
    .topbar__link--email {
        display: none;
    }

    .topbar__contacts {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .navbar__inner {
        min-height: 68px;
    }

    .navbar__book {
        display: none;
    }

    .brand__mark {
        width: 38px;
        height: 38px;
    }

    .brand__mark svg {
        width: 28px;
        height: 28px;
    }

    .brand__jc {
        font-size: 1.7rem;
    }

    .brand__words {
        font-size: 0.74rem;
    }

    .topbar {
        font-size: 0.8rem;
    }

    .topbar__contacts {
        gap: 16px;
    }
}

@media (max-width: 360px) {
    .topbar__name {
        display: none;
    }
}