/* ============================================================
   LOT — стили десктопной шапки, ротатора, главной, поиска
   Структура:
     1. Z-INDEX и Битрикс-админка
     2. Ширина контейнеров шапки
     3. Меню: hover, стрелка, SVG-иконка
     4. Ротатор (анимация + промо)
     5. Главная: заголовки, лиды, ритм блоков
     6. Кнопки
     7. Блок «Присоединяйтесь к нам»
     8. Страница поиска
   ============================================================ */


/* ============================================================
   1. Z-INDEX и Битрикс-админка
   ============================================================ */
.lot-sticky-header { z-index: 1000 !important; }
.lot-sticky-header .navbar-top,
.lot-sticky-header .navbar-fixed-top { z-index: 1000 !important; }
.top-stores { position: relative; z-index: 999; }

/* Шапка съезжает ниже Битрикс-админ-панели когда она активна.
   Bitrix admin panel z-index = 12000+, поэтому снижаемся под неё. */
body.bx-admin-active .lot-sticky-header,
body.bitrix-live-edit .lot-sticky-header {
    top: 39px !important;
    z-index: 100 !important;
}
body.bx-admin-active .lot-sticky-header .navbar-top,
body.bx-admin-active .lot-sticky-header .navbar-fixed-top {
    z-index: 100 !important;
}
body.bx-admin-active .top-stores {
    position: relative;
    z-index: 99 !important;
}
body.bx-admin-active .lot-rotator {
    position: relative;
    z-index: 99;
}


/* Отступ первого блока (section-1: слайдер) от шапки */
.section-1 { margin-top: 24px; }


/* ============================================================
   2. Ширина контейнеров шапки (1170px = Bootstrap default)
   ============================================================ */
