/*
 * Bulvar Mall — фирменные элементы сайта (ребрендинг, этап 2).
 * Подключается последним (base.html), поэтому перекрывает старые правила без правок по месту.
 * Основа светлая, без чёрных плоскостей; графит — только текст; акценты — фирменные цвета.
 */

/* явный светлый фон: без него прозрачный холст в некоторых браузерах/вебвью тёмный.
   Именно на body, не на html: фон body тогда уходит на холст, и декор с z-index: -1 остаётся виден */
body {
    background-color: #FFFFFF;
}

/* ---- цвет раздела: Магазины — фиолетовый, Еда — оранжевый, Развлечения — зелёный, Услуги и банки — голубой ---- */
:root,
[data-section] {
    --section: var(--brand-purple);
    --section-ink: #FFFFFF; /* текст на заливке цветом раздела */
    --section-tint: var(--brand-purple-light);
}

[data-section="food-court"] {
    --section: var(--brand-orange);
    --section-ink: var(--brand-graphite);
    --section-tint: #FDEDE7;
}

[data-section="entertaiment"] {
    --section: var(--brand-green);
    --section-ink: var(--brand-graphite);
    --section-tint: #F0F8E6;
}

[data-section="services"],
[data-section="banks"] {
    --section: var(--brand-blue);
    --section-ink: var(--brand-graphite);
    --section-tint: #E5F5FC;
}

/* ---- шапка страницы: белые плоскости со срезом 22,5° на сером фоне и полоса цвета раздела (вместо старого паттерна) ---- */
.template-page__header::before,
.template-page__header::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    z-index: -1;
    width: 560px;
    max-width: 62%;
    height: 160px;
    transform: translateY(-50%);
    pointer-events: none;
}

.template-page__header::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 160'%3E%3Cpath fill='%23FFFFFF' d='M110 0L180 0L246.3 160L176.3 160Z'/%3E%3Cpath fill='%23FFFFFF' d='M232 0L493 0L559.3 160L298.3 160Z'/%3E%3C/svg%3E") right center / contain no-repeat;
}

/* на белых страницах (услуги, мероприятия, схема) плоскости светло-серые */
body:not(.template-page-bg) .template-page__header::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 160'%3E%3Cpath fill='%23F4F4F5' d='M110 0L180 0L246.3 160L176.3 160Z'/%3E%3Cpath fill='%23F4F4F5' d='M232 0L493 0L559.3 160L298.3 160Z'/%3E%3C/svg%3E");
}

.template-page__header::before {
    z-index: 0;
    background: var(--section);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 160'%3E%3Cpath d='M200 0L212 0L278.3 160L266.3 160Z'/%3E%3C/svg%3E") right center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 160'%3E%3Cpath d='M200 0L212 0L278.3 160L266.3 160Z'/%3E%3C/svg%3E") right center / contain no-repeat;
}

/* заголовок поверх декора */
.template-page__header > * {
    position: relative;
    z-index: 1;
}

/* ---- главная, «Мероприятия»: паттерн непрозрачный, поэтому уводим его под контент и к правому краю (под фото слайда) ---- */
.events-animated .pattern {
    left: auto;
    right: 0;
    z-index: 0;
    width: min(1104px, 100%);
    height: auto;
    pointer-events: none;
}

.events-animated__top,
.events-animated__slider-container {
    position: relative;
    z-index: 1;
}

/* карточки услуг: при наведении оттенок раздела вместо полупрозрачности */
.services__card {
    transition: background-color 0.3s;
}

.services__card:hover {
    opacity: 1;
    background: var(--section-tint);
}

/* стрелка в кнопках чуть сдвигается при наведении */
.btn i {
    transition: translate 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn:hover i {
    translate: 4px 0;
}

/* поиск — в тон кнопкам */
.search-field {
    border-radius: var(--radius);
}

/* ---- кнопки: строже, меньше скругление ---- */
.btn,
.btn.btn-primary {
    border-radius: var(--radius);
}

/* ---- фильтры категорий: параллелограммы со срезом 22,5°, активный — цветом раздела ---- */
.filters__btn {
    padding: 0 30px;
    border: 0;
    border-radius: 0;
    color: var(--text);
    background: #E7E7EA linear-gradient(#FFFFFF, #FFFFFF) no-repeat 0 0 / 0 100%; /* наведение — белая заливка слева */
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 100%, 20px 100%);
    transition: background-size 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s, color 0.2s, scale 0.15s;
}

