/* ==========================================
   ГЛОБАЛЬНЫЕ СТИЛИ И ВЕРСТКА ПЕРЕНЕСЕННЫХ CSS (CLS FIXES)
   ========================================== */

@media (min-width: 992px) {
    :root { 
        --porto-container-spacing: 20px; 
        --porto-fluid-spacing: 30px; 
    }
}

.porto-posts-grid .owl-carousel.porto-carousel .owl-nav button { 
    transition: color .3s, background-color .3s; 
}
.porto-posts-grid .owl-carousel.porto-carousel .owl-nav button:hover { 
    background-color: var(--porto-color-dark) !important; 
    color: #fff !important; 
}

.img-full a,
.img-full .wpb_wrapper,
.img-full .vc_single_image-wrapper { 
    display: block; 
    height: 100%; 
    width: 100%; 
}

.woocommerce-account #main.wide.column1 .main-content { 
    padding-top: 3.0625rem; 
    padding-bottom: 3.5rem; 
}

/* ==========================================
   OPTIMIZED INLINE LAYOUT & PREVENT CLS
   ========================================== */

.page-title-wrap.d-none { display: block !important; }
.page-title-wrap.d-none .page-title { margin-bottom: 0.5rem; }

img[loading="lazy"]:not([width]):not([height]) { aspect-ratio: 1 / 1; }
.shop-loop-before { min-height: 50px; }
.catalog-buttons-wrapper { min-height: 60px; }
.products, .porto-products-archive .products { min-height: 200px; }
body { font-display: swap; }

@media (max-width: 767px) {
    .single-product .product-summary-wrap .price { display: block; margin-bottom: 10px; }
    .single-product .product-summary-wrap .cart { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
    .single-product .product-summary-wrap .quantity { margin-right: 10px; }
    .single-product .product-summary-wrap .single_add_to_cart_button { flex: 1 1 auto; min-width: 150px; }
}

@media (max-width: 768px) {
    .category-title.h2 { clear: both !important; display: block !important; margin-bottom: 15px !important; width: 100% !important; }
    .shop-loop-before { clear: both !important; padding-top: 15px !important; margin-top: 0 !important; display: flex !important; flex-wrap: wrap !important; align-items: center !important; justify-content: flex-start !important; gap: 10px !important; border-top: 1px solid #e7e7e7 !important; }
    .shop-loop-before > * { flex: 0 0 auto !important; max-width: 100% !important; }
    .shop-loop-before .woocommerce-ordering, .shop-loop-before .woocommerce-viewing, .shop-loop-before .woocommerce-result-count, .shop-loop-before .gridlist-toggle { display: inline-flex !important; align-items: center !important; margin: 0 !important; float: none !important; }
    .shop-loop-before .gridlist-toggle { margin-left: auto !important; }
    .shop-loop-before select { max-width: 120px !important; padding: 4px 6px !important; font-size: 14px !important; }
    .catalog-buttons-wrapper { flex-direction: column !important; gap: 10px !important; margin-bottom: 15px !important; clear: both !important; }
    .catalog-btn, .sale-btn { width: 100% !important; justify-content: center !important; padding: 12px 20px !important; font-size: 16px !important; }
}

@media (max-width: 480px) {
    .shop-loop-before { flex-direction: column !important; align-items: stretch !important; gap: 8px !important; }
    .shop-loop-before .gridlist-toggle { margin-left: 0 !important; align-self: center !important; }
    .shop-loop-before select, .shop-loop-before .woocommerce-ordering, .shop-loop-before .woocommerce-viewing, .shop-loop-before .woocommerce-ordering select, .shop-loop-before .woocommerce-viewing select { width: 100% !important; max-width: 100% !important; }
    .catalog-buttons-wrapper { flex-direction: column !important; gap: 8px !important; }
    .catalog-btn, .sale-btn { font-size: 14px !important; padding: 10px 15px !important; }
}

/* ==========================================
   FONT-DISPLAY: SWAP ДЛЯ ВСЕХ ШРИФТОВ
   ========================================== */

@font-face { font-family: "Font Awesome 6 Free"; font-display: swap !important; }
@font-face { font-family: "Font Awesome 6 Brands"; font-display: swap !important; }
@font-face { font-family: "Font Awesome 5 Free"; font-display: swap !important; }
@font-face { font-family: "Font Awesome 5 Brands"; font-display: swap !important; }
@font-face { font-family: "FontAwesome"; font-display: swap !important; }
@font-face { font-family: "porto"; font-display: swap !important; }

* { font-display: swap !important; }

.fa, .fas, .far, .fal, .fab, 
.fa-solid, .fa-regular, .fa-brands,
.porto-icon, .vc_icon_element-icon {
    font-display: swap !important;
}

/* ==========================================
   HOME & HOTSPOTS
   ========================================== */

.img-height-equal > .wpb_wrapper > * { height: calc( ( 100% - 40px ) / 3 ); }

.custom-hotspot i::before { box-shadow: 0 0 6px 0 rgb(17,17,17); border-radius: 50%; margin: 0; }
.custom-hotspot .porto-hotspot-icon { z-index: 1; }
.custom-hotspot.porto-hotspot::before { content: ""; display: block; position: absolute; top: 0; bottom: 0; left: 0; right: 0; width: 100%; height: 100%; background: #F2F1EF; border-radius: 50%; animation: zooming 2s infinite; }
.custom-hotspot { transition: transform .3s; }
.custom-hotspot:hover { transform: scale(1.1) translateZ(0); }

@keyframes zooming {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(2); }
}

.custom-video .mejs-video,
.custom-video video { height: auto !important; aspect-ratio: 911/350; }
.custom-video video { object-fit: cover; }
.custom-video .mejs-controls { display: none; }
.custom-video .wp-video,
.custom-video .mejs-video { width: 1920px !important; }

/* ==========================================
   MEGAMENU
   ========================================== */

.mega-menu .wide .popup { box-shadow: 0px 0px 2px 2px rgba(0,0,0,0.1); }
.mega-menu .wpb_text_column ul li { margin-bottom: 0.94rem; }
.mega-menu .wpb_text_column ul li a { color: inherit; }
.mega-menu .wpb_text_column ul li:hover a { color: var(--porto-secondary-color); }
.mega-menu .menu-block .vc_btn3.custom-pt-btn { min-width: 13.4375rem; display: inline-flex; align-items: center; }
.mega-menu .menu-block .btn-long .vc_btn3.custom-pt-btn { min-width: 14.0625rem; }
.mega-menu .menu-block .vc_btn3 i { flex: 1; text-align: right; }

/* ==========================================
   CHECKOUT PAGE & WISHLIST
   ========================================== */

body.woocommerce-checkout #main .container-fluid { padding-bottom: 5.35rem; }

@media (max-width: 991px) {
    body.woocommerce-checkout #main .container-fluid { padding-bottom: 3.8rem; }
}

.woocommerce-wishlist #main>.container-fluid { padding-top: 2rem; padding-bottom: 2rem; }

/* ==========================================
   ОТМЕНА ЗАГЛАВНЫХ БУКВ
   ========================================== */

h1, h2, h3, h4, h5, h6,
.entry-title,
.product-title,
.woocommerce-loop-product__title,
.menu-item a {
    text-transform: none !important;
}

.widget .widget-title,
.widget.woocommerce.widget_rating_filter,
.sidebar .widget > title,
.woocommerce-widget-layered-nav-list,
.porto-products-filter-title {
    text-transform: none !important;
}

/* ==========================================
   SEO-ФИЛЬТРЫ
   ========================================== */

.filter-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid #e7e7e7;
    border-top: 1px solid #e7e7e7;
}

.filter-link-item { display: inline-block; margin: 0; padding: 0; }

.filter-link-item a {
    display: block;
    padding: 3px 10px;
    background: #f5f5f5;
    color: #333;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.filter-link-item a:hover { background: #1c70c7; color: #fff; text-decoration: none; }

@media (max-width: 768px) {
    .filter-links-list { gap: 3px 4px; padding: 6px 0; }
    .filter-link-item a { font-size: 11px; padding: 2px 8px; border-radius: 12px; }
}

/* ==========================================
   ВЫРАВНИВАНИЕ ЭЛЕМЕНТОВ СОРТИРОВКИ
   ========================================== */

body.tax-product_brand .shop-loop-before {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 15px 20px !important;
}

body.tax-product_brand .shop-loop-before > * { margin: 0 !important; float: none !important; }

body.tax-product_brand .woocommerce-ordering,
body.tax-product_brand .woocommerce-viewing,
body.tax-product_brand .woocommerce-result-count,
body.tax-product_brand .gridlist-toggle {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
}

body.tax-product_brand .gridlist-toggle { margin-left: auto !important; }

body.tax-product_brand .woocommerce-ordering label,
body.tax-product_brand .woocommerce-viewing label,
body.tax-product_brand .woocommerce-ordering select,
body.tax-product_brand .woocommerce-viewing select {
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 5px 0 0 !important;
    width: auto !important;
}

@media (max-width: 768px) {
    body.tax-product_brand .shop-loop-before { justify-content: center !important; gap: 8px !important; }
    body.tax-product_brand .gridlist-toggle { margin-left: 0 !important; }
    body.tax-product_brand .woocommerce-result-count { width: 100% !important; text-align: center !important; }
}

/* ==========================================
   ИСПРАВЛЕНИЕ ВЫХОДА ТЕКСТА ЗА ГРАНИЦЫ
   ========================================== */

.term-description,
.woocommerce-products-header__description,
.product-brand-description,
.page-description,
.wpb_text_column,
.porto-block .wpb_text_column,
.porto-block .wpb_wrapper {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
}

.porto-block table,
.term-description table,
.wpb_text_column table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem !important;
}

.term-description img,
.wpb_text_column img,
.porto-block img { max-width: 100% !important; height: auto !important; }

.tax-product_brand .term-description,
.tax-product_cat .term-description { max-width: 100% !important; overflow: hidden !important; }

.term-description strong,
.term-description b,
.wpb_text_column strong,
.wpb_text_column b { word-break: break-word !important; }

@media (max-width: 767px) {
    .term-description,
    .wpb_text_column,
    .product-brand-description { font-size: 14px !important; line-height: 1.6 !important; }
    .term-description,
    .wpb_text_column { padding-left: 5px !important; padding-right: 5px !important; }
    .term-description h1, .term-description h2, .term-description h3,
    .wpb_text_column h1, .wpb_text_column h2, .wpb_text_column h3 {
        font-size: 1.2em !important;
        word-break: break-word !important;
    }
}

/* ==========================================
   CUSTOM SEO FILTERS
   ========================================== */

.custom-seo-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 20px;
    margin-bottom: 15px;
    padding: 10px 5px;
    border-bottom: 1px solid #e7e7e7;
}

