/* ============================================================
   LOT SANDBOX — spacing, z-index, hover, ротатор-фикс
   ============================================================ */

/* --- 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; }

/* --- SPACING --- */
.section-1 { margin-top: 24px; }

.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;
}

/* --- РОТАТОР: длительность анимации = наша CSS-переменная ---
   Docker CSS жёстко имел 12s, что работало только для 3 слайдов.
   Теперь длительность = N * 4s, корректно для любого N. */
.lot-rotator__slide {
    animation-duration: var(--lot-rotator-cycle, 12s) !important;
}



/* --- РОТАТОР: чистые keyframes под 4 слайда (1 стат + 3 акции) ---
   Каждый слайд занимает 25% цикла (4с из 16с):
   • 0-4%  невидим (до момента старта)
   • 4-7%  fade in (~0.5с)
   • 7-22% видим (~2.4с)
   • 22-25% fade out (~0.5с)
   • 25-100% невидим
   Следующий слайд стартует ровно когда предыдущий ушёл — без перекрытия */
@keyframes lotRotate {
    0%        { opacity: 0; }
    2%, 22%   { opacity: 1; }
    25%, 100% { opacity: 0; }
}

/* --- ВЕРХНЕЕ МЕНЮ при 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;
}

/* --- Стрелочка ▾ у пунктов меню: скрыта, появляется при 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);
}

/* --- Меню: НЕ подчёркивать при наведении --- */
.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;
}

/* --- 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;
}

/* --- Вся шапка по ширине как в Docker localhost (1170px Bootstrap default) --- */
@media (min-width: 1200px) {
    .lot-sticky-header .navbar-top .container,
    .lot-sticky-header .top-stores .container,
    .lot-rotator .container {
        max-width: 1170px !important;
    }
}

/* --- Ротатор promo: выравнивание "Перейти →" по центру с title --- */
.lot-rotator__promo {
    align-items: center;
}
.lot-rotator__promo-title,
.lot-rotator__promo-link,
.lot-rotator__promo-tag {
    line-height: 1.3;
}


/* --- ФОРС: шапка ровно 1170px max на любом нормальном экране --- */
@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;
    }
}

/* --- Шапка съезжает ниже Битрикс-админ-панели когда она активна --- */
body.bx-admin-active .lot-sticky-header,
body.bitrix-live-edit .lot-sticky-header {
    top: 39px !important;
}
/* Битрикс admin panel z-index = 12000+. Чтобы НЕ перекрывать её — снижаемся */
body.bx-admin-active .lot-sticky-header {
    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;
}

/* --- В админ-режиме полоса филиалов тоже не создаёт высокий stacking context --- */
body.bx-admin-active .top-stores {
    position: relative;
    z-index: 99 !important;
}
/* Битрикс правый toolbar обычно при admin loaded */
body.bx-admin-active .lot-rotator {
    z-index: 99;
    position: relative;
}

@media (min-width: 768px) {
/* ============================================================
   LOT SANDBOX — стили главной страницы (только body.page-home)
   ============================================================ */

/* --- Заголовки секций главной: тоньше, с воздухом --- */
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: 8px 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;
}

/* --- Кнопки на главной: единый современный стиль --- */
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;
}


/* ============================================================
   РИТМ ГЛАВНОЙ — 40px между блоками 3–7 (финальная версия)
   ============================================================ */

/* Блок 3 (Пиломатериалы Уфа), Блок 4 (Популярные товары) */
body.page-home > .container:not(.hidden-xs):has(> h1),
body.page-home > .container.hidden-xs {
    margin-top: 25px !important;
    margin-bottom: 0 !important;
}

/* Блок 5 (workarea: Категории/Акции/Статьи). Workarea container даёт отступ от Блока 4 */
body.page-home > .workarea > .container {
    margin-top: 25px !important;
    margin-bottom: 0 !important;
}

/* Между h2-секциями внутри workarea (5b, 5c — но НЕ первый 5a) */
body.page-home .workarea h2 {
    margin-top: 25px !important;
    margin-bottom: 16px !important;
}
body.page-home .workarea > .container > h2:first-of-type,
body.page-home .workarea > .container > .container > h2:first-of-type {
    margin-top: 0 !important;
}

/* Блок 6 (Мы там, где Вам удобно) — отступ даёт ВНЕШНИЙ section-2, у вложенной company-network mt=0 чтобы не двоился */
body.page-home .section-2 {
    margin-top: 25px !important;
    margin-bottom: 0 !important;
}
body.page-home .company-network {
    margin-top: 0 !important;
}

/* Блок 7 (Присоединяйтесь) */
body.page-home .section-social_network,
body.page-home .section-3 {
    margin-top: 25px !important;
    margin-bottom: 0 !important;
}
}



/* Убрать просачивающийся margin-top h2 из .company-network */
body.page-home .company-network > h2:first-child {
    margin-top: 0 !important;
}


/* --- Блок 7 (Присоединяйтесь к нам): чистая центровка --- */
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;
}
/* Текст-колонка: вся центрируется в своей колонке (h2, ul, h4 — выровнены одинаково по центру) */
body.page-home .section-social_network .col-md-5 {
    text-align: center !important;
}
body.page-home .section-social_network .col-md-5 h2,
body.page-home .section-social_network .col-md-5 ul,
body.page-home .section-social_network .col-md-5 li,
body.page-home .section-social_network .col-md-5 h4,
body.page-home .section-social_network .col-md-5 p {
    text-align: center !important;
}
body.page-home .section-social_network .col-md-5 ul {
    list-style-position: inside !important;
    padding-left: 0 !important;
}
body.page-home .section-social_network .col-md-7 {
    text-align: center !important;
}

/* H2 и H4 по центру, список 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;
}

/* Убрать просачивающийся margin-top h2.main-title (блок "ЛесОптТорг – с заботой") */
body.page-home h2.main-title {
    margin-top: 0 !important;
}

/* --- Кнопка "Заказать" внизу главной — зелёный градиент --- */
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;
}

/* --- До галочки: кнопка явно белая (не прозрачная) --- */
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: #ffffff !important;
    color: #9ca3af !important;
    border: 1px solid #d1d5db !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* --- Кнопка "Искать" на странице поиска: зелёная --- */
.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;
}

/* --- Страница /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;
}