.filters__btn:hover {
    background-size: 100% 100%;
}

.filters__btn:active {
    scale: 0.96;
}

.filters__btn.active {
    color: #FFFFFF;
    font-weight: 600;
    background: var(--section);
}

.filters__btn.active::before {
    content: none;
}

/* ---- отступ перед футером на внутренних страницах (кроме полноэкранной схемы ТЦ) ---- */
.template-page:not(.scheme-page--map) {
    padding-bottom: 96px;
}

@media screen and (max-width: 768px) {
    .template-page:not(.scheme-page--map) {
        padding-bottom: 48px;
    }
}

/* ---- футер: светлый, полоса из четырёх фирменных цветов, логотип ---- */
.footer {
    background: var(--template-page-bg);
    border-top: 4px solid transparent;
    border-image: linear-gradient(90deg,
            var(--brand-green) 0 25%,
            var(--brand-blue) 25% 50%,
            var(--brand-orange) 50% 75%,
            var(--brand-purple) 75% 100%) 1;
}

.footer__logo {
    display: block;
    align-self: flex-start;
    width: auto;
    height: 56px;
}

@media screen and (max-width: 768px) {
    /* на телефоне заголовок занимает всю ширину — декор только мешал бы; остаётся косая черта у заголовка */
    .template-page__header::before,
    .template-page__header::after {
        display: none;
    }

    .filters__btn {
        padding: 0 24px;
        clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 100%, 16px 100%);
    }

    .footer__logo {
        height: 48px;
    }
}

/* ================= Формы без кругов =================
 * Углы — 4 px (--radius) по всему сайту. Круглые кнопки, бейджи и маркеры
 * превращаются в фирменные фигуры: параллелограммы и косые черты со срезом 22,5°.
 * Скос делаем через skewX у кнопки и обратный skewX у иконки внутри — так рамки, тени и пульсация повторяют форму.
 */

/* стрелки слайдеров: параллелограммы, при наведении — цвет раздела */
.events-controls button,
.promotions__header button {
    width: 60px;
    height: 56px;
    border-radius: 0;
    transform: skewX(22.5deg);
    transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}

.events-controls button > *,
.promotions__header button > * {
    transform: skewX(-22.5deg);
}

.events-controls button:hover,
.promotions__header button:hover {
    opacity: 1;
    color: var(--section-ink);
    background: var(--section);
}

.events-card__info__bottom .swiper-next-btn {
    border-radius: var(--radius);
}

/* WhatsApp: квадрат с минимальным скруглением, пульсация повторяет форму */
.floating_btn {
    right: 16px;
    width: 54px;
    height: 54px;
    border-radius: var(--radius);
}

/* теги на баннерах и чипы в модалке организации — как фильтры */
.tag {
    padding: 0 14px;
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 100%, 10px 100%);
}

.org-modal__chip {
    padding: 5px 18px;
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 100%, 11px 100%);
}

/* маркеры-точки -> косые черты, как «» в брендбуке */
.events-animated .content__tags span {
    width: 6px;
    height: 18px;
    border-radius: 0;
    background: var(--section);
    transform: skewX(22.5deg);
}

/* образцы цветов на схеме — параллелограммы, как в брендбуке */
.smap-sec__dot,
.smap__legend i {
    border-radius: 0;
    transform: skewX(22.5deg);
}

/* мелкие круги -> квадраты с минимальным скруглением */
.navbar-lang .flag {
    width: 22px;
    height: 16px;
    border-radius: var(--radius-sm);
}

.subscribe-card__profile-info .avatar,
.message.success::before,
.message.error::before,
.message.info::before,
.org-gallery__count,
.org-modal__thumb {
    border-radius: var(--radius-sm);
}

