/* ============================================================
   mobile.css — мобильные правки для new_templ.
   Подключается отдельно через addStyleSheet (filemtime).
   Покрывает <=768px (планшеты) и <=480px (телефоны).
   ============================================================ */

/* --- ДЕСКТОП и моб: спрятать SEO-текст категорий, центрировать заголовки --- */
.jshop_list_category + .category_description,
.jshop > .category_description,
.category_description {
    display: none !important;
}
.jshop > h1,
#comjshop > h1,
.item-page > .page-header h1,
.item-page > .page-header h2 {
    text-align: center !important;
}

/* --- Скрыть битые картинки в info-блоке (Бренды/Оплата) ---
   Файлы /images/divan.jpg и /images/moneta.jpg отдают 404.
   Оставляем только текст. */
.information .item .pictures img {
    display: none !important;
}

/* --- ГЛОБАЛЬНО: никакой горизонтальный скролл на ВСЕХ устройствах ---
   Защита от inline width:1000px / table без max-width / pre overflow. */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
}
img, video, iframe, table, pre {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* ============================================================
   MOBILE <= 768px
   ============================================================ */
@media (max-width: 768px) {

    /* --- Сразу гасим всё что выходит за viewport и центрируем контент --- */
    /* ПРЕДОХРАНИТЕЛИ: убираем любой horizontal overflow и фиксируем box-sizing */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    *, *::before, *::after { box-sizing: border-box; }

    /* ТОЛЬКО .body имеет 8px padding по бокам. Вложенные контейнеры — 0. */
    .body {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        box-sizing: border-box !important;
        float: none !important;
    }
    .body > .container,
    .mmain,
    .mmain > .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        float: none !important;
    }
    /* Секции после контента (акции/info/posl/news/footer) — оставляем свой padding 10px,
       т.к. они тянутся на всю ширину viewport отдельно */
    .akcia > .container, .info > .container, .topt > .container,
    .ssl > .container, .posl > .container, .news > .container,
    .manuf2 > .container, .footer > .container {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        box-sizing: border-box !important;
        float: none !important;
    }
    .mmain .lft, .mmain .sl, main#content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }
    /* === Переопределяем жёсткие ограничения ширины из template.css @media max-width:767px === */
    /* template.css 4914: .jshop.productfull { max-width: 300px } — зажимает страницу товара в коробку */
    body .jshop.productfull,
    body .productfull {
        max-width: 100% !important;
        width: 100% !important;
    }
    /* template.css 4880: td.jshop_img_description { max-width:350px; padding-top:300px } */
    body td.jshop_img_description {
        max-width: 100% !important;
        width: 100% !important;
        padding-top: 0 !important;
        position: static !important;
    }
    /* template.css 4888: #list_product_image_middle a { width:260px } */
    body #list_product_image_middle a,
    body #list_product_image_middle {
        max-width: 100% !important;
    }
    /* template.css 13: .lft { margin-right: 50px; border: 1px solid #ddd } — сидит асимметрично */
    body .lft,
    body .mmain .lft {
        margin-right: 0 !important;
        margin-left: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
    /* .item-page для контентных страниц — растянуть на всю ширину */
    body .item-page {
        max-width: 100% !important;
        width: auto !important;
        padding: 0 !important;
    }
    /* Сайдбары и top-bar с соцсетями — скрываем (голубой значок vk оттуда) */
    .menu-1 { display: none !important; }
    #sidebar, #aside, .span3 { display: none !important; }

    /* --- ХЕДЕР: 3 ряда. 1) Лого слева | Корзина-кружок справа. 2) Телефон+email под логотипом слева. 3) Поиск full-width. --- */
    .header { padding: 8px 0 0; }
    .header .header-inner {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr;  /* лого слева | корзина по центру | бургер справа */
        grid-template-areas:
            "brand    cart    burger"
            "phone    phone   phone"
            "search   search  search";
        gap: 8px 10px;
        padding: 8px 12px !important;
        align-items: center;
        max-width: 100%;
        box-sizing: border-box;
    }
    .header .header-inner::before,
    .header .header-inner::after { display: none !important; }

    .header .brand {
        grid-area: brand;
        float: none !important;
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        gap: 8px;
        text-decoration: none;
        min-width: 0;
        justify-self: start;
    }
    .header .brand img {
        max-height: 46px;
        width: auto;
        display: block;
    }
    .header .brand .site-description {
        font-size: 9px;
        max-width: 100px;
        line-height: 1.1;
    }

    /* Телефон+email на ОДНОЙ строке: телефон слева (под лого), email справа (под бургер) */
    .header .tel {
        grid-area: phone;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
    .header .tel center,
    .header .tel .moduletable {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
    }
    .header .tel .custom {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 8px;
    }
    .header .tel .custom p {
        margin: 0 !important;
        line-height: 1.3;
        flex: 0 0 auto;
    }
    .header .tel .custom p:first-child { text-align: left; }
    .header .tel .custom p:last-child  { text-align: right; }
    .header .tel p:first-child,
    .header .tel p:first-child a {
        font-size: 16px !important;
        font-weight: 700;
        white-space: nowrap;
        color: #1f1410 !important;
    }
    /* Без SVG-«рубки» перед номером (по запросу владельца) */
    .header .tel p:first-child a::before,
    .header .tel a[href^="mailto:"]::before,
    .header .tel a::before,
    .header .tel a::after { content: none !important; display: none !important; background: none !important; }

    /* Email на моб — мельче */
    .header .tel p:nth-child(2),
    .header .tel a[href^="mailto:"] {
        font-size: 12px !important;
        color: #6a330e !important;
    }

    .header .header-search {
        /* contents — внутренние модули (cart + search) становятся прямыми grid-items */
        display: contents !important;
        float: none !important;
    }
    /* Первый модуль внутри .header-search — корзина: ПО ЦЕНТРУ между лого и бургером */
    .header .header-search > .moduletable:first-child,
    .header .header-search > .moduletable:has(#jshop_module_cart_mini) {
        grid-area: cart;
        justify-self: center;     /* по центру колонки */
        align-self: center;
        margin: 0 !important;
    }
    /* Остальные moduletable внутри .header-search (включая search form) — на 3-й ряд full-width */
    .header .header-search > .moduletable:not(:first-child),
    .header .header-search > div:has(.searchForm) {
        grid-area: search;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    .header .header-search .searchForm,
    .header .header-search form[name="searchForm"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    .header .header-search .content-form {
        display: flex !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    .header .header-search .content-form input[type="text"],
    .header .header-search .content-form .inputbox,
    .header .header-search #mod-search-searchword {
        flex: 1 1 0 !important;       /* flex shrink ниже content */
        min-width: 0 !important;       /* КРИТИЧНО: иначе input не сжимается ниже своего content */
        width: 100% !important;
        max-width: 100% !important;
        padding: 9px 12px !important;
        border: 1px solid #e5e0d8 !important;
        border-radius: 6px !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
        background: #fff;
    }
    .header .header-search .content-form input[type="submit"],
    .header .header-search .content-form .button {
        flex: 0 0 auto !important;
        padding: 9px 14px !important;
        background: #6a330e !important;
        border: 1px solid #6a330e !important;
        color: #fff !important;
        border-radius: 6px !important;
        font-size: 13px !important;
        font-weight: 600;
        cursor: pointer;
        box-sizing: border-box !important;
        white-space: nowrap;
    }

    /* --- БУРГЕР: переехал в шапку справа от корзины (grid-area: burger) --- */
    .header-inner .mobile-menu-toggle,
    .header .mobile-menu-toggle {
        grid-area: burger;
        justify-self: end;
        align-self: center;
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        background: #1f1410;
        border: 0;
        border-radius: 50% !important;
        color: #f5deb3;
        cursor: pointer;
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin: 0;
        position: relative;
    }
    .header-inner .mobile-menu-toggle > span,
    .header .mobile-menu-toggle > span {
        display: none !important;       /* в шапке только иконка ☰, текст не нужен */
    }
    .header-inner .mobile-menu-toggle::before,
    .header .mobile-menu-toggle::before {
        content: "";
        position: static !important;    /* отменяем абсолютное позиционирование */
        transform: none !important;
        display: block;
        width: 24px;
        height: 20px;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5deb3' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        left: auto;
        top: auto;
    }
    /* Бургер в .navigation1 (если ещё там лежит) — скрыть, т.к. дубликат */
    .navigation1 > .mobile-menu-toggle { display: none !important; }
    /* Корзина-кружок (top-right) — фиксированный размер, иконка по центру, бейдж в углу */
    #jshop_module_cart_mini .mycart_mini_txt > a {
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        background: #fff;
        border: 1.5px solid #6a330e !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        gap: 0 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,.08);
    }
    #jshop_module_cart_mini .mycart_mini_txt > a:hover {
        background: #f5f0eb;
        border-color: #6a330e !important;
    }
    #jshop_module_cart_mini .mycart_mini_txt > a::before {
        width: 22px !important;
        height: 22px !important;
        flex: 0 0 22px !important;
    }
    #jshop_module_cart_mini .count_prod_cart {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 20px;
        height: 20px;
        font-size: 11px;
        font-weight: 700;
        padding: 0 5px;
        border-radius: 10px;
        border: 2px solid #fff;
        line-height: 1;
        box-sizing: content-box;
    }

    /* --- Поиск (full-width под шапкой через grid-area: search) --- */
    .header .header-inner .jshop_search,
    .header .header-inner #jshop_search {
        grid-area: search;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    /* Если есть mod_jshopping_search где-то рядом — стянуть в grid-area search */
    .header .header-inner > .moduletable:has(#jshop_search),
    .header .header-inner > div:has(input[name="search"]) {
        grid-area: search;
        width: 100% !important;
    }
    .header input[type="text"][name="search"],
    .header input[type="search"],
    .header #jshop_search input {
        width: 100% !important;
        max-width: 100% !important;
        padding: 9px 12px !important;
        border: 1px solid #e5e0d8 !important;
        border-radius: 6px !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
        background: #fff;
    }
    /* Левую колонку (position-3) с поиском вынести из mmain — full-width */
    .mmain .lft {
        float: none !important;
        width: 100% !important;
        padding: 0 !important;
    }

    /* === МОДУЛИ в .lft (фильтр товаров + каталог) — сворачиваемые === */
    .mmain .lft .moduletable {
        margin: 0 0 10px !important;
        border-radius: 4px;
        overflow: hidden;
    }
    .mmain .lft .moduletable h3 {
        margin: 0 !important;
        padding: 12px 14px !important;
        background: #1f1410 !important;
        color: #f5deb3 !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: .5px;
        cursor: pointer;
        position: relative;
        display: block !important;
        text-align: center !important;
        user-select: none;
    }
    .mmain .lft .moduletable h3::after {
        content: "▾";
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 14px;
        transition: transform .3s ease;
    }
    .mmain .lft .moduletable.is-open h3::after {
        transform: translateY(-50%) rotate(180deg);
    }
    /* Тело модуля — скрыто по умолчанию (КРОМЕ script, чтобы не вылез как текст) */
    .mmain .lft .moduletable > *:not(h3):not(script) {
        display: none !important;
    }
    .mmain .lft .moduletable > script {
        display: none !important;       /* всегда скрыт — не отображается как текст */
    }
    .mmain .lft .moduletable.is-open > *:not(h3):not(script) {
        display: block !important;
    }
    /* Стилизация контента внутри */
    .mmain .lft .moduletable.is-open ul {
        list-style: none;
        padding: 0;
        margin: 0;
        background: #fff;
        border: 1px solid #e5e0d8;
        border-top: 0;
    }
    .mmain .lft .moduletable.is-open ul li {
        border-bottom: 1px solid #f0e8df;
    }
    .mmain .lft .moduletable.is-open ul li:last-child {
        border-bottom: 0;
    }
    .mmain .lft .moduletable.is-open ul li a {
        display: block;
        padding: 10px 14px;
        color: #1f1410;
        text-decoration: none;
        font-size: 14px;
    }
    .mmain .lft .moduletable.is-open ul li a:hover {
        background: #f7f5f3;
    }
    .mmain .lft .moduletable, .mmain .lft .custom { width: 100%; }
    .mmain .lft input[type="text"], .mmain .lft input[type="search"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 9px 12px !important;
        border: 1px solid #e5e0d8 !important;
        border-radius: 6px !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
    }

    /* --- ВЕРХНЯЯ ПЛАШКА .menu-1 (соцсети) — компактнее --- */
    .menu-1 { padding: 4px 0; font-size: 11px; }
    .menu-1 > .container { padding: 0 10px; justify-content: flex-end; }
    .menu-1 .pretext p { font-size: 10px; }

    /* --- ОСНОВНАЯ НАВИГАЦИЯ (категории каталога) — гамбургер --- */
    /* navigation1 — главное меню. На моб делаем скроллящимся горизонтальным списком */
    .navigation1, .navigation001 { padding: 0; }
    .navigation1 .container, .navigation001 .container { padding: 0; }
    .navigation1 .nav-collapse,
    .navigation001 .nav-collapse1 {
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
        background: #1f1410;
    }
    .navigation1.is-open .nav-collapse,
    .navigation001.is-open .nav-collapse1 {
        max-height: 1000px;
    }
    .navigation1 .nav-collapse ul.menu,
    .navigation001 .nav-collapse1 ul.menu {
        display: block !important;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    .navigation1 .nav-collapse ul.menu li,
    .navigation001 .nav-collapse1 ul.menu li {
        border-bottom: 1px solid #3a2417;
    }
    .navigation1 .nav-collapse ul.menu li a,
    .navigation001 .nav-collapse1 ul.menu li a {
        display: block;
        padding: 12px 16px;
        color: #f5deb3;
        font-size: 14px;
        text-decoration: none;
    }
    .navigation1 .nav-collapse ul.menu li a:hover {
        background: #2a1d18;
        color: #fff;
    }
    /* Бургер-кнопка — текст по центру, иконка ☰ слева как абсолютная */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;        /* текст по центру */
        position: relative;
        width: 100%;
        padding: 12px 14px;
        background: #1f1410;
        color: #f5deb3;
        border: 0;
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        cursor: pointer;
    }
    .mobile-menu-toggle > span {
        text-align: center;
    }
    .mobile-menu-toggle::before {
        content: "";
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        display: inline-block;
        width: 22px;
        height: 18px;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5deb3' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        margin: 0;
    }
    .navigation1.is-open .mobile-menu-toggle::before {
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5deb3' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='5' y1='5' x2='19' y2='19'/%3E%3Cline x1='19' y1='5' x2='5' y2='19'/%3E%3C/svg%3E");
    }
    /* На главной — скрыть проксированные блоки занимающие много места */
    .akcia, .info, .topt, .ssl, .posl, .news, .manuf2 { margin-bottom: 12px; }
    .akcia h3, .posl h3, .ssl h3, .topt h3 { font-size: 18px; margin: 14px auto; }

    /* --- ИНФО-блок (Бренды/Оплата/Ассортимент) на моб — в столбик === */
    /* Перебиваем template.css .info1 { padding: 0 15px } — лишний отступ в 15px */
    body .info,
    body .info > .container,
    body .info1 {
        padding: 0 !important;
        margin: 0 !important;
    }
    body .info1 .moduletable,
    body .info1 .custom { padding: 0 !important; margin: 0 !important; }
    /* .information — flex-column во всю ширину, item-ы стопкой */
    body .information {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        padding: 12px 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    body .information .item {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
        padding: 0 !important;
        margin: 0 !important;
        text-align: center !important;
    }
    body .information .item .pictures { min-height: auto !important; padding: 0 !important; margin: 0 !important; }
    body .information .item .item-title {
        display: block;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #6a330e;
        font-size: 15px;
        margin: 4px 0 6px;
    }
    body .information .item p,
    body .information .item .texxt {
        font-size: 13px !important;
        line-height: 1.5 !important;
        color: #444 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* --- НОВОСТИ K2 — в столбик --- */
    .news1 .k2ItemsBlock ul { flex-direction: column !important; }
    .news1 .k2ItemsBlock ul > li { flex: 1 1 100% !important; }

    /* --- КАТАЛОГ: КАРТОЧКИ --- */
    /* Фото вертикальное — object-fit: cover чтобы заполняло без обрезки сверху/снизу */
    .jshop_list_product #comjshop_list_product .product .podp .image .image_block {
        height: 220px !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .image .image_block .jshop_img {
        max-height: 220px;
        height: 100%;
        width: 100% !important;
        object-fit: cover;
        object-position: center center;
    }
    /* Compactify spacing */
    .jshop_list_product #comjshop_list_product .product .podp {
        padding: 6px !important;
        gap: 0;
    }
    .jshop_list_product #comjshop_list_product .product .podp .image {
        margin: 0 0 4px !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .name {
        margin: 0 0 2px !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .jshop_price {
        min-height: 1.2em !important;
        line-height: 1.2em !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .buttons {
        padding-top: 4px !important;
        gap: 3px !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .buttons > a.btn {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }
    /* По 1 карточке в ряд — удобнее читать описание */
    .jshop_list_product #comjshop_list_product .row-fluid {
        margin: 0 0 8px !important;
        flex-direction: column !important;
    }
    .jshop_list_product #comjshop_list_product .row-fluid > .sblock4,
    .jshop_list_product #comjshop_list_product .row-fluid > .sblock3,
    .jshop_list_product #comjshop_list_product .row-fluid > .sblock2 {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 0 8px !important;
    }
    /* Для 1 карточки в ряд — фото видно ЦЕЛИКОМ, карточка пониже (с запасом сверху/снизу) */
    .jshop_list_product #comjshop_list_product .product .podp {
        padding: 12px 8px !important;       /* запас сверху и снизу — фото не упирается в рамку */
    }
    .jshop_list_product #comjshop_list_product .product .podp .image {
        width: 100% !important;
        margin: 0 0 8px !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .image .image_block {
        width: 100% !important;
        height: 220px !important;             /* пониже, чем 240px */
        aspect-ratio: auto !important;
        overflow: visible !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    .jshop_list_product #comjshop_list_product .product .podp .image .image_block .jshop_img {
        width: auto !important;
        height: 100% !important;
        max-height: 200px !important;          /* фото меньше, чем box → есть просвет до рамки */
        max-width: 96% !important;
        object-fit: contain !important;
        object-position: center center !important;
        display: block;
    }
    .jshop_list_product #comjshop_list_product .product .podp .name {
        font-size: 14px !important;
        line-height: 1.3 !important;
        min-height: calc(1.3em * 2) !important;   /* минимум 2 строки для выравнивания карточек */
        max-height: none !important;              /* убрали лимит — название показывается ПОЛНОСТЬЮ */
        overflow: visible !important;
        display: block !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .name a {
        -webkit-line-clamp: unset !important;
        display: block !important;
        overflow: visible !important;
        white-space: normal !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .jshop_price {
        font-size: 14px !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .buttons {
        flex-direction: row !important;     /* кнопки в ряд на 1-карт. варианте */
        gap: 6px !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .buttons > a.btn {
        flex: 1 1 50% !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
    }

    /* --- ФИЛЬТР И СОРТИРОВКА: ВСЁ под одну кнопку.
           Используем display: none для надёжности (max-height иногда не срабатывает
           на span'ах и сложно вложенных элементах). */
    .jshop_list_product form#sort_count,
    .jshop_list_product .form_sort_count,
    .jshop_list_product .jshop.filters,
    .jshop_list_product .box_manufacrurer,
    .jshop_list_product .filter_price,
    .jshop_list_product .margin_filter,
    .jshop_list_product .box_products_sorting,
    .jshop_list_product .box_products_count_to_page,
    .jshop_list_product .box_category,
    .jshop_list_product .box_price_from,
    .jshop_list_product .box_price_to,
    .jshop_list_product .clear_filter {
        display: none !important;
    }
    /* При .filters-open — показываем всё */
    .jshop_list_product.filters-open form#sort_count,
    .jshop_list_product.filters-open .form_sort_count,
    .jshop_list_product.filters-open .jshop.filters,
    .jshop_list_product.filters-open .margin_filter {
        display: block !important;
    }
    .jshop_list_product.filters-open .box_manufacrurer,
    .jshop_list_product.filters-open .filter_price,
    .jshop_list_product.filters-open .box_products_sorting,
    .jshop_list_product.filters-open .box_products_count_to_page,
    .jshop_list_product.filters-open .box_category,
    .jshop_list_product.filters-open .box_price_from,
    .jshop_list_product.filters-open .box_price_to,
    .jshop_list_product.filters-open .clear_filter {
        display: inline-block !important;
    }
    /* Внутри открытых фильтров — column layout */
    .jshop_list_product.filters-open .form_sort_count {
        background: #f7f5f3;
        padding: 10px;
        border-radius: 4px;
        margin: 0 0 12px;
    }
    .jshop_list_product.filters-open .block_sorting_count_to_page {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
    }
    .jshop_list_product.filters-open .jshop.filters {
        background: #f7f5f3;
        padding: 10px;
        border-radius: 4px;
        margin: 0 0 12px;
    }
    .jshop_list_product .form_sort_count.show-mobile .block_sorting_count_to_page {
        display: flex !important;
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
        padding: 10px;
        background: #f7f5f3;
        border-radius: 4px;
    }
    .jshop_list_product .form_sort_count .block_sorting_count_to_page .control-group {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .jshop_list_product .form_sort_count .block_sorting_count_to_page .control-group .control-label {
        flex: 0 0 auto;
        font-size: 13px;
        color: #555;
    }
    .jshop_list_product .form_sort_count .block_sorting_count_to_page select {
        flex: 1 1 auto;
        font-size: 13px;
    }
    /* Скрываем пагинацию из этой строки на моб (она в самом конце листинга) */
    .jshop_list_product .form_sort_count .jshop_pagination { display: none; }
    /* Кнопка-toggle */
    .mobile-filter-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 10px 14px;
        background: #fff;
        color: #1f1410;
        border: 1px solid #e5e0d8;
        border-radius: 4px;
        font-size: 13px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .3px;
        cursor: pointer;
        margin: 0 0 6px;
    }
    .mobile-filter-toggle::before {
        content: "";
        display: inline-block;
        width: 18px;
        height: 18px;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f1410' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
    }

    /* --- СПИСОК ПОДКАТЕГОРИЙ в каталоге (.jshop_list_category) — компактный grid --- */
    .jshop_list_category .list_category .row-fluid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin: 0 0 12px !important;
    }
    .jshop_list_category .list_category .row-fluid > [class*="sblock"] {
        width: 100% !important;
        padding: 0 !important;
    }
    .jshop_list_category .list_category .sblock2,
    .jshop_list_category .list_category .sblock3,
    .jshop_list_category .list_category .sblock4 {
        width: 100% !important;
    }
    .jshop_list_category .list_category .jshop_categ.category {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        padding: 6px 4px;
        border: 1px solid #e5e0d8;
        border-radius: 4px;
        background: #fff;
        text-align: center;
    }
    .jshop_list_category .list_category .sblock2.image {
        width: 100% !important;
        max-width: 100% !important;
    }
    .jshop_list_category .list_category .sblock2.image img {
        max-width: 100% !important;
        height: 80px !important;
        object-fit: contain !important;
    }
    .jshop_list_category .list_category .category_name a {
        font-size: 11px !important;
        font-weight: 600;
        color: #1f1410 !important;
        text-decoration: none;
        line-height: 1.2;
    }
    /* Скрываем пустой список подкатегорий */
    .jshop_list_category:empty,
    #comjshop > .jshop_list_category > .list_category:empty { display: none; }

    /* --- БЛОК ГЛАВНОГО КАТАЛОГА на главной (position-12, id=121) — collapsible --- */
    #block-catalog-categories {
        margin: 0 0 12px;
    }
    #block-catalog-categories .content {
        max-height: 0;
        overflow: hidden;
        transition: max-height .35s ease;
    }
    #block-catalog-categories.is-open .content {
        max-height: 1200px;
    }
    #block-catalog-categories ul.catalog_categories {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px;
        list-style: none;
        padding: 8px;
        margin: 0;
    }
    #block-catalog-categories ul.catalog_categories li {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    #block-catalog-categories ul.catalog_categories li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 8px 4px;
        background: #fff;
        border: 1px solid #e5e0d8;
        border-radius: 4px;
        color: #1f1410;
        font-size: 11px;
        font-weight: 600;
        text-align: center;
        text-decoration: none;
        line-height: 1.2;
    }
    #block-catalog-categories ul.catalog_categories li a img {
        max-width: 60px;
        height: 60px;
        object-fit: contain;
        margin-bottom: 6px;
    }

    /* === КАРТОЧКА ТОВАРА: заголовок === */
    /* Шрифт меньше + по центру — h1 не должен занимать пол-экрана */
    .productfull h1,
    .jshop.productfull h1,
    body .productfull h1 > div {
        font-size: 18px !important;
        line-height: 1.3 !important;
        font-weight: 700 !important;
        text-align: center !important;
        margin: 8px 6px 12px !important;
        padding: 0 !important;
    }

    /* --- КАРТОЧКА ТОВАРА: галерея в карусель свайпом ---
           Таблица .productfull имеет 2 td — основное фото + thumbs справа.
           На моб: складываем в столбик, основное фото — горизонтальный
           scroll-snap слайдер. Все картинки внутри #list_product_image_middle
           становятся слайдами (вместо display:none для всех кроме первой). */
    .productfull table.jshop,
    .productfull table.jshop tbody,
    .productfull table.jshop tr {
        display: block !important;
        width: 100% !important;
    }
    .productfull table.jshop td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        text-align: left !important;
    }
    .productfull table.jshop td.image_middle { margin-bottom: 8px; }
    .productfull table.jshop td.jshop_img_description { padding-top: 8px !important; }

    /* === ВЁРСТКА БЛОКА ИНФО О ТОВАРЕ (td.jshop_img_description) === */
    /* Скрываем мини-миниатюры (есть свайп-карусель, миниатюры дублируют) */
    body #list_product_image_thumb { display: none !important; }

    /* Хиты/Рейтинг — flex по центру, в одну строку (не через inline-table) */
    body .productfull td.jshop_img_description .block_rating_hits {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-wrap: wrap;
        gap: 4px;
        text-align: center !important;
        margin: 10px 0 14px !important;
        font-size: 12px !important;
        color: #888 !important;
    }
    body .productfull td.jshop_img_description .block_rating_hits table {
        display: inline-flex !important;
        margin: 0 auto !important;
    }
    body .productfull td.jshop_img_description .block_rating_hits tbody { display: inline-flex !important; }
    body .productfull td.jshop_img_description .block_rating_hits tr {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px;
    }
    body .productfull td.jshop_img_description .block_rating_hits td {
        display: inline-flex !important;
        align-items: center !important;
        width: auto !important;
        padding: 0 !important;
        text-align: center !important;
        font-size: 12px !important;
    }
    body .productfull td.jshop_img_description .block_rating_hits .stars_no_active {
        display: inline-block !important;
        vertical-align: middle;
    }

    /* Бренд — крупно по центру, акцентный цвет */
    body .productfull .manufacturer_name {
        text-align: center !important;
        font-size: 13px !important;
        margin: 6px 0 12px !important;
        color: #888 !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    body .productfull .manufacturer_name span {
        color: #6a330e !important;
        font-weight: 700 !important;
        font-size: 16px;
        margin-left: 4px;
    }

    /* Старая цена — зачёркнуто, мелко */
    body .productfull .old_price {
        text-align: center !important;
        font-size: 12px !important;
        margin: 8px 0 2px !important;
        color: #999 !important;
    }
    body .productfull .old_price #old_price,
    body .productfull .old_price span.old_price {
        text-decoration: line-through !important;
        font-size: 14px !important;
        color: #999 !important;
        margin-left: 4px;
    }

    /* Цена — главный акцент, крупно, бордово */
    body .productfull .prod_price {
        text-align: center !important;
        font-size: 13px !important;
        margin: 4px 0 6px !important;
        color: #666 !important;
    }
    body .productfull .prod_price #block_price {
        display: inline-block;
        font-size: 26px !important;
        font-weight: 800 !important;
        color: #8b1a1a !important;
        margin-left: 4px;
        line-height: 1.1;
    }

    /* Доставка — мелким серым, центр */
    body .productfull .plusshippinginfo {
        display: block !important;
        text-align: center !important;
        font-size: 12px !important;
        color: #888 !important;
        margin: 2px 0 !important;
    }
    body .productfull .plusshippinginfo a {
        color: #6a330e !important;
        text-decoration: underline !important;
        text-underline-offset: 2px;
        font-weight: 600 !important;
    }
    body .productfull .deliverytime {
        text-align: center !important;
        font-size: 12px !important;
        color: #666 !important;
        margin: 4px 0 12px !important;
        padding: 0 8px;
    }

    /* Вес — по центру, рядом с доставкой по стилю */
    body .productfull .productweight {
        display: block !important;
        text-align: center !important;
        font-size: 12px !important;
        color: #666 !important;
        margin: 4px 0 12px !important;
    }
    body .productfull .productweight #block_weight {
        color: #1f1410 !important;
        font-weight: 700 !important;
        margin-left: 4px;
    }

    /* Склад — зелёная плашка по центру */
    body .productfull .qty_in_stock {
        display: block !important;
        text-align: center !important;
        font-size: 12px !important;
        margin: 6px auto 14px !important;
        padding: 6px 12px !important;
        color: #2e7d32 !important;
        background: rgba(46, 125, 50, 0.08);
        border-radius: 4px;
        width: fit-content;
        max-width: 80% !important;
    }
    body .productfull .qty_in_stock #product_qty {
        font-weight: 700;
        margin-left: 4px;
    }

    /* Пустые служебные блоки */
    body .productfull .extra_fields:empty,
    body .productfull .not_available:empty { display: none !important; }

    /* === БЛОК С КОЛИЧЕСТВОМ + КНОПКАМИ — переверстать table в vertical flex === */
    body .productfull table.prod_buttons,
    body .productfull table.prod_buttons tbody,
    body .productfull table.prod_buttons tr {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body .productfull table.prod_buttons td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        text-align: center !important;
        border: 0 !important;
    }
    body .productfull .prod_qty {
        font-size: 13px !important;
        color: #555 !important;
        margin: 8px 0 4px !important;
    }
    body .productfull .prod_qty_input { margin: 0 0 14px !important; }
    body .productfull .prod_qty_input input[name="quantity"] {
        width: 70px !important;
        text-align: center !important;
        padding: 8px 6px !important;
        border: 1px solid #d0c8be !important;
        border-radius: 4px !important;
        font-size: 16px !important;
        font-weight: 600;
        background: #fff !important;
        margin: 0 auto !important;
        display: inline-block !important;
    }

    /* Контейнер кнопок — vertical flex по центру (макс. специфичность чтобы перебить общий td:block) */
    body .productfull table.prod_buttons td.buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 6px auto 8px !important;
        padding: 0 8px !important;
        width: 100% !important;
        text-align: center !important;
    }
    /* В корзину — главная CTA */
    body .productfull table.prod_buttons td.buttons input.btn-buy,
    body .productfull table.prod_buttons td.buttons input.btn-success {
        display: block !important;
        width: 100% !important;
        max-width: 320px !important;
        padding: 13px 18px !important;
        background: #6a330e !important;
        background-image: none !important;
        color: #fff !important;
        border: 0 !important;
        border-radius: 6px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        cursor: pointer !important;
        box-shadow: 0 2px 8px rgba(106, 51, 14, 0.25);
        text-shadow: none !important;
        margin: 0 auto !important;
    }
    /* В список пожеланий — secondary */
    body .productfull table.prod_buttons td.buttons input.button:not(.btn-buy):not(.btn-success) {
        display: block !important;
        width: 100% !important;
        max-width: 320px !important;
        padding: 10px 16px !important;
        background: transparent !important;
        background-image: none !important;
        color: #6a330e !important;
        border: 1px solid #6a330e !important;
        border-radius: 6px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        text-shadow: none !important;
        cursor: pointer !important;
        margin: 0 auto !important;
    }
    body .productfull #jshop_image_loading { display: none !important; }

    /* === КАРУСЕЛЬ ФОТО ТОВАРА === */
    /* Главное фото — большой свайп-слайдер, 1 фото = 1 слайд НА ВСЮ ШИРИНУ ЭКРАНА */
    body .productfull td.image_middle {
        padding: 0 !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    body .productfull #list_product_image_middle {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        position: relative;
    }
    body .productfull #list_product_image_middle::-webkit-scrollbar {
        height: 0 !important;
        display: none;
    }
    /* Все .lightbox-ссылки — слайды НА ВСЮ ШИРИНУ ЭКРАНА, квадрат для большого фото */
    body .productfull #list_product_image_middle > a.lightbox,
    body .productfull #list_product_image_middle > a[id^="main_image_full_"] {
        display: flex !important;
        flex: 0 0 100vw !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vw !important;           /* квадрат — фото большое */
        max-height: 100vh !important;
        scroll-snap-align: start !important;
        scroll-snap-stop: always !important;
        margin: 0 !important;
        padding: 0 !important;
        align-items: center;
        justify-content: center;
        background: #fff;
    }
    body .productfull #list_product_image_middle > a img {
        width: auto !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
        display: block !important;
        margin: 0 auto !important;
    }
    /* Миниатюры — горизонтальная карусель индикаторов под главным фото */
    body .productfull #list_product_image_thumb {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 6px !important;
        padding: 8px 12px !important;
        margin: 0 !important;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;       /* не переходит на новую строку — единственная горизонталь */
        justify-content: flex-start !important;
    }
    body .productfull #list_product_image_thumb::-webkit-scrollbar {
        height: 4px;
    }
    body .productfull #list_product_image_thumb::-webkit-scrollbar-thumb {
        background: #6a330e;
        border-radius: 2px;
    }
    body .productfull #list_product_image_thumb img {
        flex: 0 0 56px !important;
        width: 56px !important;
        height: 56px !important;
        border: 1px solid #e5e0d8 !important;
        border-radius: 4px !important;
        object-fit: cover !important;
        cursor: pointer;
    }

    /* Лейбл и manufacturer-лого — над галереей */
    .productfull td.image_middle .product_label {
        position: absolute;
        top: 8px; left: 8px;
        z-index: 2;
    }
    .productfull td.image_middle { position: relative; }
    .productfull td.image_middle .manufacturer_logo {
        text-align: center;
        margin: 6px 0 0;
    }
    .productfull td.image_middle .manufacturer_logo img {
        max-height: 32px;
        width: auto;
    }

    /* Миниатюры → горизонтальная навигация под каруселью */
    .productfull #list_product_image_thumb {
        display: flex !important;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
        padding: 6px 0 0;
    }
    .productfull #list_product_image_thumb img {
        width: 56px !important;
        height: 56px !important;
        border: 1px solid #e5e0d8;
        border-radius: 4px;
        cursor: pointer;
        object-fit: cover;
    }
    /* td.jshop_img_description: рейтинг, бренд, цена, кнопки — выровнять текстом */
    .productfull td.jshop_img_description .manufacturer_name,
    .productfull td.jshop_img_description .old_price,
    .productfull td.jshop_img_description .prod_price,
    .productfull td.jshop_img_description .plusshippinginfo,
    .productfull td.jshop_img_description .deliverytime,
    .productfull td.jshop_img_description .qty_in_stock {
        text-align: center;
        margin: 6px 0;
    }
    .productfull table.prod_buttons,
    .productfull table.prod_buttons tbody,
    .productfull table.prod_buttons tr {
        display: block !important;
        width: 100% !important;
    }
    .productfull table.prod_buttons td {
        display: inline-block !important;
        width: auto !important;
        vertical-align: middle;
    }
    .productfull table.prod_buttons .buttons {
        display: block !important;
        width: 100% !important;
        margin-top: 8px;
        text-align: center;
    }
    .productfull .btn-buy {
        background: #8b1a1a !important;
        border-color: #8b1a1a !important;
        color: #fff !important;
        padding: 8px 24px !important;
        font-weight: 600;
    }

    /* --- ПОДВАЛ: колонки в столбик уже работает (флекс) — просто уменьшить отступы --- */
    .footer { padding: 24px 0 12px; }
    .footer > .container { padding: 0 12px; gap: 20px 0; }
}

/* --- Мини-моб <=480 --- */
@media (max-width: 480px) {
    .header .brand .site-description { display: none; }
    .jshop_list_product #comjshop_list_product .product .podp .image .image_block {
        height: 200px !important;
    }
    .jshop_list_product #comjshop_list_product .product .podp .image .image_block .jshop_img {
        max-height: 200px;
    }
}

/* По умолчанию (десктоп) — скрываем мобильные кнопки */
.mobile-filter-toggle,
.mobile-menu-toggle { display: none; }
