/* ==========================================================================
   Зимняя тема: голубая шапка и меню
   Подключается только когда активен сезон «Зима» или «До Нового года»
   (themesad_is_winter_theme() в functions.php) и добавляет body.season-winter.
   Сейчас перекрашены шапка, меню, бургер и поиск, а ещё здесь стили зимней сцены
   с персонажами (Дед Мороз, мишки, Снегурочка, ёлка) — см. внизу файла.
   Остальные блоки сайта (кнопки, заголовки, карточки, контакты,
   статистика, новости…) остались с обычными цветами.
   Весь файл можно удалить — сайт вернётся к обычным цветам.
   ========================================================================== */

body.season-winter {
    --w-sky:   #5BB8F5;   /* светлый голубой (начало градиента) */
    --w-blue:  #2F86E0;   /* основной голубой (конец градиента) */
    --w-deep:  #1E6FC2;   /* тёмный голубой: текст и ссылки на белом */
    --w-ice:   #8FD3FF;   /* ледяной: подсветка, ховеры */
    --w-snow:  #E8F5FF;   /* почти белый с голубизной */
    --w-ink:   #0B2545;   /* тёмно-синий текст на голубом фоне */
    --w-grad:      linear-gradient(90deg, #5BB8F5, #2F86E0);
    --w-grad-135:  linear-gradient(135deg, #5BB8F5, #2F86E0);
    --w-grad-soft: linear-gradient(135deg, #8FD3FF, #2F86E0 60%, #1E6FC2);
    --w-shadow:    rgba(47, 134, 224, .35);

    /* Морозный узор в шапке: мелкие снежинки поверх голубого градиента */
    --winter-frost: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='60' viewBox='0 0 360 60'%3E%3Cpath d='M13.0 16.0L23.0 16.0M15.5 11.7L20.5 20.3M20.5 11.7L15.5 20.3' stroke='white' stroke-width='1.3' stroke-linecap='round' opacity='0.55'/%3E%3Cpath d='M58.5 40.0L65.5 40.0M60.2 37.0L63.8 43.0M63.8 37.0L60.2 43.0' stroke='white' stroke-width='1.3' stroke-linecap='round' opacity='0.4'/%3E%3Cpath d='M100.0 12.0L108.0 12.0M102.0 8.5L106.0 15.5M106.0 8.5L102.0 15.5' stroke='white' stroke-width='1.3' stroke-linecap='round' opacity='0.45'/%3E%3Cpath d='M144.0 44.0L156.0 44.0M147.0 38.8L153.0 49.2M153.0 38.8L147.0 49.2' stroke='white' stroke-width='1.3' stroke-linecap='round' opacity='0.55'/%3E%3Cpath d='M192.5 18.0L199.5 18.0M194.2 15.0L197.8 21.0M197.8 15.0L194.2 21.0' stroke='white' stroke-width='1.3' stroke-linecap='round' opacity='0.4'/%3E%3Cpath d='M233.0 38.0L243.0 38.0M235.5 33.7L240.5 42.3M240.5 33.7L235.5 42.3' stroke='white' stroke-width='1.3' stroke-linecap='round' opacity='0.5'/%3E%3Cpath d='M278.0 14.0L286.0 14.0M280.0 10.5L284.0 17.5M284.0 10.5L280.0 17.5' stroke='white' stroke-width='1.3' stroke-linecap='round' opacity='0.45'/%3E%3Cpath d='M322.5 42.0L329.5 42.0M324.2 39.0L327.8 45.0M327.8 39.0L324.2 45.0' stroke='white' stroke-width='1.3' stroke-linecap='round' opacity='0.4'/%3E%3Ccircle cx='40' cy='28' r='1.6' fill='white' opacity='0.5'/%3E%3Ccircle cx='84' cy='50' r='1.3' fill='white' opacity='0.4'/%3E%3Ccircle cx='128' cy='26' r='1.8' fill='white' opacity='0.5'/%3E%3Ccircle cx='176' cy='8' r='1.3' fill='white' opacity='0.4'/%3E%3Ccircle cx='220' cy='52' r='1.6' fill='white' opacity='0.45'/%3E%3Ccircle cx='262' cy='26' r='1.3' fill='white' opacity='0.4'/%3E%3Ccircle cx='304' cy='52' r='1.8' fill='white' opacity='0.5'/%3E%3Ccircle cx='346' cy='24' r='1.5' fill='white' opacity='0.45'/%3E%3C/svg%3E");
}

/* ---------- Шапка сайта ---------- */
body.season-winter {
    /* Единый голубой градиент шапки; --w-bar-edge — на каких отступах от центра
       страницы он начинается и заканчивается (половина ширины меню: 1200px / 2) */
    --w-bar-edge: 600px;
    --w-bar-bg: var(--winter-frost, none) repeat-x center / auto 100%,
                linear-gradient(90deg, #5BB8F5 calc(50% - var(--w-bar-edge)), #2F86E0 calc(50% + var(--w-bar-edge)));
}

/* Меню на 1200px: тот же градиент, что и у полосы за ним, поэтому стыков нет */
body.season-winter .nav-bar .container,
body.season-winter .nav-bar .container.fixed {
    background: var(--winter-frost, none) repeat-x center / auto 100%, linear-gradient(90deg, #5BB8F5, #2F86E0) !important;
}
body.season-winter .nav-bar .container {
    box-shadow: 0 8px 22px -10px var(--w-shadow);
    transition: max-width .3s ease, border-radius .3s ease, box-shadow .35s ease;
}
body.season-winter .nav-bar .container.fixed {
    box-shadow: none;
}

/* Компьютер: при прокрутке на всю ширину экрана выезжает полоса.
   Она растянута так, что на краях меню цвет совпадает с цветом меню
   (светлый слева, тёмный справа), а за пределами меню остаётся ровным.
   Появляется плавно (opacity), а не рывком. */
@media (min-width: 768px) {
    body.season-winter .top-bar:not(.fixed) { position: relative; }
    body.season-winter .top-bar { isolation: isolate; }
    body.season-winter .top-bar::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--w-bar-bg);
        opacity: 0;
        transition: opacity .35s ease;
        pointer-events: none;
    }
    body.season-winter .top-bar.fixed {
        background: transparent !important;
        box-shadow: 0 10px 26px -10px rgba(30, 111, 194, .55);
        transition: box-shadow .35s ease, transform .3s ease;
    }
    body.season-winter .top-bar.fixed::before { opacity: 1; }
}

body.season-winter .nav-bar a,
body.season-winter .nav-bar a:hover {
    color: #fff;
    text-shadow: 0 1px 3px rgba(11, 37, 69, .35);
}

/* Телефон, адрес и значки на голубой плашке читаются лучше */
body.season-winter .top-bar.fixed .location,
body.season-winter .top-bar.fixed .location span,
body.season-winter .top-bar.fixed .phone a,
body.season-winter .top-bar.fixed .phone-numbers,
body.season-winter .top-bar.fixed .phone-numbers a {
    color: var(--w-ink);
}
body.season-winter .top-bar.fixed .phone i,
body.season-winter .top-bar.fixed .phone-numbers i {
    color: #fff;
}
body.season-winter .phone-numbers i,
body.season-winter .phone i { color: var(--w-blue); }
body.season-winter .phone a:hover,
body.season-winter .phone-numbers span a:hover { color: var(--w-blue); }

/* Кнопка меню (бургер) */
body.season-winter .menu-btn {
    background: var(--w-grad-135);
    color: #fff;
    box-shadow: 0 6px 14px -6px var(--w-shadow);
}
body.season-winter .menu-btn:hover {
    background: #fff;
    color: var(--w-blue);
}

/* Мобильная шапка (на телефоне была жёлтая #ffe509 !important) */
@media (max-width: 767px) {
    body.season-winter .top-bar {
        background: var(--winter-frost, none) repeat-x center / auto 100%, linear-gradient(90deg, #5BB8F5, #2F86E0) !important;
        box-shadow: 0 6px 18px -8px rgba(30, 111, 194, .55);
    }
    body.season-winter .top-bar .location,
    body.season-winter .top-bar .location span,
    body.season-winter .top-bar .phone a,
    body.season-winter .top-bar .phone-numbers,
    body.season-winter .top-bar .phone-numbers a { color: var(--w-ink); }
    body.season-winter .top-bar .phone i,
    body.season-winter .top-bar .phone-numbers i { color: #fff; }
    body.season-winter .menu-btn { background: #fff; color: var(--w-blue); }
    body.season-winter .menu-btn:hover { background: var(--w-ice); color: #fff; }
}

/* ---------- Поиск ---------- */
body.season-winter .search-btn:hover,
body.season-winter .search-form .submit-search:hover,
body.season-winter .search-form .close-search:hover { color: var(--w-ice); }
body.season-winter .live-search-results { scrollbar-color: var(--w-blue) transparent; }
body.season-winter .live-search-results::-webkit-scrollbar-thumb { background: var(--w-blue); }
body.season-winter .live-search-results::-webkit-scrollbar-thumb:hover { background: var(--w-ice); }
body.season-winter .live-search-results .lsr-more { color: var(--w-deep); }

/* ---------- Уважение к настройкам пользователя ---------- */
@media (prefers-reduced-motion: reduce) {
    body.season-winter .nav-bar .container,
    body.season-winter .top-bar { transition: none; }
}

/* ==========================================================================
   Зимняя сцена: персонажи по краям экрана (разметка — в header.php)
   Контент сайта по центру (max-width 1200px), поэтому герои стоят только
   в боковых полях и масштабируются от ширины этих полей:
     от 1500px — Дед Мороз слева и ёлка справа
     от 1700px — ещё мишки со снеговиком и Снегурочка
   На экранах уже 1500px сцена скрыта, чтобы не мешать контенту.
   ========================================================================== */
.winter-scene {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    /* «единица» размера: от высоты экрана, но не шире бокового поля */
    --wu: clamp(5px, min(1vh, calc((100vw - 1200px) / 84)), 13px);
}
.ws { position: absolute; bottom: 0; }
.ws img {
    display: block;
    width: auto;
    height: 100%;
    transform-origin: 50% 100%;
    -webkit-user-drag: none;
    user-select: none;
}
.ws--bears, .ws--sneg { display: none; }

/* Слева: Дед Мороз (опущен на 20% вниз) и мишки со снеговиком чуть правее */
.ws--moroz { left: calc(var(--wu) * -1);  height: calc(var(--wu) * 26); transform: translateY(20%); z-index: 3; }
.ws--bears { left: calc(var(--wu) * 23);  height: calc(var(--wu) * 14); bottom: calc(var(--wu) * -.5); z-index: 4; }
/* Справа: ёлка у края (опущена на 10% вниз), Снегурочка слева от ёлки */
.ws--tree  { right: calc(var(--wu) * -1 + 10px); height: calc(var(--wu) * 31); bottom: 0; transform: translateY(10%); z-index: 3; }
.ws--sneg  { right: calc(var(--wu) * 21.5); height: calc(var(--wu) * 20); bottom: calc(var(--wu) * -1); z-index: 4; }

/* Огоньки на ёлке */
.ws-lt {
    position: absolute;
    width: 6%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(#fff 8%, #ffd56a 35%, rgba(255, 190, 60, 0) 70%);
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    animation: ws-tw 2.2s ease-in-out infinite;
}
@keyframes ws-tw { 0%, 100% { opacity: .15; scale: .6; } 50% { opacity: 1; scale: 1.25; } }

/* Лёгкое «дыхание» героев */
@keyframes ws-sway    { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes ws-breathe { 0%, 100% { transform: scale(1, 1); }     50% { transform: scale(1.012, 1.022); } }
.ws--moroz img { animation: ws-sway 6s ease-in-out infinite; }
.ws--sneg  img { animation: ws-sway 6.5s ease-in-out -2s infinite; }
.ws--tree  img { animation: ws-breathe 4s ease-in-out infinite; }
.ws--bears img { animation: ws-breathe 4.5s ease-in-out -1s infinite; }

/* Ночью персонажи чуть темнее */
body.night-mode .ws img { filter: brightness(.82) saturate(.95); }

@media (min-width: 1500px) { .winter-scene { display: block; } }
@media (min-width: 1700px) { .ws--bears, .ws--sneg { display: block; } }

@media (prefers-reduced-motion: reduce) {
    .ws img, .ws-lt { animation: none; }
}
