/* header.css — стили для header.php */

* {
    box-sizing: border-box;
}

/* Основные блоки */
.header {
    
    display: flex;
    align-items: center;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: url('/images/header_background.svg') no-repeat center / cover #17191a;
    border-bottom: none;
    z-index: 10;
}

.header__inner {
    display: flex;
    
    justify-content: space-around;
    align-items: center;
}


.logo {
    width: 50px;
    height: 50px;
    margin-left: 40px;
    background: url('/images/logo_mini.svg') no-repeat center / auto 100%;
}

.nav {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: nowrap;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    width: 85%;
}

/* Бургер */
.burger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.burger span {
    display: block;
    width: 25px;
    height: 3px;
    background: #2C3E50;
    border-radius: 2px;
    transition: 0.3s;
}

/* Навигационные ссылки */
.nav__link {
    color: #2C3E50;
    font-weight: 500;
    transition: color 0.3s;
}

.nav__link:hover {
    color: #1A5276;
}

.nav__link,
.nav__user-menu {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Корзина */
.nav__link_cart {
    margin-right: 10px;
    display: flex;
    justify-content: space-between;
    gap: 5px;
    position: relative;
    flex-shrink: 0;
    padding: 8px 0;
}

.cart-count {
    position: absolute;
    bottom: 0px;
    right: -5px;
    background: #495458;
    color: #1D1D1B;
    font-size: 12px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #F8FCFE;
    line-height: 1;
}

.icon_cart {
    display: block;
    width: 24px;
    height: 24px;
    background-color: #2C3E50;
    mask-image: url('/images/icons/icon_cart.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
}

/* Контакты */
.header__contacts {
    display: flex;
    align-items: center;
}

.header__phone {
    color: #2C3E50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.header__phone:hover {
    color: #1A5276;
}

.icon_phone {
    background-color: #2C3E50;
    mask-image: url('/images/icons/icon_phone.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
}

.callback-btn {
    margin-left: 10px;
    padding: 8px 16px;
    background: #A7E7FE;
    color: #1D1D1B;
    font-weight: 500;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.callback-btn:hover {
    background: #8FD8F0;
}

/* Кнопка входа */
.login-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2C3E50;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
    padding: 8px 16px;
    border-radius: 4px;
}

.login-link:hover {
    color: #1A5276;
    background-color: #f5f5f5;
}

.nav__link_login {
    display: flex;
    align-items: center;
}

.nav__link_logout {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.icon_login {
    background-color: #2C3E50;
    mask-image: url('/images/icons/icon_login.svg');
    mask-size: 150%;
    mask-repeat: no-repeat;
    width: 24px;
    height: 24px;
    margin-right: 5px;
}

/* Меню пользователя */
.nav__user-menu {
    position: relative;
    display: inline-block;
}

.nav__user-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 4px;
    color: #2C3E50;
    font-weight: 500;
    transition: all 0.3s;
}

.nav__user-button:hover {
    background-color: #f5f5f5;
    color: #1A5276;
}

.icon_user {
    mask-image: url('/images/icons/icon_user.svg');
    background-color: #1D1D1B;
}

.icon_arrow-down {
    background-color: #2C3E50;
    mask-image: url('/images/icons/icon_arrow-down.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    width: 16px;
    height: 16px;
    transition: background-color 0.3s;
}

.nav__user-button:hover .icon_arrow-down {
    background-color: #1A5276;
}

.nav__dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 150px;
    background: #F8FCFE;
    border: 1px solid #E1F5FE;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 8px 0;
}

.nav__dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #2C3E50;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s;
    text-decoration: none;
}

.nav__dropdown a:hover {
    background-color: #f5f5f5;
    color: #1A5276;
}

.nav__dropdown .icon {
    width: 20px;
    height: 20px;
    background-color: #2C3E50;
    mask-size: contain;
    mask-repeat: no-repeat;
    flex-shrink: 0;
}

.nav__dropdown a:hover .icon {
    background-color: #1A5276;
}

.icon_profile {
    mask-image: url('/images/icons/icon_profile.svg');
}

.icon_settings {
    mask-image: url('/images/icons/icon_settings.svg');
}

.icon_logout {
    mask-image: url('/images/icons/icon_logout.svg');
}

.order-btn {
    padding: 10px 20px;
    background: #4d5053;
    color: #c9c9c5;
    font-weight: 500;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
}

.order-btn:hover {
    background: #8FD8F0;
}

.required {
    color: #ff4444;
    margin-left: 3px;
}

/* Адаптив */
@media (max-width: 768px) {
    .header__inner {
        justify-content: space-between;
    }

    .nav-container {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #F8FCFE;
        flex-direction: column;
        padding: 80px 30px 30px;
        transition: right 0.3s ease;
        z-index: 999;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .nav-container.active {
        right: 0;
    }

    .nav {
        flex-direction: column;
        gap: 20px;
    }

    .burger {
        display: flex;
        position: relative;
        z-index: 1000;
    }

    .header__contacts {
        margin-top: 30px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header__phone {
        font-size: 18px;
        pointer-events: auto;
    }

    .callback-btn {
        width: 100%;
    }

    .header__inner>.header__contacts {
        display: none;
    }

    .nav__dropdown {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 20px;
        margin-top: 5px;
    }

    .login-link span {
        display: none;
    }

    .login-link {
        padding: 8px;
    }
}

/* Для десктопов телефон некликабельный */
@media (min-width: 769px) {
    .header__phone[href^="tel:"] {
        pointer-events: none;
        cursor: default;
    }
}

@media (min-width: 770px) {

    .header .nav__link,
    .header .nav__user-button,
    .header .callback-btn,
    .header .icon_cart,
    .header .icon_login,
    .header .icon_user,
    .header .icon_arrow-down,
    .header .cart-count {
        color: #E0E0E0;
    }

    .header .icon_cart,
    .header .icon_login,
    .header .icon_user,
    .header .icon_arrow-down {
        background-color: #E0E0E0;
    }

    .header .callback-btn {
        background: rgba(255, 255, 255, 0.15);
        color: #E0E0E0;
    }

    .header .burger span {
        background: #E0E0E0;
    }
}