.catalog-es-page {
    padding-bottom: 24px;
}

.catalog-es-mobile-toggle-wrap {
    display: none;
}

.catalog-es-mobile-filter-control,
.catalog-es-mobile-actions {
    display: none;
}

.catalog-es-sidebar-toggle-up {
    display: flex;
    justify-content: center;
    align-items: center;
}

.catalog-es-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

.catalog-es-sidebar {
    box-sizing: border-box;
    border: 1px solid #e5e8ee;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    position: sticky;
    top: calc(var(--header-height, 0px) + 12px);
    max-height: calc(100vh - var(--header-height, 0px) - 24px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: var(--color-gray-200, #ebe9e7) transparent;
    scrollbar-width: thin;
}

.catalog-es-sidebar::-webkit-scrollbar,
.catalog-es-list::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.catalog-es-sidebar::-webkit-scrollbar-track,
.catalog-es-list::-webkit-scrollbar-track {
    background: transparent;
}

.catalog-es-sidebar::-webkit-scrollbar-thumb,
.catalog-es-list::-webkit-scrollbar-thumb {
    background-color: var(--color-gray-200, #ebe9e7);
    border-radius: 10px;
}

.catalog-es-sidebar::-webkit-scrollbar-thumb:hover,
.catalog-es-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-gray-300, #e1dfdc);
}

.catalog-es-mobile-sidebar-head {
    display: none;
}

.catalog-es-sidebar-close {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    padding: 0;
    color: #1f1f1f;
}

.catalog-es-content {
    min-width: 0;
}

.catalog-es-heading-row {
    display: block;
}

.catalog-es-heading-row .h1 {
    color: #000;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.15;
    margin: 15px 0;
    text-wrap: balance;
}

.catalog-es-heading-count {
    display: none;
}

.catalog-es-content .sub-category-title {
    color: #000;
}

.catalog-es-sidebar-fader {
    display: none;
}

.catalog-es-filter-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 10px;
}

.catalog-es-selected-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.catalog-es-selected-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    padding: 6px 10px;
    color: #1f1f1f;
    background: #fff;
    text-decoration: none;
    line-height: 1.2;
}

.catalog-es-selected-filter-chip:hover,
.catalog-es-selected-filter-chip:focus {
    text-decoration: none;
    color: #1f1f1f;
    border-color: #c8ceda;
}

.catalog-es-selected-filter-chip-reset,
.catalog-es-selected-filter-chip-reset:hover,
.catalog-es-selected-filter-chip-reset:focus {
    color: #fff;
    background: #111;
    border-color: #111;
}

.catalog-es-selected-filter-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #7b8494;
    font-size: 16px;
    line-height: 1;
    flex: 0 0 16px;
}

.catalog-es-group {
    border-top: 1px solid #eff2f7;
    padding-top: 12px;
    margin-top: 12px;
}

.catalog-es-group strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
}

.catalog-es-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
}

.catalog-es-group-toggle strong {
    margin-bottom: 0;
}

.catalog-es-group-arrow {
    width: 8px;
    height: 8px;
    border-top: 2px solid #8f97a6;
    border-right: 2px solid #8f97a6;
    transform: rotate(135deg);
    transition: transform .15s ease;
    flex: 0 0 auto;
}

.catalog-es-group.is-collapsed .catalog-es-group-arrow {
    transform: rotate(45deg);
}

.catalog-es-group-content {
    display: block;
}

.catalog-es-group.is-collapsed .catalog-es-group-content {
    display: none;
}

.catalog-es-list {
    display: grid;
    gap: 6px;
    max-height: 220px;
    overflow: auto;
    padding-right: 6px;
    scrollbar-color: var(--color-gray-200, #ebe9e7) transparent;
    scrollbar-width: thin;
}

.catalog-es-list.catalog-es-list-expanded {
    max-height: none;
    overflow: visible;
}

.catalog-es-checkbox {
    display: block;
    font-size: 14px;
    margin: 0;
}

.catalog-es-filter-items .item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catalog-es-filter-items input[type="checkbox"] {
    display: inline-block !important;
    -webkit-appearance: checkbox !important;
    appearance: auto !important;
    width: 14px;
    height: 14px;
    margin: 0;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    accent-color: #111;
    flex: 0 0 auto;
}

.catalog-es-filter-items input[type="checkbox"] + label:before,
.catalog-es-filter-items input[type="checkbox"]:checked + label:before {
    content: none !important;
    background: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}

.catalog-es-filter-items input[type="checkbox"]:checked + label {
    color: inherit !important;
}

.catalog-es-option-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    line-height: 1.3;
    cursor: pointer;
    color: #1f1f1f !important;
    font-weight: 400;
    font-size: 13px;
}

.catalog-es-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.catalog-es-price-group {
    padding-bottom: 14px;
}

.catalog-es-native-range {
    position: relative;
    height: 24px;
    margin: 10px 2px 14px;
}

