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

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

.header-inner,
.header-nav,
.header-actions,
.btn-contact-main,
.btn-contact-phone,
.btn-contact-main-arrow,
.contact-dropdown-item,
.btn-login,
.header-burger {
    display: flex;
    align-items: center;
}

.header-inner {
    max-width: 1344px;
    margin: 0 auto;
    padding: 16px 0;
    justify-content: space-between;
    position: relative;
}

.header-logo img {
    height: 18px;
    width: auto;
    display: block;
}

.header-nav {
    gap: 36px;
}

.header-nav a,
.btn-contact-main,
.contact-dropdown-item,
.btn-login {
    line-height: 100%;
    letter-spacing: -0.03em;
    text-align: center;
}

.header-nav a {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-text);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: var(--purple);
}

.header-actions .contact-dropdown + .btn-contact-phone {
    margin-left: 10px;
}

.header-actions .btn-contact-phone + .btn-login {
    margin-left: 12px;
}

.contact-dropdown {
    position: relative;
    z-index: 30;
}

.btn-contact-main,
.btn-contact-phone {
    background: var(--purple);
    flex-shrink: 0;
}

.btn-contact-main,
.btn-login {
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    z-index: 20;
}

.btn-contact-main {
    gap: 8px;
    color: #fff;
    padding: 16px 19px;
    border-radius: 100px;
    transition: opacity 0.2s;
}

.btn-contact-main:hover {
    opacity: 0.96;
}

.btn-contact-main-arrow {
    transform: translateY(2px);
}

.btn-contact-main-arrow img {
    width: 10px;
    height: 5px;
    object-fit: contain;
}

.btn-contact-phone {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    justify-content: center;
}

.btn-contact-phone .icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.contact-dropdown-menu {
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    background: #f1f2f6;
    border-radius: 0 0 24px 24px;
    padding: 24px 14px 12px;
    box-shadow: 0 18px 40px rgba(27, 16, 48, 0.12);
    display: none;
    z-index: 10;
}

.contact-dropdown.open .contact-dropdown-menu {
    display: block;
}

.contact-dropdown-item {
    gap: 4px;
    text-decoration: none;
    color: var(--dark-text);
    font-size: 12px;
    font-weight: 700;
    padding: 7px 0;
}

.contact-dropdown-item + .contact-dropdown-item {
    border-top: 1px solid var(--grey-border);
    margin-top: 2px;
    padding-top: 10px;
}

.contact-dropdown-item img {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.btn-login {
    padding: 16px 24px;
    border-radius: 1000px;
    transition: background 0.2s;
    background: var(--purple-light);
    color: var(--purple);
}

.btn-login:hover {
    background: #e5d7ff;
}

.header-burger {
    display: none;
    background: var(--purple-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 12px 16px;
    flex-shrink: 0;
}

.burger-icon {
    width: 18px;
    height: 14px;
    display: block;
}

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

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: #fff;
    overscroll-behavior: none;
    overflow-x: hidden;
    padding: 0 0 32px;
    flex-direction: column;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu-topbar,
.mobile-menu-close-btn,
.mobile-menu-actions .btn-contact {
    display: flex;
    align-items: center;
}

.mobile-menu-topbar {
    justify-content: space-between;
    padding: 20px 12px;
    flex-shrink: 0;
}

.mobile-menu-logo img {
    height: 18px;
    display: block;
}

.mobile-menu-close-btn {
    width: 51px;
    height: 38px;
    border-radius: 8px;
    background: var(--grey-bg);
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--dark-text);
    justify-content: center;
    font-family: inherit;
    font-weight: 600;
}

.mobile-menu-card {
    background: var(--grey-bg);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 64px;
    width: calc(100% - 24px);
    margin: 0 auto;
}

.mobile-menu-nav-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-menu-label,
.mobile-menu-contacts a {
    font-size: 16px;
    letter-spacing: -0.03em;
}

.mobile-menu-label {
    font-weight: 600;
    color: var(--grey-60);
}

.mobile-menu-divider {
    height: 1px;
    background: var(--grey-border);
}

.mobile-menu-links,
.mobile-menu-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mobile-menu-links a,
.mobile-menu-contacts a {
    color: #262626;
    text-decoration: none;
    line-height: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.mobile-menu-links a {
    font-size: 22px;
    font-weight: 800;
    width: calc((100% - 25px) / 3);
}

.mobile-menu-contacts a {
    font-weight: 700;
    width: calc((100% - 12px) / 2);
}

.mobile-menu-actions {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.mobile-menu-login {
    display: flex;
    background: #fff;
    color: var(--purple);
    padding: 21px 31.5px;
    border-radius: 100px;
    white-space: normal;
    overflow-wrap: anywhere;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 21px;
    line-height: 100%;
    letter-spacing: -0.03em;
}

.mobile-menu-actions .btn-contact {
    position: relative;
    width: auto;
    height: 63px;
    padding: 0 42px 0 18px;
    border: none;
    border-radius: 100px;
    background: transparent;
    color: #fff;
    text-decoration: none;
    overflow: visible;
    text-align: center;
    font-weight: 800;
    font-size: 21px;
    line-height: 100%;
    letter-spacing: -0.03em;
}

.mobile-menu-actions .btn-contact::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../assets/icons/btn-contact-mob.svg") center / 100% 100% no-repeat;
    z-index: 0;
}

.mobile-menu-actions .btn-contact > * {
    position: relative;
    z-index: 1;
}

.mobile-menu-card .btn-contact-text {
    padding-right: 14px;
}

.mobile-menu-card .btn-contact-phone-wrap {
    width: 42px;
    height: 42px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1344px) {
    .header {
        border-bottom: none;
    }

    .header-burger {
        display: flex;
    }

    .header-inner {
        padding: 20px 12px;
    }

    .header-nav,
    .header-actions .btn-login,
    .header-actions .btn-contact-main,
    .header-actions .btn-contact-phone {
        display: none;
    }

    .mobile-menu-label {
        font-size: 20px;
    }

    .mobile-menu-links {
        gap: 12px 0;
    }

    .mobile-menu-links a {
        font-size: 32px;
    }

    .mobile-menu-nav-group {
        gap: 19px 20px;
    }

    .mobile-menu-contacts a {
        font-size: 32px;
    }

    .mobile-menu-card .btn-contact-text {
        padding-right: 70px;
        padding-left: 26px;
    }

    .mobile-menu-card .btn-contact-phone-wrap {
        width: 84px;
    }
}

@media (max-width: 651px) {
    .header-inner {
        padding: 19px 24px 11px;
    }

    .header-logo img,
    .mobile-menu-logo img {
        height: 14px;
    }

    .header-burger {
        padding: 8px 12px;
    }

    .burger-icon {
        width: 16px;
    }

    .mobile-menu-topbar {
        padding: 19px 24px 11px;
    }

    .mobile-menu-close-btn {
        width: 40px;
        height: 30px;
    }

    .mobile-menu-links a {
        width: calc((100% - 12px) / 2);
    }

    .mobile-menu-actions .btn-contact {
        height: auto;
    }

    .mobile-menu-card .btn-contact-text,
    .mobile-menu-login {
        font-size: 14px;
        text-align: center;
    }

    .mobile-menu-login {
        padding: 14px 21px;
    }

    .mobile-menu-card .btn-contact-text {
        padding-right: 14px;
        padding-left: 0;
    }
}
