/* Стили для шапки */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    display: block;
    height: 32px;
    width: auto;
    transition: opacity 0.2s;
}

.logo img:hover {
    opacity: 0.9;
}

.nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    white-space: nowrap;
    position: relative;
    padding: 4px 0;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.2s ease;
}

.nav a:hover {
    color: var(--accent);
}

.nav a:hover::after {
    width: 100%;
}

.header-contacts {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-self: end;
    flex-wrap: wrap; /* для адаптации */
    justify-content: flex-end;
}

.header-contacts .phone,
.header-contacts .email {
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s;
    white-space: nowrap;
}

.header-contacts .phone:hover,
.header-contacts .email:hover {
    color: var(--accent);
}

.header-contacts .email i {
    margin-right: 4px;
    font-size: 0.9rem;
}

.messengers {
    display: flex;
    gap: 6px;
}

.messengers a {
    color: var(--gray-light);
    font-size: 1.1rem;
    transition: color 0.2s, transform 0.2s;
}

.messengers a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-header {
    background-color: var(--accent);
    color: var(--primary-dark);
    font-weight: 600;
    padding: 6px 20px;
    border-radius: 40px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-header:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 196, 0, 0.3);
}

/* Адаптация шапки */
@media (max-width: 1100px) {
    .header .container {
        gap: 20px;
    }
    .nav {
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .header .container {
        grid-template-columns: 1fr auto;
        gap: 16px;
    }
    .nav {
        order: 3;
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .header {
        height: auto;
        padding: 12px 0;
    }
    .header .container {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 16px;
    }
    .header-contacts {
        justify-self: start;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 12px;
    }
    .nav {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 16px;
    }
    .nav a {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header-contacts .phone,
    .header-contacts .email {
        font-size: 0.9rem;
    }
    .btn-header {
        padding: 4px 12px;
        font-size: 0.8rem;
    }
    .messengers a {
        font-size: 1rem;
    }
}