.catalog-es-native-range-track,
.catalog-es-native-range-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
    width: 100%;
}

.catalog-es-native-range-track {
    background: #e5e5e5;
}

.catalog-es-native-range-fill {
    background: #f2cd17;
    left: var(--min-percent, 0%);
    width: calc(var(--max-percent, 100%) - var(--min-percent, 0%));
}

.catalog-es-native-range input[type="range"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 24px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.catalog-es-native-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #f2cd17;
    background: #fff;
    cursor: pointer;
    pointer-events: auto;
}

.catalog-es-native-range input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #f2cd17;
    background: #fff;
    cursor: pointer;
    pointer-events: auto;
}

.catalog-es-native-range input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
}

.catalog-es-native-range input[type="range"]::-moz-range-track {
    background: transparent;
}

.catalog-es-price-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.catalog-es-price-inputs input.form-control,
.catalog-es-filter-range-inputs input.form-control {
    border-radius: 0;
    height: 28px;
    padding: 4px 10px;
    font-size: 14px;
    width: 95px;
}

.catalog-es-filter-range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.catalog-es-filter-range-separator {
    color: #333;
    font-size: 18px;
    line-height: 1;
}

.catalog-es-filter-search {
    height: 34px;
    margin-bottom: 10px;
    border-radius: 0;
    border-color: #ddd;
    box-shadow: none;
}

.catalog-es-range-values[hidden] {
    display: none;
}

.catalog-es-price-currency {
    margin-left: 4px;
    font-size: 14px;
    color: #3d3d3d;
}

.catalog-es-brand-list {
    max-height: 210px;
    overflow: auto;
    padding-right: 6px;
}

.catalog-es-brand-name {
    color: #191919;
}

.catalog-es-brand-count {
    color: #9b9b9b;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

.catalog-es-brand-hidden,
.catalog-es-filter-mismatch {
    display: none;
}

.catalog-es-show-more {
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    color: #787878;
    text-decoration: none;
}

.catalog-es-show-more:hover,
.catalog-es-show-more:focus {
    color: #555;
    text-decoration: none;
}

.catalog-es-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e5e8ee;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    background: #fff;
}

.catalog-es-sort-header {
    margin-bottom: 15px !important;
    z-index: 4;
}

.catalog-es-sort-header .dd_select.pl_sort {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.catalog-es-total-count {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #5b6475;
    font-weight: 500;
}

.catalog-es-sort-dropdown {
    display: inline-block;
}

.catalog-es-sort-current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1f1f1f;
    font-weight: 600;
    text-decoration: none;
}

.catalog-es-sort-current:hover,
.catalog-es-sort-current:focus {
    text-decoration: none;
    color: #1f1f1f;
}

.catalog-es-sort-dropdown .dropdown-menu {
    min-width: 168px;
    padding: 4px 0;
}

.catalog-es-sort-dropdown .dropdown-menu > li > a {
    white-space: nowrap;
    text-align: left;
    padding: 8px 12px;
    font-size: 16px;
    line-height: 1.2;
    color: #1f1f1f;
}

.catalog-es-sort-dropdown .dropdown-menu > li > a:hover,
.catalog-es-sort-dropdown .dropdown-menu > li > a:focus {
    background-color: #f3f3f3;
    color: #1f1f1f;
}

.catalog-es-sort-dropdown .dropdown-menu > .active > a,
.catalog-es-sort-dropdown .dropdown-menu > .active > a:hover,
.catalog-es-sort-dropdown .dropdown-menu > .active > a:focus {
    background-color: #f2cd17;
    color: #222;
}

.catalog-es-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-left: 1px solid #dfe3ea;
    border-top: 1px solid #dfe3ea;
    background: #fff;
}

.catalog-es-grid .col_product {
    border-right: 1px solid #dfe3ea;
    border-bottom: 1px solid #dfe3ea;
}

.catalog-es-grid .product {
    height: 100%;
    padding: 10px 10px 12px;
}

.catalog-es-grid .product-img {
    min-height: 235px;
}

.catalog-es-grid .product-img img {
    width: 100%;
    height: 235px;
    object-fit: contain;
}

.catalog-es-grid .product-name a {
    min-height: 42px;
}

.catalog-es-grid .new_old_price {
    margin-top: 10px;
}

.catalog-es-empty {
    border: 1px dashed #d8dfeb;
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    color: #5b6475;
    background: #fff;
}

