/* ---------- Catalog Page ---------- */

.catalog-page {
    margin-bottom: 100px;
}

/* ---- Title ---- */
.catalog-title {
    font-weight: var(--font-weight-bold);
    font-size: 28px;
    line-height: 1.2;
    margin: 12px 0 24px;
}

/* ---- Hero Banners ---- */
.catalog-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.catalog-hero_item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    padding: 28px 32px;
}

.catalog-hero_item--green { background-color: #E8EDE7; }
.catalog-hero_item--dark { background-color: #3D3D3D; color: #fff; }

.catalog-hero_bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.catalog-hero_content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.catalog-hero_subtitle {
    font-weight: var(--font-weight-bold);
    font-size: 24px;
    line-height: 1.2;
    margin: 0 0 6px;
}

.catalog-hero_desc {
    font-size: 14px;
    margin: 0 0 16px;
    opacity: 0.8;
}

.catalog-hero_tag {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.catalog-hero_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--color-green-main);
    color: #fff;
    font-weight: var(--font-weight-semibold);
    font-size: 14px;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    transition: opacity 0.2s;
}

.catalog-hero_btn:hover { opacity: 0.85; color: #fff; }

.catalog-hero_btn--outline {
    background-color: var(--color-green-main);
}

.catalog-hero_img {
    position: absolute;
    right: 16px;
    bottom: 0;
    height: 85%;
    max-width: 50%;
    object-fit: contain;
    z-index: 1;
    pointer-events: none;
}

/* ---- Toolbar ---- */
.catalog-toolbar {
    margin-bottom: 20px;
    padding: 16px 0 12px;
    border-bottom: 1px solid #E5E7EB;
}

.catalog-found {
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    line-height: 1.4;
    color: var(--color-text);
    white-space: nowrap;
}

.catalog-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.catalog-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    background: var(--color-grey-light);
    border: none;
    border-radius: 4px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.catalog-filter-tag:hover { background: #E5E7EB; }

.catalog-filter-clear {
    font-size: 12px;
    line-height: 18px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.catalog-sort .form-group_select {
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    color: var(--color-text);
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 8px 50px 8px 28px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' stroke='%23555' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    min-width: 160px;
}

/* ---- Filter Sidebar ---- */
.filter-sidebar {
    position: sticky;
    top: 130px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding-right: 16px;
    padding-bottom: 40px;
}

.filter-section {
    border-bottom: 1px solid #E5E7EB;
    padding: 16px 0;
}

.filter-section[open] summary { margin-bottom: 12px; }

.filter-section_title {
    font-weight: var(--font-weight-bold);
    font-size: 16px;
    line-height: 24px;
    text-align: left;
    width: 100%;
    color: var(--color-text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    background-color: #fff;
    border: none;
    padding: 0 20px 0 0;
    position: relative;
    margin-bottom: 12px;
}

.filter-section_title::before,
.filter-section_title::after {
    content: "";
    width: 15px;
    height: 2px;
    background-color: var(--color-text);
    position: absolute;
    top: calc(50% - 1px);
    right: 0;
    transition: transform .15s ease-in-out;
}

.filter-section_title:not(.active)::after {
    transform: rotate(-90deg);
}

.filter-section_title::-webkit-details-marker { display: none; }

.filter-section_content {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 260px;
    overflow-y: auto;
}

.filter-section_content li {
    padding: 4px 0;
}

.filter-section_content.scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #D1D5DB transparent;
}

.filter-section_content.scrollbar::-webkit-scrollbar { width: 4px; }
.filter-section_content.scrollbar::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 2px; }

/* ---- Show More Filters ---- */
.filter-more-wrap {
    margin-top: 4px;
}

.filter-more-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-green-main);
    text-decoration: underline;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.filter-more-btn__icon {
    transition: transform .2s ease;
    flex-shrink: 0;
}

.filter-more-btn.is-open .filter-more-btn__icon {
    transform: rotate(180deg);
}

.filter-more-btn__label-less { display: none; }
.filter-more-btn.is-open .filter-more-btn__label-more { display: none; }
.filter-more-btn.is-open .filter-more-btn__label-less { display: inline; }

/* ---- All Categories Filter ---- */
.all-categories-list {
    max-height: 320px;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
}

.all-cat-item {
    padding: 2px 0;
}

.all-cat-link {
    display: block;
    padding: 4px 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text);
    text-decoration: none;
    transition: color .15s;
}

.all-cat-link:hover,
.all-cat-link.active {
    color: var(--color-blue);
    font-weight: var(--font-weight-bold) !important;
}

.all-cat-link.active {
    font-weight: 600;
}

.all-cat-sub {
    list-style: none;
    padding: 0 0 0 20px;
    margin: 0;
}

.all-cat-item--sub .all-cat-link {
    font-size: 14px;
}

/* ---- Filter Link (categories tree) ---- */
.filter-link { margin-bottom: 2px; }

.filter-link_item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    font-size: 14px;
    color: var(--color-text);
}

.filter-link_item a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
    flex: 1;
}

.filter-link_item a:hover { color: var(--color-green-main); }

.filter-link_item.active a {
    font-weight: var(--font-weight-semibold);
    color: var(--color-green-main);
}

.filter-link_ico {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    border: 1.5px solid #9CA3AF;
    flex-shrink: 0;
}

.filter-link_item.active .filter-link_ico {
    background: var(--color-green-main);
    border-color: var(--color-green-main);
}

.filter-link_count {
    font-size: 13px;
    color: #9CA3AF;
    margin-left: auto;
}

/* ---- Filter Checkboxes ---- */
.form-group--checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    font-size: 14px;
}

