/* ========================================================================== 
   HEADER & NAVIGATION
   Single source of truth for the public-site header.
   Loaded after styles.css while the legacy rules are removed incrementally.
   ========================================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: 42px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: header-slide-down 0.5s ease;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    user-select: none;
}

.header.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

@keyframes header-slide-down {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.header,
.navbar {
    overflow: visible;
}

.nav-content,
.header.scrolled .nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    height: 42px;
    padding: 0 1rem;
}

.logo {
    position: relative;
    z-index: 2;
    height: 42px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 0.8rem;
    overflow: visible;
}

.logo-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding-left: 98px;
    text-decoration: none;
    white-space: nowrap;
    overflow: visible;
}

.logo-img,
.header.scrolled .logo-img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 96px;
    height: 96px;
    margin: 0;
    object-fit: contain;
    opacity: 1;
    transform: none;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22));
}

.logo-text {
    font-family: 'Pacifico', cursive;
    font-size: 1.12rem;
    line-height: 1;
    color: var(--purple-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    min-width: 0;
    gap: clamp(0.5rem, 1vw, 1.2rem);
    margin: 0;
    padding: 0;
    flex-shrink: 1;
}

.nav-link,
.nav-item {
    position: relative;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-link::after,
.nav-item::after {
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 3px;
    content: '';
    background: linear-gradient(90deg, var(--primary-color), var(--purple-color));
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-item:hover { color: var(--primary-color); }
.nav-link:hover::after,
.nav-item:hover::after { width: 100%; }

.nav-link-new-year,
.nav-item-new-year {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.95rem;
    color: #fff;
    font-weight: 700;
    font-size: 0.86rem;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    background-size: 400% 400%;
    border-radius: 25px;
    animation: shimmer 3s ease-in-out infinite;
    transform: none;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nav-link-new-year:hover,
.nav-item-new-year:hover {
    color: #fff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.38);
}

.nav-link-new-year::after,
.nav-item-new-year::after { display: none; }

.mobile-holiday-btn {
    display: none;
}

.nav-location-badge {
    display: none;
}

.header-contacts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 0.8rem;
}

.header-phone {
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    margin-right: 0.3rem;
}

.whatsapp-btn-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: .45rem 1rem;
    border-radius: 999px;
    background: #25d366;
    color: #fff;
    font-size: .84rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(37, 211, 102, .3);
    transition: transform .25s ease, box-shadow .25s ease;
    transform: translateY(8px);
}

.whatsapp-btn-header:hover {
    color: #fff;
    transform: translateY(6px) scale(1.05);
    box-shadow: 0 9px 22px rgba(37, 211, 102, .4);
}

.header-messengers {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    position: relative;
    z-index: 10;
}

.header-messenger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    transform: translateY(12px);
}

.header-messenger:hover {
    color: #fff;
    transform: translateY(9px) scale(1.14);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.header-messenger svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.header-messenger-max svg {
    width: 23px;
    height: 23px;
}

.header-messenger-whatsapp { background: #25d366; }
.header-messenger-vk { background: #0077ff; }
.header-messenger-telegram { background: #229ed9; }
.header-messenger-max { background: linear-gradient(135deg, #4f46e5, #8b5cf6); }
.header-messenger.is-placeholder { cursor: default; opacity: 0.78; }
.header-messenger.is-placeholder:hover { transform: translateY(12px); }

.mobile-menu-btn {
    display: none !important;
    padding: 0;
    color: var(--text-dark);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

@media (max-width: 1250px) {
    .header-phone { display: none; }
}

@media (max-width: 900px) {
    .header {
        height: 60px;
    }

    .nav-content,
    .header.scrolled .nav-content {
        display: flex;
        min-height: 60px;
        height: 60px;
        gap: 8px;
    }

    .logo,
    .logo-link { height: 60px; }
    .logo {
        min-width: 0;
        margin-right: 0;
    }
    .logo-link { padding-left: 72px; }

    .logo-img,
    .header.scrolled .logo-img {
        top: 0;
        left: -12px;
        width: 82px;
        height: 82px;
        transition: transform 0.3s ease;
    }

    .header.header-hidden .logo-img {
        transform: translateY(60px);
    }

    .logo-text { font-size: 0.94rem; }

    .header-contacts {
        display: none;
    }

    .mobile-holiday-btn {
        position: relative;
        z-index: 6;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 36px;
        padding: 0.38rem 0.78rem;
        margin-left: auto;
        flex: 0 0 auto;
        color: #fff;
        font-size: 0.76rem;
        font-weight: 800;
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;
        background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--secondary-color));
        background-size: 400% 400%;
        border: 2px solid rgba(255, 255, 255, 0.8);
        border-radius: 999px;
        box-shadow: 0 5px 16px rgba(124, 58, 237, 0.3);
        animation: shimmer 3s ease-in-out infinite;
    }

    .nav-menu:not(.active) { display: none; }

    .header .nav-menu.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        padding: 1rem;
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
    }

    .header .nav-menu.active .nav-link-new-year,
    .header .nav-menu.active .nav-item-new-year {
        display: none;
    }

    .header-messenger {
        width: 36px;
        height: 36px;
    }

    .header-messenger svg {
        width: 17px;
        height: 17px;
    }

    .mobile-menu-btn {
        display: inline-flex !important;
        margin-left: 0;
        flex: 0 0 44px;
    }
}

@media (max-width: 370px) {
    .logo-text { display: none; }
    .logo-link { width: 72px; padding-left: 72px; }
}

/* Pause holiday button animations & hide particles when header is scrolled off-screen */
.header.header-hidden .mobile-holiday-btn,
.header.header-hidden .holiday-header-btn,
.header.header-hidden .button-snowflake {
    animation-play-state: paused !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
