/* ============================================================
   ATM MOTO — фирменный стиль: цвета, типографика, кнопки
   ============================================================ */

/* Заголовочный шрифт Benzin (подключён) */
@font-face {
    font-family: 'Benzin';
    src: url('/fonts/benzin/Benzin-Regular.woff2') format('woff2'),
         url('/fonts/benzin/Benzin-Regular.woff') format('woff'),
         url('/fonts/benzin/Benzin-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Benzin';
    src: url('/fonts/benzin/Benzin-Bold.woff2') format('woff2'),
         url('/fonts/benzin/Benzin-Bold.woff') format('woff'),
         url('/fonts/benzin/Benzin-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Основные */
    --ink:       #141414;   /* тёмно-серый / чёрный — шапка, подвал, текст */
    --white:     #ffffff;   /* фон карточек, форм, попапов */
    --gray-bg:   #f4f4f6;   /* вспомогательный фон, разделители, пагинация */
    --gray-line: #ececec;   /* границы */
    --text:      #333333;
    --muted:     #8a8a8a;
    /* Акцент */
    --brand:      #F5731F;  /* бренд-оранжевый: CTA, ссылки, иконки, цены, крошки, «Акция» */
    --brand-dark: #dd5f11;  /* hover */
    /* Дополнительные */
    --green:  #18a558;      /* «В наличии», успех */
    --yellow: #f2c200;      /* «Скидка», «Выгода», акцент внимания */
    /* Типографика */
    --font-body: 'Manrope', 'Roboto', Arial, sans-serif;
    --font-head: 'Benzin', 'Montserrat', 'Manrope', sans-serif;
}

/* --- Базовая типографика --- */
body { font-family: var(--font-body); color: var(--ink); }

h1, h2, h3, .page-title, .section-title, .section-title.h2, .h1, .h2, .h3 {
    font-family: var(--font-head);
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--ink);
}
h1, .page-title, .h1 { font-size: 36px; line-height: 1.14; }
h2, .section-title, .section-title.h2, .h2 { font-size: 30px; line-height: 1.18; }
h3, .h3 { font-size: 24px; line-height: 1.22; }
h4, h5, h6, .h4, .h5, .h6 { font-family: var(--font-body); font-weight: 600; font-size: 19px; line-height: 1.3; }

@media (max-width: 767px) {
    h1, .page-title, .h1 { font-size: 26px; }
    h2, .section-title, .section-title.h2, .h2 { font-size: 22px; }
    h3, .h3 { font-size: 19px; }
}

/* --- Кнопки: единый стиль + анимация --- */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .08s ease, filter .16s ease;
}
.btn:active { transform: translateY(1px); }
.btn_primary { background-color: var(--brand) !important; color: #fff !important; }
.btn_primary:hover { background-color: var(--brand-dark) !important; }
.btn_secondary { transition: inherit; }

/* --- Ссылки-акценты, хлебные крошки, «смотреть все» --- */
.with-underline:hover,
.section-header__more-link,
.section-header__more-link:hover,
.breadcrumbs a:hover,
.cmp-breadcrumbs a:hover,
.footer__catalog-tag:hover,
.header-top__auth a:hover { color: var(--brand); }

/* --- Цены — акцент бренда --- */
.pcard__now,
.cmp-prod__price,
.card-offer__price-current { color: var(--brand); }

/* --- Лёгкий подъём карточек-ссылок (единая динамика) --- */
.brand,
.news-item,
.infoblock { transition: transform .16s ease, box-shadow .16s ease; }
.brand:hover,
.news-item:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.08); }

/* ============================================================
   Обязательный чекбокс согласия во всех формах захвата
   ============================================================ */
.js-send-form .font-12 { display: none; } /* убираем дублирующую строку «Нажимая на кнопку…» */