.form-group--checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 1.5px solid #9CA3AF;
    border-radius: 4px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    background: #fff;
    transition: all 0.15s;
}

.form-group--checkbox input[type="checkbox"]:checked {
    background: var(--color-green-main);
    border-color: var(--color-green-main);
}

.form-group--checkbox input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-group_label--checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--color-text);
}

.filter-count {
    font-size: 12px;
    color: #9CA3AF;
    margin-left: auto;
}

/* ---- Price Slider ---- */
.filter-price { padding: 8px 0; }

.price-slider {
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
}

.price-slider_track {
    position: relative;
    width: 100%;
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
}

.price-slider_range {
    position: absolute;
    height: 100%;
    background: var(--color-green-main);
    border-radius: 2px;
}

.price-slider_input {
    position: absolute;
    width: 100%;
    height: 4px;
    top: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.price-slider_input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid var(--color-green-main);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    position: relative;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.price-slider_input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid var(--color-green-main);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.price-slider_values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 4px;
    font-size: 14px;
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}
.price-slider_values span { 
    min-width: 90px;
 }

 .price-slider_val {
    text-align: center;
 }

.price-slider_sep { 
    color: #9CA3AF; 
    margin: 0 auto;
    text-align: center;
}

.price-slider_inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.price-slider_number {
    width: 100%;
    font-size: 14px;
    font-family: var(--font-family);
    padding: 8px 10px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    text-align: center;
    -moz-appearance: textfield;
}

.price-slider_number::-webkit-inner-spin-button,
.price-slider_number::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.price-slider_inputs > span { color: #9CA3AF; }

/* ---- Product Grid ---- */
.catalog-grid {
    row-gap: 30px;
}

.catalog-grid > .col-sm-6 {
    margin-bottom: 0;
}

/* ---- Pagination ---- */
.catalog-pagination {
    display: flex;
    justify-content: center;
    padding: 32px 0 20px;
}

.catalog-pagination_list {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.catalog-pagination_item a,
.catalog-pagination_item span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 0 10px;
    text-decoration: none;
    transition: all 0.15s;
}

.catalog-pagination_item a:hover {
    background: var(--color-grey-light);
    border-color: #D1D5DB;
}

.catalog-pagination_item.active span {
    background: var(--color-green-main);
    color: #fff;
    border-color: var(--color-green-main);
}

.catalog-pagination_dots span {
    border: none;
    background: none;
    min-width: auto;
    padding: 0 4px;
}

/* ---- Filter Btn (mobile) ---- */
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    color: #ffffff;
    background: var(--color-green-main);
    border: 1px solid var(--color-green-main);
    border-radius: 8px;
    padding: 8px 30px;
    cursor: pointer;
}

/* ---- Mobile Filter Sidebar ---- */
@media (max-width: 991px) {
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 360px;
        height: 100vh;
        max-height: 100vh;
        background: #fff;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 0 20px 20px;
        overflow-y: auto;
    }

    .filter-sidebar.active {
        transform: translateX(0);
    }

    .filter-sidebar_top {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
        padding: 16px 0;
        border-bottom: 1px solid #E5E7EB;
        font-weight: var(--font-weight-semibold);
        font-size: 18px;
    }

    .filter-sidebar_top .header-ico--close {
        width: 24px;
        height: 24px;
        cursor: pointer;
        position: relative;
    }

    .filter-sidebar_top .header-ico--close::before,
    .filter-sidebar_top .header-ico--close::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 18px;
        height: 2px;
        background-color: var(--color-text);
    }

    .filter-sidebar_top .header-ico--close::before { transform: translate(-50%, -50%) rotate(45deg); }
    .filter-sidebar_top .header-ico--close::after { transform: translate(-50%, -50%) rotate(-45deg); }
}

@media (min-width: 992px) {
    .filter-sidebar_top { display: none !important; }
    .filter-btn { display: none !important; }
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .catalog-title { font-size: 22px; margin: 8px 0 16px; }

    .catalog-hero {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .catalog-hero_item {
        min-height: 180px;
        padding: 20px;
    }

    .catalog-hero_subtitle { font-size: 18px; }
    .catalog-hero_btn { font-size: 13px; padding: 8px 18px; }
    .catalog-hero_img { height: 75%; max-width: 45%; right: 8px; }

    .catalog-toolbar {
        flex-direction: column;
        gap: 12px;
        padding: 12px 0 8px;
    }

    .catalog-found { font-size: 14px; }
    .catalog-sort .form-group_select { width: 100%; min-width: 0; }

    .catalog-pagination_item a,
    .catalog-pagination_item span {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .catalog-page .container-xl {
        padding-left: 4%;
        padding-right: 4%;
    }
}

@media (max-width: 575px) {
    .catalog-hero_item { min-height: 150px; padding: 16px; }
    .catalog-hero_subtitle { font-size: 16px; }
    .catalog-hero_img { height: 70%; }
    .price-slider_inputs { flex-direction: row; }
}

@media (min-width: 1200px) {
    .catalog-title { font-size: 32px; }
    .catalog-hero_item { min-height: 260px; padding: 36px 40px; }
    .catalog-hero_subtitle { font-size: 28px; }
}

/* ---- Catalog Slider (Swiper) ---- */
.catalog-slider-wrap {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
}
.js-catalog-slider .swiper-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}
.catalog-slider-img--desktop { display: block; }
.catalog-slider-img--mobile { display: none; }

@media (max-width: 767px) {
    .catalog-slider-img--desktop { display: none; }
    .catalog-slider-img--mobile { display: block; }
}