@media (max-width: 1200px) {
    .catalog-es-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .catalog-es-layout {
        grid-template-columns: 1fr;
    }

    .catalog-es-sidebar {
        position: static;
    }

    .catalog-es-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalog-es-mobile-toggle-wrap {
        display: block;
    }

    .catalog-es-heading-row {
        display: flex;
        align-items: baseline;
        gap: 10px;
        flex-wrap: wrap;
    }

    .catalog-es-heading-row .h1 {
        font-size: 20px;
        margin-right: 0;
    }

    .catalog-es-heading-count {
        display: inline-block;
        color: #8f97a6;
        font-size: 14px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .catalog-es-sort-header .catalog-es-total-count {
        display: none;
    }

    .catalog-es-sidebar {
        display: none;
    }

    .catalog-es-page.catalog-es-sidebar-open .catalog-es-sidebar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        max-height: 100vh;
        width: min(86vw, 340px);
        z-index: 1002;
        border-radius: 0;
        border-left: 0;
        border-top: 0;
        border-bottom: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-top: 10px;
    }

    .catalog-es-page.catalog-es-sidebar-open .catalog-es-sidebar form {
        min-height: 100%;
        padding-bottom: 24px;
    }

    .catalog-es-mobile-sidebar-head {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 8px;
    }

    .catalog-es-page.catalog-es-sidebar-open .catalog-es-sidebar-fader {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .35);
        z-index: 1001;
    }

    .catalog-es-page.catalog-es-sidebar-open .catalog-es-sidebar .catalog-es-list {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 520px) {
    .catalog-es-grid {
        grid-template-columns: 1fr;
    }

    .catalog-es-toolbar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .catalog-es-sort-header .dd_select.pl_sort {
        justify-content: flex-start;
        margin-top: 6px;
    }
}

@media (max-width: 767px) {
    .catalog-es-mobile-toggle-wrap {
        display: none;
    }

    .catalog-es-sort-header {
        position: sticky;
        top: var(--header-height, 0px);
        padding: 0;
        margin: 0 0 16px !important;
        background: #fff;
        border-radius: 0;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .catalog-es-sort-header > .row {
        display: flex;
        gap: 8px;
        align-items: stretch;
        margin: 0;
    }

    .catalog-es-sort-header .catalog-es-mobile-filter-control,
    .catalog-es-sort-header .dd_select.pl_sort {
        display: flex;
        width: calc(50% - 4px);
        flex: 0 0 calc(50% - 4px);
        padding: 0;
        margin: 0;
    }

    .catalog-es-sort-header .listing-header-punkt {
        display: none;
    }

    .catalog-es-mobile-filter-button,
    .catalog-es-sort-current {
        position: static;
        inset: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 32px;
        margin: 0;
        border: 0;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        color: #111;
    }

    .catalog-es-mobile-filter-button {
        gap: 6px;
        background: #f9d223;
        padding: 0 10px;
    }

    .catalog-es-mobile-filter-button svg {
        width: 12px;
        height: 12px;
        flex: 0 0 12px;
    }

    .catalog-es-sort-current {
        background: #f5f5f5;
        padding: 0 10px;
    }

    .catalog-es-sort-dropdown {
        width: 100%;
    }

    .catalog-es-sort-dropdown .dropdown-menu {
        left: auto;
        right: 0;
    }

    .catalog-es-page.catalog-es-sidebar-open .catalog-es-sidebar {
        width: 100%;
        padding: 0 16px 78px;
        border: 0;
        box-shadow: none;
    }

    .catalog-es-page.catalog-es-sidebar-open .catalog-es-sidebar form {
        padding-bottom: 0;
    }

    .catalog-es-mobile-sidebar-head {
        position: sticky;
        top: 0;
        z-index: 2;
        justify-content: space-between;
        align-items: center;
        min-height: 52px;
        margin: 0 0 8px;
        background: #fff;
        border-bottom: 1px solid #f0f0f0;
    }

    .catalog-es-mobile-sidebar-head::before {
        content: "Фільтри";
        font-size: 16px;
        font-weight: 700;
    }

    .catalog-es-filter-title {
        display: none;
    }

    .catalog-es-sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: #f5f5f5;
        font-size: 0;
    }

    .catalog-es-sidebar-close::before {
        content: "\00d7";
        font-size: 22px;
        line-height: 1;
    }

    .catalog-es-mobile-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1003;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 56px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: #111;
        color: #fff;
    }

    .catalog-es-mobile-picked {
        font-size: 12px;
        color: #fff;
    }

    .catalog-es-mobile-show {
        min-width: 88px;
        height: 34px;
        border: 0;
        border-radius: 10px;
        background: #f9d223;
        color: #111;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        padding: 0 18px;
    }
}

/* Popular products table */
.category-popular-products {
    margin-top: 20px;
}

.category-popular-products h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1f1f1f;
}

.category-popular-products table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.category-popular-products table th {
    background: #00a65a;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.category-popular-products table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e8ee;
    font-size: 14px;
}

.category-popular-products table tr:hover td {
    background: #f9fafb;
}

.category-popular-products table td a {
    color: #0066cc;
    text-decoration: none;
}

.category-popular-products table td a:hover {
    text-decoration: underline;
}

.category-popular-products .query-time {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}