@media (min-width: 768px) {
    body .lot-sticky-header .navbar.navbar-top > .container,
    body .lot-sticky-header .top-stores > .container,
    body .lot-rotator > .container {
        max-width: 1170px !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}


/* ============================================================
   3. Меню: hover, стрелка ▾, SVG-иконка
   ============================================================ */
/* Hover/active пункта верхнего меню — белый текст на тёмно-зелёном */
.navbar-top .navbar-nav > li > a:hover,
.navbar-top .navbar-nav > li > a:focus,
.navbar-nav-menu > li:hover > a,
.navbar-nav-menu > li.jshover > a,
.navbar-nav-menu > li > a.root-item-selected,
.navbar-nav-menu > li.item-selected > a {
    color: #f2fbf6 !important;
    text-decoration: none !important;
}

/* Нигде в меню не подчёркивать при наведении */
.navbar-top .navbar-nav a:hover,
.navbar-top .navbar-nav a:focus,
.navbar-nav-menu a:hover,
.navbar-nav-menu a:focus,
.navbar-nav-menu li ul a:hover,
.navbar-nav-menu li ul a:focus,
.catalog-menu a:hover,
.catalog-menu a:focus {
    text-decoration: none !important;
}

/* Стрелка ▾ у пунктов с подменю: скрыта, плавно появляется при hover */
.menu-caret {
    display: inline-block;
    margin-left: 4px;
    color: #ff5a1f !important;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.navbar-nav-menu > li:hover > a .menu-caret,
.navbar-nav-menu > li.jshover > a .menu-caret {
    opacity: 1;
    transform: translateY(0);
}

/* SVG-иконка ≡ в «Каталог»: зелёная при hover/active */
.navbar-nav-menu > li:hover > a.root-item svg path,
.navbar-nav-menu > li:hover > a.root-item svg circle,
.navbar-nav-menu > li.jshover > a.root-item svg path,
.navbar-nav-menu > li.jshover > a.root-item svg circle,
.navbar-nav-menu > li > a.root-item-selected svg path,
.navbar-nav-menu > li > a.root-item-selected svg circle,
.navbar-nav-menu > li.item-selected > a svg path,
.navbar-nav-menu > li.item-selected > a svg circle {
    fill: #00ad5d !important;
    transition: fill .18s ease;
}

/* Боковое каталог-меню (на главной): подсветка hover/current */
.catalog-menu .bx_vertical_menu_advanced .bx_hma_one_lvl > a:hover,
.catalog-menu .bx_vertical_menu_advanced .bx_hma_one_lvl.current > a,
.catalog-menu .bx_vertical_menu_advanced .bx_hma_one_lvl.current a {
    background: rgba(0, 173, 93, 0.08) !important;
}


/* ============================================================
   4. Ротатор (статистика + акции)
   ============================================================ */
/* Длительность анимации = CSS-переменная (N слайдов × 4с) */
.lot-rotator__slide {
    animation-duration: var(--lot-rotator-cycle, 12s) !important;
}
/* Keyframes под N слайдов: появление 2%, видимость до 22%, уход к 25% */
@keyframes lotRotate {
    0%        { opacity: 0; }
    2%, 22%   { opacity: 1; }
    25%, 100% { opacity: 0; }
}
/* Промо-слайд: тег/название/«Перейти» на одной линии */
.lot-rotator__promo {
    align-items: center;
}
.lot-rotator__promo-title,
.lot-rotator__promo-link,
.lot-rotator__promo-tag {
    line-height: 1.3;
}


/* ============================================================
   5. ГЛАВНАЯ (body.page-home), только десктоп ≥768px
   ============================================================ */
@media (min-width: 768px) {

    /* Заголовки секций: тоньше, с воздухом */
    body.page-home h2.main-title,
    body.page-home .company-network > h2,
    body.page-home .section-1 h2.text-center {
        font-size: 32px !important;
        font-weight: 600 !important;
        letter-spacing: -0.01em !important;
        color: #1d3d37 !important;
        margin: 0 0 12px !important;
        line-height: 1.2 !important;
    }

    /* Подзаголовок-лид */
    body.page-home .container > p.text-center,
    body.page-home .company-network > p {
        font-size: 17px !important;
        font-weight: 400 !important;
        color: #6b7280 !important;
        margin: 0 auto 32px !important;
        max-width: 720px !important;
        line-height: 1.55 !important;
    }

    /* --- Ритм блоков главной: 25px между секциями 3–7 --- */
    body.page-home > .container:not(.hidden-xs):has(> h1),
    body.page-home > .container.hidden-xs,
    body.page-home > .workarea > .container,
    body.page-home .section-2,
    body.page-home .section-social_network,
    body.page-home .section-3 {
        margin-top: 25px !important;
        margin-bottom: 0 !important;
    }
    /* h2-секции внутри workarea (Категории/Акции/Статьи) */
    body.page-home .workarea h2 {
        margin-top: 25px !important;
        margin-bottom: 16px !important;
    }
    /* Первый h2 в контейнере не отрывается от верха */
    body.page-home .workarea > .container > h2:first-of-type,
    body.page-home .workarea > .container > .container > h2:first-of-type {
        margin-top: 0 !important;
    }
    /* Блок 6 (company-network): отступ даёт внешний section-2, у вложенной mt=0 */
    body.page-home .company-network {
        margin-top: 0 !important;
    }
}

/* Убрать просачивающийся browser-margin h2 (срабатывает на всех ширинах) */
body.page-home h2.main-title,
body.page-home .company-network > h2:first-child {
    margin-top: 0 !important;
}


/* ============================================================
   6. КНОПКИ
   ============================================================ */
/* Кнопки-ссылки на главной (Читать все статьи / Адреса магазинов) */
body.page-home .btn-all,
body.page-home a.btn-primary,
body.page-home .btn-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 32px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    background: linear-gradient(135deg, #00ad5d 0%, #027b43 100%) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    text-transform: none !important;
    box-shadow: 0 6px 18px rgba(0, 173, 93, 0.25) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease !important;
    cursor: pointer !important;
}
body.page-home .btn-all:hover,
body.page-home a.btn-primary:hover,
body.page-home .btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 24px rgba(0, 173, 93, 0.32) !important;
    color: #fff !important;
}
body.page-home .btn-all:active,
body.page-home a.btn-primary:active {
    transform: translateY(0) !important;
}

/* Кнопка submit «Заказать» (форма внизу главной) — активная */
body.page-home button.btn-primary:not([disabled]):not(.disabled),
body.page-home .btn.btn-primary:not([disabled]):not(.disabled),
body.page-home button.submit-button:not([disabled]):not(.disabled) {
    background: linear-gradient(135deg, #00ad5d 0%, #027b43 100%) !important;
    background-color: #00ad5d !important;
    opacity: 1 !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 12px 28px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(0, 173, 93, 0.25) !important;
    text-shadow: none !important;
}
body.page-home button.btn-primary:not([disabled]):not(.disabled):hover,
body.page-home .btn.btn-primary:not([disabled]):not(.disabled):hover,
body.page-home button.submit-button:not([disabled]):not(.disabled):hover {
    background: linear-gradient(135deg, #027b43 0%, #026235 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(0, 173, 93, 0.32) !important;
}
/* Кнопка submit «Заказать» — disabled (до галочки): серая, того же размера */
body.page-home button.btn-primary[disabled],
body.page-home button.btn-primary.disabled,
body.page-home button.submit-button[disabled],
body.page-home button.submit-button.disabled {
    opacity: 1 !important;
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 12px 28px !important;
    font-weight: 600 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}


/* ============================================================
   7. БЛОК «Присоединяйтесь к нам» (section-social_network)
   ============================================================ */
body.page-home .section-social_network {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
}
body.page-home .section-social_network .row {
    display: flex !important;
    align-items: center !important;
}
/* Заголовок, h4, текст — по центру колонки */
body.page-home .section-social_network .col-md-5,
body.page-home .section-social_network .col-md-5 h2,
body.page-home .section-social_network .col-md-5 h4,
body.page-home .section-social_network .col-md-5 p,
body.page-home .section-social_network .col-md-7 {
    text-align: center !important;
}
/* Список — слева, но блок ul центрирован */
body.page-home .section-social_network .col-md-5 ul,
body.page-home .section-social_network .col-md-5 li {
    text-align: left !important;
}
body.page-home .section-social_network .col-md-5 ul {
    list-style-position: outside !important;
    padding-left: 24px !important;
    display: inline-block !important;
    margin: 0 auto !important;
}


/* ============================================================
   8. СТРАНИЦА ПОИСКА (/search/)
   ============================================================ */
/* Кнопка «Искать» (legacy форма bitrix:catalog.search) */
.container-search input[type=submit] {
    background: linear-gradient(135deg, #00ad5d 0%, #027b43 100%) !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 10px 24px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 173, 93, 0.25) !important;
    transition: box-shadow 0.18s ease !important;
}
.container-search input[type=submit]:hover {
    background: linear-gradient(135deg, #027b43 0%, #026235 100%) !important;
    box-shadow: 0 6px 16px rgba(0, 173, 93, 0.32) !important;
}

/* Кастомная страница поиска (.lot-search) */
.lot-search {
    max-width: 1170px;
    margin: 0 auto;
    padding: 24px 15px 60px;
}
.lot-search__form {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    max-width: 720px;
}
.lot-search__input {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    outline: none;
}
.lot-search__input:focus {
    border-color: #00ad5d;
    box-shadow: 0 0 0 3px rgba(0, 173, 93, 0.12);
}
.lot-search__submit {
    height: 48px;
    padding: 0 28px;
    background: linear-gradient(135deg, #00ad5d 0%, #027b43 100%);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 173, 93, 0.25);
    transition: box-shadow .18s ease;
}
.lot-search__submit:hover {
    box-shadow: 0 6px 16px rgba(0, 173, 93, 0.32);
}
.lot-search__meta {
    margin: 16px 0 24px;
    color: #6b7280;
    font-size: 14px;
}
.lot-search__meta--empty {
    padding: 24px;
    background: #f9fafb;
    border-radius: 10px;
    line-height: 1.55;
}
.lot-search__results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.lot-search__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .18s ease, transform .18s ease;
}
.lot-search__card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    text-decoration: none;
}
.lot-search__card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #f5f6f8;
}
.lot-search__card-img--placeholder {
    background: linear-gradient(135deg, #f0f3f5 0%, #e5eaed 100%);
}
.lot-search__card-name {
    padding: 12px 14px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
}

/* ============================================================
   9. Прайс-лист — яркая кнопка «Запросить» (аудитория 40+)
   ============================================================ */
.page-shell--delivery .feedback-form button.submit-button:not([disabled]):not(.disabled) {
    background: linear-gradient(135deg, #00ad5d 0%, #027b43 100%) !important;
    background-color: #00ad5d !important;
    opacity: 1 !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 14px 34px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    float: none !important;
    box-shadow: 0 4px 12px rgba(0, 173, 93, 0.25) !important;
    text-shadow: none !important;
}
.page-shell--delivery .feedback-form button.submit-button:not([disabled]):not(.disabled):hover {
    background: linear-gradient(135deg, #027b43 0%, #026235 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(0, 173, 93, 0.32) !important;
}
.page-shell--delivery .feedback-form button.submit-button[disabled],
.page-shell--delivery .feedback-form button.submit-button.disabled {
    opacity: 1 !important;
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 14px 34px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    float: none !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* ============================================================
   10. Бейдж «Акция»/лейблы товара — не должны лезть поверх липкой
   зелёной шапки филиалов (.lot-sticky-header z-index:1000).
   ============================================================ */
.product-item-label-text,
.product-item-label-big,
.product-item-label-top,
.product-item-detail-slider-block .product-item-label-text {
    z-index: 900 !important;
}