.custom-seo-filters-label { font-weight: 600; color: #333; font-size: 14px; }

.custom-seo-filters-list { display: flex; flex-wrap: wrap; gap: 8px 12px; list-style: none; margin: 0; padding: 0; }
.custom-seo-filters-list li { margin: 0; padding: 0; }

.custom-seo-filters-list a {
    display: block;
    padding: 4px 12px;
    background: #f5f5f5;
    color: #333;
    font-size: 13px;
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.custom-seo-filters-list a:hover { background: #1c70c7; color: #fff; }

/* ==========================================
   CUSTOM SUBCATEGORY GRID
   ========================================== */

.custom-subcategory-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    justify-content: flex-start;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e7e7e7;
}

.custom-subcategory-item { flex: 0 0 auto; width: 80px; text-align: center; }
.custom-subcategory-item a { display: block; text-decoration: none; transition: all 0.2s ease; }

.custom-subcategory-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e7e7e7;
    transition: all 0.2s ease;
}

.custom-subcategory-item a:hover img { border-color: #1c70c7; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.custom-subcategory-item .subcategory-name {
    display: block;
    font-size: 11px;
    margin-top: 5px;
    color: #333;
    text-align: center;
    word-break: break-word;
}

.category-subcategories { border-bottom: 2px solid #1c70c7; margin-bottom: 25px; }

/* ==========================================
   CUSTOM TOP PAGINATION
   ========================================== */

.custom-top-pagination { margin-bottom: 20px; padding: 10px 0; border-bottom: 1px solid #e7e7e7; text-align: center; }

.custom-top-pagination .page-numbers {
    display: inline-block;
    padding: 5px 12px;
    margin: 0 2px;
    background: #f5f5f5;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.custom-top-pagination .page-numbers.current { background: #1c70c7; color: #fff; }
.custom-top-pagination .page-numbers:hover:not(.current) { background: #e7e7e7; }

@media (max-width: 768px) {
    .custom-subcategory-grid { gap: 10px; justify-content: center; padding: 10px 5px !important; margin-left: 0 !important; margin-right: 0 !important; }
    .custom-subcategory-item { width: 60px; }
    .custom-seo-filters { flex-direction: column; align-items: center; gap: 8px; }
    .custom-seo-filters-list a { font-size: 12px; padding: 3px 10px; }
}

@media (max-width: 480px) {
    .custom-subcategory-item { width: 50px; }
    .custom-subcategory-grid { gap: 8px; padding: 10px 5px !important; }
}

/* ==========================================
   ИСПРАВЛЕНИЕ ПАГИНАЦИИ
   ========================================== */

.tax-product_cat .pagination-wrap,
.tax-product_brand .pagination-wrap,
.woocommerce-page .pagination-wrap {
    margin-bottom: 20px !important;
    clear: both !important;
    display: block !important;
    width: 100% !important;
}

.tax-product_brand .shop-loop-after,
.woocommerce-page .shop-loop-after {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 15px !important;
    margin-top: 0 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    clear: both !important;
}

.tax-product_brand .shop-loop-after .pagination-wrap,
.woocommerce-page .shop-loop-after .pagination-wrap {
    margin: 0 !important; float: none !important; display: inline-flex !important; align-items: center !important;
}

.tax-product_brand .shop-loop-after .woocommerce-viewing,
.woocommerce-page .shop-loop-after .woocommerce-viewing {
    margin: 0 !important; float: none !important; display: inline-flex !important; align-items: center !important;
}

@media (max-width: 768px) {
    .tax-product_brand .shop-loop-after,
    .woocommerce-page .shop-loop-after {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        padding: 15px 0 !important;
        clear: both !important;
    }
    .tax-product_brand .shop-loop-after .pagination-wrap,
    .tax-product_brand .shop-loop-after .woocommerce-viewing,
    .woocommerce-page .shop-loop-after .pagination-wrap,
    .woocommerce-page .shop-loop-after .woocommerce-viewing {
        display: inline-flex !important; align-items: center !important; justify-content: center !important;
        float: none !important; margin: 0 !important; width: auto !important; max-width: 100% !important;
    }
    .tax-product_brand .pagination-wrap .page-numbers,
    .woocommerce-page .pagination-wrap .page-numbers {
        padding: 5px 8px !important; font-size: 14px !important; line-height: 1.4 !important;
        margin: 0 2px !important; display: inline-block !important;
    }
    .tax-product_brand .woocommerce-viewing label,
    .tax-product_brand .woocommerce-viewing select,
    .woocommerce-page .woocommerce-viewing label,
    .woocommerce-page .woocommerce-viewing select {
        font-size: 14px !important; padding: 4px 6px !important; margin: 0 3px 0 0 !important;
        display: inline-block !important; width: auto !important;
    }
}

.woocommerce-page .pagination-wrap,
.tax-product_cat .pagination-wrap,
.tax-product_brand .pagination-wrap {
    margin-bottom: 25px !important; padding-bottom: 10px !important; clear: both !important;
}

.porto-separator,
.shop-loop-after .porto-separator,
.woocommerce-page .porto-separator { margin-top: 0 !important; clear: both !important; }

.shop-loop-after { margin-top: 0 !important; padding-top: 10px !important; }

/* ==========================================
   МОБИЛЬНЫЙ ФИЛЬТР-БУРГЕР (FULLSCREEN)
   ========================================== */

.mobile-toggle { display: none !important; }
.side-nav-panel-overlay, #side-nav-panel { display: none !important; }
.page-wrapper { margin-left: 0 !important; transform: none !important; }
.side-nav-panel-effect-1 .page-wrapper { transition: none !important; }
body.admin-bar #side-nav-panel { display: none !important; }

.mobile-filter-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 99999;
    display: none; align-items: stretch; justify-content: stretch;
    padding: 0; animation: fadeIn 0.3s ease;
}

.mobile-filter-overlay.open { display: flex !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.mobile-filter-menu {
    background: #fff; width: 100%; max-width: 100%; height: 100%; max-height: 100%;
    padding: 15px 20px; box-shadow: none; border-radius: 0; overflow: hidden;
    display: flex; flex-direction: column; animation: none;
}

.mobile-filter-header {
    display: flex; justify-content: flex-end; align-items: center;
    padding-bottom: 15px; border-bottom: 1px solid #e7e7e7; margin-bottom: 15px; flex-shrink: 0;
}

.mobile-filter-close {
    font-size: 24px; cursor: pointer; color: #999; background: none; border: none;
    padding: 0; transition: color 0.2s;
}

.mobile-filter-close:hover { color: #333; }
.mobile-filter-content { flex: 1; overflow: hidden; position: relative; }
.mobile-menu-scroller { height: 100%; overflow: hidden; }
.mobile-menu-wrapper { display: flex; transition: transform 0.3s ease; height: 100%; width: 100%; }
.mobile-menu-level { flex: 0 0 100%; overflow-y: auto; max-height: 100%; padding-right: 5px; }
.mobile-filter-categories { list-style: none; padding: 0; margin: 0; }

.mobile-filter-cat-item {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 5px; border-bottom: 1px solid #f5f5f5; padding: 5px 0;
}

.mobile-filter-cat-item .menu-link {
    flex: 1; display: block; padding: 10px 12px; border-radius: 4px;
    font-weight: 500; color: #333; text-decoration: none; transition: all 0.2s; font-size: 15px;
}

.mobile-filter-cat-item .menu-link:hover { background: #f5f5f5; color: #1c70c7; }
.mobile-filter-cat-item .menu-link.has-children { cursor: pointer; }

.mobile-filter-cat-item .menu-arrow {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    cursor: pointer; color: #999; background: none; border: none; transition: color 0.2s; flex-shrink: 0;
}

.mobile-filter-cat-item .menu-arrow:hover { color: #1c70c7; }
.mobile-filter-cat-item .menu-arrow i { font-size: 14px; }

.menu-back { padding: 10px 0; border-bottom: 1px solid #e7e7e7; margin-bottom: 10px; }

.back-link {
    display: flex; width: 100%; align-items: center; gap: 8px; color: #333;
    text-decoration: none; font-weight: 500; padding: 12px 0; background: none;
    border: none; cursor: pointer; transition: color 0.2s; font-size: inherit;
}

.back-link:hover { color: #1c70c7; }
.back-link i { font-size: 14px; }

.menu-title { padding: 5px 0 15px 0; border-bottom: 2px solid #1c70c7; margin-bottom: 10px; }
.menu-title .parent-category-link { display: block; font-size: 16px; font-weight: 600; color: #333; text-decoration: none; padding: 5px 0; transition: color 0.2s; }
.menu-title .parent-category-link:hover { color: #1c70c7; }
.mobile-filter-links-section { display: none !important; }

/* ==========================================
   КНОПКИ "КАТАЛОГ" И "ТОВАРЫ СО СКИДКОЙ"
   ========================================== */

.catalog-buttons-wrapper {
    display: flex; justify-content: center; align-items: center;
    gap: 15px; padding: 15px 0; margin-bottom: 20px; border-bottom: 1px solid #e7e7e7;
}

.catalog-btn {
    display: inline-flex; align-items: center; gap: 10px; padding: 12px 30px;
    background: #1c70c7; border-radius: 4px; color: #fff; font-size: 18px; font-weight: 700;
    text-transform: uppercase; cursor: pointer; transition: background 0.2s ease;
    text-decoration: none; border: none;
}

.catalog-btn:hover { background: #14518c; text-decoration: none; color: #fff; }

.catalog-btn-bars {
    display: inline-block; width: 22px; height: 16px; background: #fff;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 16'%3E%3Cpath d='M0 1h18v2H0V1zm0 6h18v2H0V7zm0 6h18v2H0v-2z'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 16'%3E%3Cpath d='M0 1h18v2H0V1zm0 6h18v2H0V7zm0 6h18v2H0v-2z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
}

.sale-btn {
    display: inline-flex; align-items: center; gap: 10px; padding: 12px 30px;
    background: #d32f2f; border-radius: 4px; color: #fff; font-size: 18px; font-weight: 700;
    text-transform: uppercase; cursor: pointer; transition: background 0.2s ease;
    text-decoration: none; border: none;
}

.sale-btn:hover { background: #b71c1c; text-decoration: none; color: #fff; }

.sale-icon {
    display: inline-block; width: 20px; height: 20px; background: #fff;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.3 9.2l-3.5-3.5c-.2-.2-.5-.2-.7 0L14 10.8 11.5 8.3c-.2-.2-.5-.2-.7 0l-4.7 4.7-3.1-3.1c-.2-.2-.5-.2-.7 0L.3 11.7c-.4.4-.4 1 0 1.4l3.5 3.5c.2.2.5.2.7 0l5.6-5.6 2.5 2.5c.2.2.5.2.7 0l6.4-6.4 2.8 2.8c.2.2.5.2.7 0l2.1-2.1c.4-.4.4-1 0-1.4z'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.3 9.2l-3.5-3.5c-.2-.2-.5-.2-.7 0L14 10.8 11.5 8.3c-.2-.2-.5-.2-.7 0l-4.7 4.7-3.1-3.1c-.2-.2-.5-.2-.7 0L.3 11.7c-.4.4-.4 1 0 1.4l3.5 3.5c.2.2.5.2.7 0l5.6-5.6 2.5 2.5c.2.2.5.2.7 0l6.4-6.4 2.8 2.8c.2.2.5.2.7 0l2.1-2.1c.4-.4.4-1 0-1.4z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
}

@media (max-width: 768px) {
    .catalog-buttons-wrapper { flex-direction: column; gap: 10px; padding: 10px 0; }
    .catalog-btn, .sale-btn { width: 100%; justify-content: center; padding: 12px 20px; font-size: 16px; }
}

@media (max-width: 480px) {
    .catalog-btn, .sale-btn { font-size: 14px; padding: 10px 15px; }
    .catalog-btn-bars { width: 18px; height: 14px; }
    .sale-icon { width: 16px; height: 16px; }
}

/* ==========================================
   ВЫЗОВЫ & ТЕЛЕФОНЫ
   ========================================== */
a.vc_icon_element-link[href^="tel:"] { display: inline-block !important; visibility: visible !important; opacity: 1 !important; }

@media (max-width: 991px) {
    .porto-sicon-box.d-none.d-lg-flex { display: none !important; }
}

/* ==========================================
   СТРАНИЦА "ТОВАРЫ СО СКИДКОЙ"
   ========================================== */

.sale-page-wrapper { padding: 30px 0; }
.sale-page-title { font-size: 28px; font-weight: 700; margin-bottom: 30px; text-align: center; }
.sale-categories-list { display: flex; flex-direction: column; gap: 20px; }
.sale-category-item { border: 1px solid #e7e7e7; border-radius: 8px; overflow: hidden; background: #fff; }

.sale-category-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; background: #f8f8f8; cursor: pointer; transition: background 0.2s;
}

.sale-category-header:hover { background: #f0f0f0; }
.sale-category-link { font-size: 18px; font-weight: 600; color: #333; text-decoration: none; }
.sale-category-link:hover { color: #1c70c7; }
.sale-category-toggle { font-size: 22px; font-weight: 300; color: #999; transition: transform 0.3s; }
.sale-category-item.open .sale-category-toggle { transform: rotate(45deg); }

.sale-subcategories-list {
    padding: 10px 20px; background: #fafafa; border-bottom: 1px solid #e7e7e7;
    display: flex; flex-wrap: wrap; gap: 10px 20px;
}

.sale-subcategory-link {
    font-size: 14px; color: #555; text-decoration: none; padding: 4px 0;
    border-bottom: 2px solid transparent; transition: all 0.2s;
}

.sale-subcategory-link:hover { color: #1c70c7; border-bottom-color: #1c70c7; }

.sale-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; padding: 20px; }

.sale-product-item {
    position: relative; border: 1px solid #e7e7e7; border-radius: 6px;
    padding: 15px; text-align: center; transition: box-shadow 0.3s;
}

.sale-product-item:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.sale-product-link { text-decoration: none; color: #333; }
.sale-product-link img { max-width: 100%; height: auto; margin-bottom: 10px; }
.sale-product-title { font-size: 14px; font-weight: 500; margin-bottom: 8px; min-height: 40px; }
.sale-product-price { display: flex; justify-content: center; align-items: center; gap: 10px; }
.sale-product-old-price { text-decoration: line-through; color: #999; font-size: 14px; }
.sale-product-new-price { font-size: 18px; font-weight: 700; color: #d32f2f; }

.sale-badge {
    position: absolute; top: 10px; right: 10px; background: #d32f2f; color: #fff;
    padding: 4px 10px; border-radius: 4px; font-size: 14px; font-weight: 700;
}

.sale-empty-message { text-align: center; font-size: 18px; color: #999; padding: 50px 0; }

@media (max-width: 768px) {
    .sale-products-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; padding: 15px; }
    .sale-product-title { font-size: 13px; min-height: 30px; }
    .sale-category-link { font-size: 16px; }
}

@media (max-width: 480px) {
    .sale-products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px; }
    .sale-product-item { padding: 10px; }
}

/* ==========================================
   ПАНЕЛЬ ФИЛЬТРОВ
   ========================================== */

.mm-panel-categories { padding: 0 5px; }
.mm-header { margin-bottom: 20px; }

.mm-header .border-link {
    font-size: 16px; font-weight: bold; color: #0066cc; text-decoration: none;
    border-bottom: 2px solid #0066cc; padding-bottom: 3px;
}

.mm-header .border-link:hover { text-decoration: none; border-bottom-width: 3px; }
.mm-section { padding-top: 15px; padding-bottom: 15px; border-top: 1px solid #e7e7e7; }
.mm-section:first-of-type { border-top: none; }
.mm-section-title { font-size: 13px; font-weight: bold; text-transform: uppercase; color: #333; margin-bottom: 10px; }
.mm-section-div { display: flex; flex-wrap: wrap; gap: 0 20px; }
.mm-section-ul { flex: 1 1 45%; min-width: 120px; list-style: none; padding: 0; margin: 0 0 5px 0; }
.mm-section-ul li { margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.mm-section-ul li a { color: #0066cc; text-decoration: none; font-size: 13px; }
.mm-section-ul li a:hover { text-decoration: underline; }
.mm-section-ul li img { width: 18px; height: 18px; vertical-align: middle; }

@media (max-width: 768px) {
    .mm-section-div { flex-direction: column; gap: 5px; }
    .mm-section-ul { flex: 1 1 100%; }
    .tax-product_cat .page-title { font-size: 1.8rem !important; }
}

/* ==========================================
   КНОПКА ФИЛЬТРА
   ========================================== */

@media (min-width: 992px) {
    body.tax-product_cat .sidebar-toggle, body.tax-product_cat .filter-toggle, body.tax-product_cat .yith-wcan-filters-opener,
    body.tax-product_brand .sidebar-toggle, body.tax-product_brand .filter-toggle, body.tax-product_brand .yith-wcan-filters-opener,
    body.woocommerce-shop .sidebar-toggle, body.woocommerce-shop .filter-toggle, body.woocommerce-shop .yith-wcan-filters-opener,
    body.archive .sidebar-toggle, body.archive .filter-toggle, body.archive .yith-wcan-filters-opener { display: none !important; }
}

@media (max-width: 991px) {
    body.tax-product_cat .sidebar-toggle, body.tax-product_cat .filter-toggle, body.tax-product_cat .yith-wcan-filters-opener,
    body.tax-product_brand .sidebar-toggle, body.tax-product_brand .filter-toggle, body.tax-product_brand .yith-wcan-filters-opener,
    body.woocommerce-shop .sidebar-toggle, body.woocommerce-shop .filter-toggle, body.woocommerce-shop .yith-wcan-filters-opener,
    body.archive .sidebar-toggle, body.archive .filter-toggle, body.archive .yith-wcan-filters-opener {
        display: inline-flex !important; align-items: center !important; gap: 8px !important;
        padding: 10px 18px !important; background: #fff !important; border: 2px solid #333 !important;
        border-radius: 6px !important; font-size: 16px !important; font-weight: 600 !important;
        color: #333 !important; text-decoration: none !important; cursor: pointer !important;
        transition: background 0.2s, color 0.2s !important; z-index: 10 !important;
        margin-bottom: 15px !important;
    }

    body.tax-product_cat .sidebar-toggle .fa, body.tax-product_cat .filter-toggle .fa, body.tax-product_cat .yith-wcan-filters-opener .fa,
    body.tax-product_brand .sidebar-toggle .fa, body.tax-product_brand .filter-toggle .fa, body.tax-product_brand .yith-wcan-filters-opener .fa,
    body.woocommerce-shop .sidebar-toggle .fa, body.woocommerce-shop .filter-toggle .fa, body.woocommerce-shop .yith-wcan-filters-opener .fa,
    body.archive .sidebar-toggle .fa, body.archive .filter-toggle .fa, body.archive .yith-wcan-filters-opener .fa { display: none !important; }

    body.tax-product_cat .sidebar-toggle .filter-label, body.tax-product_cat .filter-toggle .filter-label, body.tax-product_cat .yith-wcan-filters-opener .filter-label,
    body.tax-product_brand .sidebar-toggle .filter-label, body.tax-product_brand .filter-toggle .filter-label, body.tax-product_brand .yith-wcan-filters-opener .filter-label,
    body.woocommerce-shop .sidebar-toggle .filter-label, body.woocommerce-shop .filter-toggle .filter-label, body.woocommerce-shop .yith-wcan-filters-opener .filter-label,
    body.archive .sidebar-toggle .filter-label, body.archive .filter-toggle .filter-label, body.archive .yith-wcan-filters-opener .filter-label {
        background-color: #d32f2f !important; color: #ffffff !important;
        padding: 2px 8px !important; border-radius: 4px !important; display: inline-block !important;
    }

    body.wpc-filters-open .sidebar-toggle, body.wpc-filters-open .filter-toggle, body.wpc-filters-open .yith-wcan-filters-opener { display: none !important; }
}

html.sidebar-opened .sidebar-toggle, html.sidebar-opened .filter-toggle, html.sidebar-opened .yith-wcan-filters-opener,
body.wpc-filters-open .sidebar-toggle, body.wpc-filters-open .filter-toggle, body.wpc-filters-open .yith-wcan-filters-opener { display: none !important; }

/* ==========================================
   ИСПРАВЛЕНИЕ ПОИСКА
   ========================================== */

@media (min-width: 992px) {
    .searchform-popup.custom-search-form.ms-0.ms-sm-4 { flex: 1 1 auto !important; max-width: 100% !important; min-width: 0 !important; }
    .searchform-popup.custom-search-form .searchform { display: flex !important; flex-wrap: nowrap !important; width: 100% !important; max-width: 100% !important; }
    .searchform-popup.custom-search-form .searchform-fields { flex: 1 1 auto !important; display: flex !important; flex-wrap: nowrap !important; width: 100% !important; max-width: 100% !important; overflow: visible !important; min-width: 0 !important; }
    .searchform-popup.custom-search-form .searchform-fields .text { flex: 1 1 auto !important; overflow: visible !important; min-width: 0 !important; width: 100% !important; max-width: 100% !important; }
    .searchform-popup.custom-search-form .searchform-fields .text input[type="text"] { width: 100% !important; max-width: 100% !important; min-width: 0 !important; flex: 1 1 auto !important; overflow: visible !important; text-overflow: clip !important; white-space: nowrap !important; }
}

/* ==========================================
   ИСПРАВЛЕНИЕ ДЛЯ МОБИЛЬНОЙ ВЕРСИИ СТРАНИЦЫ ТОВАРА
   ========================================== */

@media (max-width: 767px) {
    .single-product .product_title { font-size: 1.5rem !important; }
    .single-product .tab-content { padding-left: 5px !important; padding-right: 5px !important; }
    .single-product .woocommerce-tabs .resp-tabs-list { padding-left: 5px !important; padding-right: 5px !important; }
    .single-product .woocommerce-tabs .resp-accordion { padding-left: 10px !important; padding-right: 10px !important; }
    .single-product .woocommerce-product-attributes { margin-left: 0 !important; margin-right: 0 !important; }
    .single-product .woocommerce-product-attributes th, .single-product .woocommerce-product-attributes td { padding-left: 5px !important; padding-right: 5px !important; }

    .single-product .porto-posts-grid { overflow: hidden !important; width: 100% !important; max-width: 100% !important; }
    .single-product .porto-posts-grid .products { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; padding: 0 !important; margin: 0 !important; width: 100% !important; max-width: 100% !important; overflow: hidden !important; }
    .single-product .porto-posts-grid .product-col { width: 100% !important; max-width: 100% !important; }
    .single-product .porto-posts-grid .product-image img { width: 100% !important; height: auto !important; }
    .single-product .porto-posts-grid .product-title { font-size: 13px !important; min-height: auto !important; }
    .single-product .porto-posts-grid .add-links-wrap { margin-top: 5px !important; }
    .single-product .porto-posts-grid .button { font-size: 12px !important; padding: 5px 8px !important; }
}

/* ==========================================
   ФИКСИРОВАННОЕ СООТНОШЕНИЕ СТОЛБЦОВ В ТАБЛИЦЕ ХАРАКТЕРИСТИК (60/40)
   ========================================== */
.woocommerce-product-attributes th { width: 60% !important; }
.woocommerce-product-attributes td { width: 40% !important; }

/* ==========================================
   УДАЛЕНИЕ ЛИШНЕГО H1
   ========================================== */
.single-product .page-top .page-title-wrap.d-none { display: none !important; }

/* ============================================
   УНИФИКАЦИЯ БОКОВЫХ ОТСТУПОВ НА СТРАНИЦЕ ТОВАРА
   Одинаковое расстояние 20px от края — для ВСЕХ блоков
   (фото+цена, табы, карточки «С этим покупают» и
   «Рекомендуем», хлебные крошки, кнопки «Каталог/Скидки»)
   на мобильных, планшетах и десктопах.
   ============================================ */

/* 1. Блок «фото + цена» и блок табов — убираем внутренние боковые отступы */
body.single-product .box-main-content,
body.single-product .box-tab-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 2. Вложенные .container внутри этих блоков — обнуляем */
body.single-product .box-main-content > .container,
body.single-product .box-tab-content > .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* 3. Строки .row и колонки — обнуляем боковые отступы */
body.single-product .box-main-content .row,
body.single-product .box-tab-content .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.single-product .box-main-content .vc_column_container,
body.single-product .box-tab-content .vc_column_container,
body.single-product .box-main-content .vc_column-inner,
body.single-product .box-tab-content .vc_column-inner,
body.single-product .box-main-content .wpb_wrapper,
body.single-product .box-tab-content .wpb_wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 4. Карточки товаров «С этим покупают» / «Рекомендуем» — обнуляем боковые отступы */
body.single-product .porto-posts-grid .products-container,
body.single-product .porto-posts-grid .products,
body.single-product .porto-posts-grid .product-col,
body.single-product .porto-posts-grid .product-inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 5. Единый боковой отступ задаём ТОЛЬКО на внешнем контейнере #main —
      единая точка, одинаковая для всех блоков и всех экранов */
body.single-product #main > .container,
body.single-product #main > .container-fluid {
    padding-left: 20px !important;
    padding-right: 20px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 6. Тот же отступ — для хлебных крошек (блок .page-top) */
body.single-product .page-top > .container,
body.single-product .page-top > .container-fluid {
    padding-left: 20px !important;
    padding-right: 20px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 7. Тот же отступ — для кнопок «Каталог» / «Товары со скидкой» */
body.single-product .catalog-buttons-wrapper {
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
}

/* ============================================
   ПРОМЕЖУТОК МЕЖДУ КОЛОНКАМИ В БЛОКЕ «ФОТО + ИНФО»
   Возвращаем gutter ТОЛЬКО между колонками внутри
   .box-main-content, не затрагивая внешние отступы
   от края страницы (те заданы на #main > .container).
   На мобильных колонки идут одна под другой,
   поэтому там ничего не меняется.
   ============================================ */

@media (min-width: 768px) {

    /* Левая колонка (картинка) — отступ справа */
    body.single-product .box-main-content .row > .vc_column_container.col-md-6:first-of-type > .vc_column-inner {
        padding-right: 30px !important;
    }

    /* Правая колонка (название, цена, артикул, категория, бренд) — отступ слева */
    body.single-product .box-main-content .row > .vc_column_container.col-md-6:last-of-type > .vc_column-inner {
        padding-left: 30px !important;
    }
}

/* ============================================
   УБИРАЕМ ПУСТОТУ МЕЖДУ КНОПКАМИ «КАТАЛОГ/СКИДКИ»
   И БЛОКОМ «ФОТО + ЦЕНА» НА СТРАНИЦЕ ТОВАРА
   ============================================ */

/* 1. Убираем нижний отступ у блока кнопок (оставляем небольшой до линии-разделителя) */
body.single-product .catalog-buttons-wrapper {
    margin-bottom: 0 !important;
    padding-bottom: 15px !important;
}

/* 2. Обнуляем верхний padding у контейнера #main */
body.single-product #main > .container,
body.single-product #main > .container-fluid {
    padding-top: 0 !important;
}

/* 3. Обнуляем верхние отступы у промежуточных обёрток */
body.single-product .main-content,
body.single-product .main-content-wrap,
body.single-product .content-area,
body.single-product .site-main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* 4. Обнуляем верхний margin у блока «фото + цена» (там было 15px из VC-класса) */
body.single-product .box-main-content {
    margin-top: 0 !important;
}

/* ============================================
   УБИРАЕМ ПРОМЕЖУТКИ МЕЖДУ ОСНОВНЫМИ БЛОКАМИ
   НА СТРАНИЦЕ ТОВАРА
   (блок «В корзину» ↔ блок «Характеристики» ↔
    блок «С этим товаром покупают»)
   ============================================ */

/* 1. Блок «фото + цена + В корзину» — обнуляем нижний отступ,
      из-за которого был разрыв перед блоком характеристик
      (там было margin-bottom: 2.5rem из VC-класса) */
body.single-product .box-main-content {
    margin-bottom: 0 !important;
}

/* 2. Блок табов «Характеристики / Описание / …» — обнуляем
      нижний отступ, из-за которого был разрыв перед блоком
      «С этим товаром покупают» (там было margin-bottom: 2.5rem) */
body.single-product .box-tab-content {
    margin-bottom: 0 !important;
}

/* ============================================
   ОТСТУПЫ МЕЖДУ СЕКЦИЯМИ НА ГЛАВНОЙ СТРАНИЦЕ
   В inline-стилях темы были прописаны огромные вертикальные
   margin/padding (до 4.8rem = ~77px на мобильных) на классах
   секций-заголовков: «Категории товаров», «Распродажа»,
   «Бренды», «Хиты продаж». Именно они давали пустоту.
   Класс .vc_custom_1782935103812, который упоминался раньше,
   в разметке главной ОТСУТСТВУЕТ — поэтому фикс не работал.
   Ниже — правильные селекторы и уменьшенные отступы.
   ============================================ */

/* --- Общий ряд с кнопками «Каталог / Товары со скидкой» ---
   Уменьшаем нижний отступ, чтобы не было двойного зазора
   перед первым блоком контента. */
body.home .catalog-buttons-wrapper {
    margin-bottom: 10px !important;
}

/* --- Убираем возможный лишний верхний padding у #main на главной --- */
body.home #main > .container-fluid,
body.home .main-content,
body.home .main-content-wrap,
body.home #content {
    padding-top: 0 !important;
}

/* --- Секция «Категории товаров» (заголовок + сетка) --- */
body.home .vc_custom_1782935150226 {
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.5rem !important;
}

/* --- Секция «Распродажа» --- */
body.home .vc_custom_1788624411398 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    padding-top: 1rem !important;
    padding-bottom: 0.5rem !important;
}

/* --- Секция «Бренды» --- */
body.home .vc_custom_1782935121369 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    padding-top: 1rem !important;
    padding-bottom: 0.5rem !important;
}

/* --- Секция «Хиты продаж» ---
   Здесь был главный виновник: margin-top: 4.8rem на мобильных. */
body.home .vc_custom_1789428101372 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    padding-top: 1rem !important;
    padding-bottom: 0.5rem !important;
}

/* --- Внешний ряд, в котором лежат «Хиты продаж» + разделитель --- */
body.home .vc_custom_1789427807779 {
    margin-bottom: 1rem !important;
}

/* --- Нижний разделитель под «Хитами продаж» --- */
body.home .vc_custom_1725335598772 {
    margin-top: 0.5rem !important;
    margin-bottom: 1rem !important;
}

/* ===== Мобильные/планшетные уточнения ===== */

@media (max-width: 991px) {
    body.home .vc_custom_1789427807779 { margin-bottom: 0.75rem !important; }
    body.home .vc_custom_1725335598772 { margin-top: 0.5rem !important; margin-bottom: 0.75rem !important; }
}

@media (max-width: 767px) {
    /* Ещё плотнее — на мобилке важен каждый пиксель */
    body.home .vc_custom_1782935150226,
    body.home .vc_custom_1788624411398,
    body.home .vc_custom_1782935121369,
    body.home .vc_custom_1789428101372 {
        margin-top: 0.25rem !important;
        margin-bottom: 0.5rem !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0.25rem !important;
    }
    body.home .vc_custom_1789427807779 { margin-bottom: 0.5rem !important; }
    body.home .vc_custom_1725335598772 { margin-top: 0.25rem !important; margin-bottom: 0.5rem !important; }

    /* Кнопки «Каталог / Скидки» — убираем лишний воздух */
    body.home .catalog-buttons-wrapper {
        padding: 8px 0 !important;
        margin-bottom: 5px !important;
    }

    /* Боковые отступы контейнеров — уже подрезаны ранее, 
       но на всякий случай дублируем для главной */
    body.home .container-fluid {
        padding-left: 7px !important;
        padding-right: 7px !important;
    }
    body.home .main-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* ============================================
   ЛЕВАЯ КОЛОНКА В ТАБЛИЦЕ ХАРАКТЕРИСТИК
   (названия атрибутов — «Какое изделие», «Страна…», и т.д.)
   Делаем шрифт не жирным и одного размера с правой колонкой.
   ============================================ */

/* Левая колонка — th */
.woocommerce-product-attributes th,
.woocommerce-product-attributes-item__label,
table.shop_attributes th {
    font-weight: 400 !important;   /* было 700 (bold) → стало обычное */
    font-size: 1rem !important;    /* тот же размер, что и у td */
    color: inherit !important;     /* не темнее, чем значения справа */
    line-height: 1.6 !important;
}

/* Правая колонка — td (для гарантии одинакового размера) */
.woocommerce-product-attributes td,
.woocommerce-product-attributes-item__value,
table.shop_attributes td {
    font-weight: 400 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* На случай, если тема оборачивает ячейки в <p> внутри td/th */
.woocommerce-product-attributes th p,
.woocommerce-product-attributes td p,
.woocommerce-product-attributes-item__label p,
.woocommerce-product-attributes-item__value p {
    font-weight: 400 !important;
    font-size: inherit !important;
    margin: 0 !important;
}

/* Мобильная версия — размер шрифта 14px, как у вас уже задано для табов */
@media (max-width: 767px) {
    .woocommerce-product-attributes th,
    .woocommerce-product-attributes td,
    .woocommerce-product-attributes-item__label,
    .woocommerce-product-attributes-item__value,
    table.shop_attributes th,
    table.shop_attributes td {
        font-size: 14px !important;
    }
}

/* ============================================
   OVERFLOW FIX (перенесено из functions.php v4.3.3)
   Раньше был inline через wp_head priority 5.
   ============================================ */
body .vc_row { overflow: hidden !important; }
body #header,
body #header .header-main,
body #header .header-row,
body #header .vc_row,
body #header .vc_column-inner,
body #header .wpb_wrapper { overflow: visible !important; }

/* ============================================
   МИНИКАРТ ПОВЕРХ ПОИСКА (перенесено из functions.php v4.3.3)
   Раньше был inline через wp_head priority 1000.
   ============================================ */
#mini-cart.minicart-offcanvas .minicart-overlay,
#mini-cart .minicart-overlay {
    z-index: 100000 !important;
    pointer-events: auto;
}
#mini-cart.minicart-offcanvas .cart-popup,
#mini-cart .cart-popup {
    z-index: 100001 !important;
    pointer-events: auto;
}
body.minicart-opened #header .searchform-popup,
body.minicart-opened .searchform-popup,
body.minicart-opened .searchform-popup.custom-search-form {
    z-index: 1 !important;
}
body.minicart-opened .live-search-list {
    z-index: 0 !important;
}

/* ============================================================
   ОДИНАКОВЫЙ РАЗМЕР КАРТОЧЕК ТОВАРОВ (категории, бренды, поиск)
   Проблема: разные пропорции изображений + разная длина названий.
   Решение: квадратные картинки (aspect-ratio: 1/1 + object-fit: cover),
   заголовок может переноситься на любое число строк (без обрезки),
   прижатая к низу цена, карточки растягиваются на одинаковую высоту.
   ============================================================ */

/* 1. Внешний контейнер карточки — flex-колонка на всю высоту ячейки сетки */
.porto-tb-item,
.porto-posts-grid .porto-tb-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

/* 2. Внутренняя обёртка карточки — тоже flex-колонка */
.porto-tb-item > .porto-section {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    min-width: 0;
}

/* 3. Изображение — строгий квадрат с обрезкой (не зависит от исходных пропорций) */
.porto-tb-item .porto-tb-featured-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    background: #f5f5f5;
}

.porto-tb-item .porto-tb-featured-image > .img-thumbnail,
.porto-tb-item .porto-tb-featured-image > .img-thumbnail > picture,
.porto-tb-item .porto-tb-featured-image > .img-thumbnail > picture > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* На случай, если Porto использует <a> напрямую с картинкой без <picture> */
.porto-tb-item .porto-tb-featured-image .img-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 4. Контентная часть карточки — растягивается и прижимает цену к низу */
.porto-tb-item .product-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* 5. Заголовок товара — переносится на любое число строк БЕЗ обрезки.
      Карточки остаются одинаковой высоты за счёт flexbox-раскладки:
      родитель (.products / .products-container) растягивает их
      через align-items: stretch, а цена прижата к низу
      через margin-top: auto.
      Работает так же, как на 21vek.by — название видно полностью,
      а кнопка «В корзину» у всех карточек на одной линии. */
.porto-tb-item .post-title {
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    max-height: none;
    min-height: calc(1.35em * 2);  /* резерв под 2 строки — чтобы короткие названия не «схлопывались» */
    line-height: 1.35;
    margin-bottom: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* На мобильных — уменьшаем шрифт заголовка, но обрезки нет */
@media (max-width: 767px) {
    .porto-tb-item .post-title {
        font-size: 13px;
        min-height: calc(1.35em * 2);
    }
}

/* 6. Категория над названием — обрезаем в одну строку с ellipsis */
.porto-tb-item .tb-meta-product_cat {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.2em;
}

/* 7. Блок рейтинга — фиксированная высота, чтобы не влиял на разброс */
.porto-tb-item .tb-woo-rating {
    min-height: 20px;
    flex-shrink: 0;
}

/* 8. Цена — прижимается к низу карточки (одинаковое положение у всех) */
.porto-tb-item .tb-woo-price {
    margin-top: auto !important;
    flex-shrink: 0;
}

/* 9. Кнопка "В корзину" на мобильных (замена иконки на кнопку с текстом) */
@media (max-width: 767px) {
    /* Скрываем мобильную кнопку-иконку */
    .porto-tb-item .porto-tb-addcart.d-md-none {
        display: none !important;
    }
    /* Показываем десктопную кнопку с текстом */
    .porto-tb-item .porto-tb-addcart.d-none.d-md-block {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 12px !important;
        padding: 0 8px !important;
        line-height: 2.5rem !important;
        height: 2.5rem !important;
    }
    .porto-tb-item .porto-tb-addcart.d-none.d-md-block i {
        font-size: 14px;
        margin: 0 !important;
    }
}

/* 10. Гарантируем, что сетка растягивает все карточки на одинаковую высоту.
       Для flex-сетки — align-items: stretch (значение по умолчанию, но
       дублируем для надёжности). Для CSS Grid то же значение работает
       аналогично — grid item растягивается на высоту ряда. */
.porto-posts-grid .products-container,
.porto-posts-grid .products {
    align-items: stretch;
}

/* Популярные фильтры в одну строку на мобиле */
/* ============================================================
   «Популярные фильтры» — лейбл сверху, чипы прокручиваются
   ============================================================ */

@media (max-width: 767px) {

  /* 1. Контейнер — обычный блок: без flex и без своей прокрутки */
  .custom-seo-filters {
    display: block;
    margin: 0 0 16px;
    padding: 0 12px;
  }

  /* 2. Лейбл — стоит над списком, не сжимается */
  .custom-seo-filters-label {
    display: block;
    white-space: nowrap;
    margin: 0 0 8px;
    font-weight: 600;
  }

  /* 3. Список — прокручиваемая лента в одну строку */
  .custom-seo-filters-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding: 0 0 4px;          /* чуть снизу, чтобы «затухание» не резало буквы */
    list-style: none;

    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;     /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */

    /* мягкое затухание у правого края — намёк «можно листать» */
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent 100%);
  }
  .custom-seo-filters-list::-webkit-scrollbar { display: none; }

  /* 4. Чипы не сжимаются, текст не переносится */
  .custom-seo-filters-list li {
    flex: 0 0 auto;
    list-style: none;
    margin: 0;
  }

  .custom-seo-filters-list a {
    display: inline-block;
    white-space: nowrap;
  }
}

/* ============================================================
   ФИЛЬТРЫ — «ПИЛЮЛИ» ДЛЯ ВСЕХ ЭКРАНОВ
   Десктоп, планшет, мобильный — одинаково.
   5 пилюль + кнопка «Ещё» (More/Less).
   ============================================================ */

/* 1. УДАЛЕНО. Раньше здесь было:
      .wpc-filters-section.wpc-filter-layout-checkboxes:not(.wpc-closed)
      .wpc-filter-content { display: flex; }
   Это правило перебивало display: none плагина на свёрнутых секциях
   (класс wpc-closed навешивается только после клика, у дефолтно
   свёрнутых секций его нет), из-за чего фильтр был раскрыт.
   Пилюли обеспечиваются flex-контейнером на самом UL (правило 2). */

/* 1a. Страховка: если пользователь свернул секцию вручную, плагин
   навешивает wpc-closed. Его собственный CSS должен спрятать контент,
   но на случай конфликта специфичности дублируем !important. */
.wpc-filters-section.wpc-closed .wpc-filter-content,
.wpc-filters-section.wpc-collapsed .wpc-filter-content {
    display: none !important;
}

/* 2. UL — flex-контейнер. Именно он превращает термы в пилюли. */
.wpc-filter-content .wpc-filters-ul-list.wpc-filters-checkboxes {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
}

/* 3. Каждый LI — inline-flex */
.wpc-filter-content .wpc-filters-ul-list.wpc-filters-checkboxes .wpc-checkbox-item {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    width: auto !important;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
}

/* 4. Скрываем 6-й и последующие элементы, пока секция свёрнута
   по «Ещё/Скрыть» (класс wpc-show-more управляет именно этим
   состоянием — не путать с wpc-closed). */
.wpc-filters-section.wpc-filter-more-less:not(.wpc-show-more)
.wpc-filter-content
.wpc-filters-ul-list.wpc-filters-checkboxes
> .wpc-checkbox-item:nth-child(n+6) {
    display: none !important;
}

/* 5. Показываем все, когда секция раскрыта */
.wpc-filters-section.wpc-filter-more-less.wpc-show-more
.wpc-filter-content
.wpc-filters-ul-list.wpc-filters-checkboxes
> .wpc-checkbox-item {
    display: inline-flex !important;
}

/* 6. Чередование ссылок «Ещё» / «Скрыть» */
.wpc-filters-section.wpc-filter-more-less:not(.wpc-show-more)
.wpc-filter-content > .wpc-see-less-control {
    display: none !important;
}
.wpc-filters-section.wpc-filter-more-less.wpc-show-more
.wpc-filter-content > .wpc-see-more-control {
    display: none !important;
}

/* 7. Обёртка checkbox + label */
.wpc-filter-content .wpc-filters-ul-list.wpc-filters-checkboxes .wpc-term-item-content-wrapper {
    position: relative;
    display: inline-block;
}

/* 8. Прячем нативный чекбокс */
.wpc-filter-content .wpc-filters-ul-list.wpc-filters-checkboxes input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    pointer-events: none !important;
    margin: 0 !important;
}

/* 9. ПИЛЮЛЯ (label) */
.wpc-filter-content .wpc-filters-ul-list.wpc-filters-checkboxes label {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 4px 11px !important;
    margin: 0 !important;
    background: #f5f5f5;
    border: 1px solid #e1e1e1;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .15s, border-color .15s, color .15s;
}

.wpc-filter-content .wpc-filters-ul-list.wpc-filters-checkboxes label a {
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpc-filter-content .wpc-filters-ul-list.wpc-filters-checkboxes label:hover {
    border-color: #ff6b00;
}

/* 10. Счётчик */
.wpc-filter-content .wpc-filters-ul-list.wpc-filters-checkboxes .wpc-term-count {
    font-size: 10px;
    font-weight: 400;
    color: #999;
    margin: 0;
}

/* 11. Активная пилюля */
.wpc-filter-content .wpc-filters-ul-list.wpc-filters-checkboxes
.wpc-term-item-content-wrapper > input[type="checkbox"]:checked + label {
    background: #ff6b00;
    border-color: #ff6b00;
    color: #fff;
}

.wpc-filter-content .wpc-filters-ul-list.wpc-filters-checkboxes
.wpc-term-item-content-wrapper > input[type="checkbox"]:checked + label .wpc-term-count {
    color: rgba(255, 255, 255, .85);
}

/* 12. Кнопки «Ещё» / «Скрыть» */
.wpc-filter-content .wpc-see-more-control,
.wpc-filter-content .wpc-see-less-control {
    display: inline-flex !important;
    align-items: center;
    flex: 0 0 auto;
    padding: 4px 11px;
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    color: #ff6b00;
    border: 1px dashed #ff6b00;
    border-radius: 50px;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.wpc-filter-content .wpc-see-more-control:hover,
.wpc-filter-content .wpc-see-less-control:hover {
    background: #ff6b00;
    color: #fff;
}

/* ============================================================
   КАТАЛОГ: отключаем scroll-anchoring только на контейнере
   фильтра. Браузер перестанет «подтягивать» scrollY, когда
   виджет меняет высоту (сворачиваются секции, появляется
   кнопка «Показать»). На остальных страницах сайта
   scroll-anchoring продолжает работать как обычно.
   ============================================================ */
.porto-woo-category-sidebar,
.wpc-filters-main-wrap,
.wpc-filters-widget-content,
.wpc-filters-widget-containers-wrapper,
.wpc-filters-widget-controls-container {
    overflow-anchor: none;
}

/* ============================================
   КОНЕЦ ФАЙЛА
   ============================================ */