.form-agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
    cursor: pointer;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--muted);
    user-select: none;
}
.form-agree__input { position: absolute; opacity: 0; width: 0; height: 0; }
.form-agree__box {
    flex-shrink: 0;
    width: 20px; height: 20px; margin-top: 1px;
    border: 2px solid #c5c5c5; border-radius: 5px;
    background: #fff;
    position: relative;
    transition: border-color .15s ease, background .15s ease;
}
.form-agree__input:checked + .form-agree__box {
    background: var(--brand); border-color: var(--brand);
}
.form-agree__input:checked + .form-agree__box:after {
    content: ""; position: absolute; left: 6px; top: 2px;
    width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.form-agree__text a { color: var(--brand); text-decoration: underline; }
.form-agree.is-error .form-agree__box { border-color: #e03131; }
/* На тёмных формах (dealer-consult) текст светлее */
.dealer-consult .form-agree { color: #c9c9c9; }

/* ============================================================
   Единая кнопка «Войти» в правом углу верхнего меню
   ============================================================ */
.header-top__login {
    display: inline-flex; align-items: center; gap: 7px;
    white-space: nowrap;
    transition: color .15s ease;
}
.header-top__login:hover { color: var(--brand); }
.header-top__login svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   Форма-баннер (dealer-consult): телефон + кнопка в линию, чекбокс ниже
   ============================================================ */
.dealer-consult__form { flex-wrap: wrap; align-items: center; }
.dealer-consult__input { order: 1; }
.dealer-consult__btn { order: 2; }
.dealer-consult__form .form-agree { order: 3; flex-basis: 100%; margin-top: 2px; }
.dealer-consult__form .captcha-container { order: 4; flex-basis: 100%; }

/* Десктоп: текст слева, форма справа — в одну строку (не сваливать форму под текст) */
@media (min-width: 768px) {
    .dealer-consult { flex-wrap: nowrap; }
    .dealer-consult__text { flex: 1 1 auto; min-width: 0; }
    .dealer-consult__form { flex: 0 0 auto; width: auto; max-width: 470px; }
}

/* ============================================================
   Поиск — выпадающие подсказки (realtime)
   ============================================================ */
.header__search .search { position: relative; }
.search-suggest {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    z-index: 200;
    background: #fff;
    border: 1px solid var(--gray-line);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(0,0,0,.16);
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px 0;
    display: none;
    color: var(--ink);
}
.search-suggest.is-open { display: block; }
.search-suggest__group { padding: 6px 0; border-top: 1px solid #f2f2f4; }
.search-suggest__group:first-child { border-top: none; }
.search-suggest__title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    color: var(--muted); padding: 8px 18px 6px;
}
.search-suggest__item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 18px; text-decoration: none; color: var(--ink);
    transition: background .12s ease;
}
.search-suggest__item:hover { background: #f7f7f9; }
.search-suggest__img { flex-shrink: 0; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: var(--gray-bg); }
.search-suggest__img img { width: 100%; height: 100%; object-fit: cover; }
.search-suggest__pinfo { display: flex; flex-direction: column; min-width: 0; }
.search-suggest__pname { font-size: 13.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-suggest__pmeta { font-size: 13px; margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.search-suggest__pmeta b { color: var(--brand); font-weight: 800; }
.search-suggest__pbrand { color: var(--muted); }
.search-suggest__cname { font-size: 14px; font-weight: 600; flex: 1 1 auto; }
.search-suggest__tag {
    font-size: 11px; font-weight: 700; color: #5a6068; background: var(--gray-bg);
    border-radius: 20px; padding: 3px 10px;
}
.search-suggest__count { font-size: 12px; color: var(--muted); }
.search-suggest__all {
    display: block; text-align: center; padding: 12px; font-weight: 700; font-size: 14px;
    color: var(--brand); text-decoration: none; border-top: 1px solid #f2f2f4;
}
.search-suggest__all:hover { background: #fff7f1; color: var(--brand); }
.search-suggest__loading, .search-suggest__empty, .search-suggest__error { padding: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.search-suggest__error { color: #c0392b; }
.search-suggest__empty { color: var(--ink); font-weight: 600; }
.search-suggest__qs { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 18px 10px; }
.search-suggest__q {
    border: 1px solid var(--gray-line); background: #fff; border-radius: 20px;
    padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--ink);
    transition: border-color .12s ease, color .12s ease;
}
.search-suggest__q:hover { border-color: var(--brand); color: var(--brand); }

/* ============================================================
   Поиск — статичная строка (без выдвижения/сдвига шапки)
   ============================================================ */
.header__search-toggle-btn { display: none !important; }
.header__search .search__input { opacity: 1 !important; pointer-events: auto !important; }
/* Даже если добавляется класс open-header-search — шапка не «уезжает», строка остаётся на месте */
body.open-header-search .header__left {
    opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; margin-left: 0 !important;
}
body.open-header-search .header__search .search { width: auto !important; margin-left: 0 !important; }

/* ============================================================
   Task 1 — единая динамика карточек товара + строгая типографика
   ============================================================ */
/* Плавный подъём карточки товара при наведении (как у brand/news) */
.pcard,
.product-item,
.product_item {
    transition: transform .16s ease, box-shadow .16s ease;
}
@media (hover:hover) {
    .pcard:hover,
    .product-item:hover,
    .product_item:hover {
        transform: translateY(-4px);
        box-shadow: 0 14px 30px rgba(20,30,50,.10);
    }
}

/* Цены — строго Bold, размер по ТЗ (18–22px) */
.pcard__now,
.cmp-prod__price,
.card-offer__price-current { font-weight: 700; }

/* Навигация — Manrope 14 Medium (единообразие) */
.header-nav a,
.header-bottom__nav a,
.menu__link { font-family: var(--font-body); font-weight: 500; }

/* Шильдики статусов — фирменные доп. цвета */
.badge-instock, .label-instock, .is-instock { color: var(--green); }
.badge-sale, .label-sale, .stiker--sale { background: var(--yellow); color: var(--ink); }

/* SEO-текст внизу листинга (категории/теги/бренды) — раскрывающийся блок */
.catalog-seotext { margin: 34px 0 8px; }
.catalog-seotext__cb { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.catalog-seotext__inner { position: relative; max-height: 156px; overflow: hidden; color: #4a4f57; font-size: 15px; line-height: 1.72; transition: max-height .25s ease; }
.catalog-seotext__inner::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 74px; background: linear-gradient(rgba(255,255,255,0), #fff); pointer-events: none; transition: opacity .25s ease; }
.catalog-seotext__inner h2 { font-size: 22px; font-weight: 800; margin: 0 0 12px; color: #1a1a1a; line-height: 1.25; }
.catalog-seotext__inner h3 { font-size: 18px; font-weight: 700; margin: 20px 0 8px; color: #1a1a1a; }
.catalog-seotext__inner p { margin: 0 0 12px; }
.catalog-seotext__cb:checked ~ .catalog-seotext__inner { max-height: 4000px; }
.catalog-seotext__cb:checked ~ .catalog-seotext__inner::after { opacity: 0; }
.catalog-seotext__toggle { display: inline-flex; margin-top: 12px; color: #F5731F; font-weight: 600; cursor: pointer; font-size: 14px; user-select: none; }
.catalog-seotext__toggle::after { content: 'Раскрыть \25BE'; }
.catalog-seotext__cb:checked ~ .catalog-seotext__toggle::after { content: 'Свернуть \25B4'; }

/* ==========================================================================
   Горизонтальный скроллер (популярные, акции, новости, бренды)
   Стрелки + fade-in по краям. Инициализация — public/js/product-card.js
   ========================================================================== */
.pop-scroller { position: relative; }
.pop-scroller__track {
    display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden;
    /* ВАЖНО: без scroll-behavior:smooth и без scroll-snap —
       иначе колесо мыши «залипает»: каждый тик перезапускает анимацию,
       а снап возвращает трек назад. Плавность у стрелок задаётся в JS. */
    overscroll-behavior-x: contain;
    padding: 4px 2px 10px; margin: 0 -2px;
    scrollbar-width: none; -ms-overflow-style: none;
}
.pop-scroller__track::-webkit-scrollbar { display: none; height: 0; }
.pop-scroller__col { flex: 0 0 calc((100% - 48px) / 4); min-width: 0; display: flex; }
.pop-scroller__col > * { width: 100%; }

/* Плавное затухание у краёв — видно, что список продолжается */
.pop-scroller::before, .pop-scroller::after {
    content: ''; position: absolute; top: 0; bottom: 10px; width: 64px; z-index: 2;
    pointer-events: none; opacity: 0; transition: opacity .22s ease;
}
.pop-scroller::before { left: -2px; background: linear-gradient(90deg, #fff 15%, rgba(255,255,255,0)); }
.pop-scroller::after  { right: -2px; background: linear-gradient(270deg, #fff 15%, rgba(255,255,255,0)); }
.pop-scroller.has-prev::before { opacity: 1; }
.pop-scroller.has-next::after  { opacity: 1; }

.pop-scroller__arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 1px solid #e8ebef;
    box-shadow: 0 8px 24px rgba(20,25,35,.14); cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center; transition: .15s ease;
}
.pop-scroller__arrow svg { width: 20px; height: 20px; fill: none; stroke: #20242c; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pop-scroller__arrow:hover { border-color: #F5731F; box-shadow: 0 10px 28px rgba(245,115,31,.22); }
.pop-scroller__arrow:hover svg { stroke: #F5731F; }
.pop-scroller__arrow--prev { left: -20px; }
.pop-scroller__arrow--next { right: -20px; }
.pop-scroller__arrow.is-hidden { opacity: 0; visibility: hidden; }

/* Карточки в скроллере компактнее обычных */
.pop-scroller .jpr__card { height: 100%; }
.pop-scroller .news-item { height: 100%; }
.pop-scroller__col .brands-list__col { width: 100%; }

@media (max-width: 1280px) { .pop-scroller__arrow--prev { left: -8px; } .pop-scroller__arrow--next { right: -8px; } }
@media (max-width: 1100px) { .pop-scroller__col { flex-basis: calc((100% - 32px) / 3); } }
@media (max-width: 820px)  { .pop-scroller__col { flex-basis: calc((100% - 16px) / 2); } .pop-scroller__arrow { display: none; } }
@media (max-width: 560px)  { .pop-scroller__col { flex-basis: 84%; } }

/* Скроллер брендов — плитки мельче */
.pop-scroller_brands .pop-scroller__col { flex: 0 0 calc((100% - 5 * 16px) / 6); }
@media (max-width: 1100px) { .pop-scroller_brands .pop-scroller__col { flex-basis: calc((100% - 3 * 16px) / 4); } }
@media (max-width: 820px)  { .pop-scroller_brands .pop-scroller__col { flex-basis: calc((100% - 2 * 16px) / 3); } }
@media (max-width: 560px)  { .pop-scroller_brands .pop-scroller__col { flex-basis: 44%; } }