.flip-card--back .socials a,
.modal .modal-socials a,
.org-modal__close,
.org-gallery__nav,
.features__content__item .info-list li span {
    border-radius: var(--radius);
}

.features__content__item .info-list li span {
    background: var(--section-tint);
    color: var(--section);
}

.burger span {
    border-radius: 0;
}

/* точки пагинации каруселей -> короткие черты */
.swiper-pagination-bullet,
.swiper-container .swiper-pagination .swiper-pagination-bullet {
    width: 18px;
    height: 4px;
    border-radius: 0;
}

.swiper-pagination-bullet-active,
.swiper-container .swiper-pagination .swiper-pagination-bullet-active {
    background: var(--section);
}

@media screen and (max-width: 768px) {
    .events-controls button,
    .promotions__header button {
        width: 44px;
        height: 44px;
    }

    .floating_btn {
        width: 48px;
        height: 48px;
        padding: 12px;
    }
}

/* ================= Анимации =================
 * Та же логика, что в графике бренда: косая черта растёт, плоскости со срезом 22,5° выезжают, полоса прорисовывается.
 * Всё отключается, если в системе включено «уменьшить движение».
 */
@keyframes bm-rise {
    from { opacity: 0; translate: 0 16px; }
}

@keyframes bm-slash {
    from { transform: skewX(22.5deg) scaleY(0); }
}

@keyframes bm-planes {
    from { opacity: 0; translate: 56px 0; }
}

@keyframes bm-draw {
    from { clip-path: inset(0 0 100% 0); }
    to { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: no-preference) {
    /* шапка страницы при загрузке */
    .template-page__header .page-title {
        animation: bm-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    .template-page__header::after {
        animation: bm-planes 0.9s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    .template-page__header::before {
        animation: bm-draw 0.55s 0.5s cubic-bezier(0.6, 0, 0.3, 1) both;
    }

    /* поиск и фильтры появляются по очереди */
    .filters .search-field__wrap {
        animation: bm-rise 0.5s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    .filters__btn {
        animation: bm-rise 0.45s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    .filters__btn:nth-child(1) { animation-delay: 0.300s; }
    .filters__btn:nth-child(2) { animation-delay: 0.335s; }
    .filters__btn:nth-child(3) { animation-delay: 0.370s; }
    .filters__btn:nth-child(4) { animation-delay: 0.405s; }
    .filters__btn:nth-child(5) { animation-delay: 0.440s; }
    .filters__btn:nth-child(6) { animation-delay: 0.475s; }
    .filters__btn:nth-child(7) { animation-delay: 0.510s; }
    .filters__btn:nth-child(8) { animation-delay: 0.545s; }
    .filters__btn:nth-child(9) { animation-delay: 0.580s; }
    .filters__btn:nth-child(10) { animation-delay: 0.615s; }
    .filters__btn:nth-child(11) { animation-delay: 0.650s; }
    .filters__btn:nth-child(12) { animation-delay: 0.685s; }
    .filters__btn:nth-child(13) { animation-delay: 0.720s; }
    .filters__btn:nth-child(14) { animation-delay: 0.755s; }
    .filters__btn:nth-child(15) { animation-delay: 0.790s; }
    .filters__btn:nth-child(16) { animation-delay: 0.825s; }
    .filters__btn:nth-child(17) { animation-delay: 0.860s; }
    .filters__btn:nth-child(18) { animation-delay: 0.895s; }
    .filters__btn:nth-child(19) { animation-delay: 0.930s; }
    .filters__btn:nth-child(20) { animation-delay: 0.965s; }

    /* карточки и заголовки этажей всплывают при прокрутке (классы ставит js/brand-motion.js) */
    .bm-reveal {
        opacity: 0;
        translate: 0 32px;
    }

    .bm-reveal.is-in {
        opacity: 1;
        translate: none;
        transition: opacity 0.6s ease, translate 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
}

/* при печати ничего не прячем */
@media print {
    .bm-reveal {
        opacity: 1 !important;
        translate: none !important;
    }
}
