/* ============================================
   CATALOG — каталог спецтехники с фильтрами
   ============================================ */

/* ===== HERO ===== */
.catalog-hero {
    background: var(--surface-general-primary);
    padding: 48px 0;
}

.catalog-hero__container {
    max-width: 1472px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.catalog-hero__title-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.catalog-hero__title {
    color: var(--base-neutral-lightest);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
}

.catalog-hero__description {
    color: #E8E1E1;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    max-width: 714px;
}

.catalog-hero__search .input-field__wrapper {
    background: rgba(250, 250, 250, 0.08);
}

.catalog-hero__search-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    color: var(--base-neutral-lightest);
    transition: color 300ms var(--easing-gentle);
}

.catalog-hero__search-btn:hover {
    color: var(--surface-general-accent-primary);
}

.catalog-hero__search-btn .icon {
    fill: currentColor;
}

/* Кнопка очистки поиска */
.catalog-hero__search-clear {
    display: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--base-neutral-lightest);
    opacity: 0.6;
    transition: opacity 300ms var(--easing-gentle), color 300ms var(--easing-gentle);
    flex-shrink: 0;
}

.catalog-hero__search-clear:hover {
    opacity: 1;
    color: var(--surface-general-accent-primary);
}

.catalog-hero__search-clear .icon {
    fill: currentColor;
}

.catalog-hero__search-clear--visible {
    display: inline-flex;
}

/* ===== КАТАЛОГ ===== */
.catalog {
    background: var(--surface-general-primary);
    padding: 0 0 64px;
}

.catalog__container {
    max-width: 1472px;
    margin: 0 auto;
    padding: 0 16px;
}

.catalog__layout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* Кнопка «Фильтры» — скрыта на десктопе */
.catalog__filters-toggle {
    display: none;
    margin-bottom: 12px;
}

.catalog__overlay {
    display: none;
}

/* ===== САЙДБАР ===== */
.catalog__sidebar {
    width: 351px;
    flex-shrink: 0;
    padding: 12px;
    background: rgba(250, 250, 250, 0.08);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.catalog__drawer-head {
    display: none;
}

.catalog__filters {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.catalog__sidebar-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.catalog__sidebar-separator {
    align-self: stretch;
    height: 1px;
    background: rgba(250, 250, 250, 0.12);
}

/* Кнопка «Найти» — появляется при изменениях */
.catalog__apply {
    display: none;
    align-self: stretch;
}

.catalog__apply--visible {
    display: flex;
}

.catalog__clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-link-default);
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.2;
    padding: 0;
    transition: color 300ms var(--easing-gentle);
}

.catalog__clear-btn:hover {
    color: var(--text-link-hover);
}

.catalog__clear-btn .icon {
    fill: currentColor;
}

/* ===== ГРУППА ФИЛЬТРОВ ===== */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.filter-group[data-group="mass"]{
    display: none;
}

.filter-group+.filter-group {
    border-top: 1px solid rgba(250, 250, 250, 0.12);
    padding-top: 24px;
}

.filter-group__header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.filter-group__label-row {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group__title {
    color: var(--base-neutral-lightest);
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.2;
}

.filter-group__count {
    display: none;
    min-width: 30px;
    height: 30px;
    padding: 4px;
    background: rgba(250, 250, 250, 0.08);
    border-radius: 4px;
    color: var(--base-neutral-lightest);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    justify-content: center;
    align-items: center;
}

.filter-group__count--visible {
    display: flex;
}

.filter-group__icon {
    display: flex;
    transition: transform 300ms var(--easing-gentle);
}

.filter-group__icon .icon {
    fill: var(--base-neutral-lightest);
}

.filter-group--closed .filter-group__icon {
    transform: rotate(180deg);
}

.filter-group--closed .filter-group__body {
    display: none;
}

.filter-group__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-group__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group__item {
    align-self: stretch;
}

/* ===== RANGE SLIDER ===== */
.range-slider {
    position: relative;
    height: 20px;
}

.range-slider__track {
    position: absolute;
    left: 0;
    right: 0;
    top: 7px;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-general-accent-secondary);
}

.range-slider__fill {
    position: absolute;
    top: 7px;
    height: 6px;
    background: var(--surface-general-accent-primary);
    border-radius: 999px;
}

.range-slider input[type="range"] {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: 20px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: none;
    pointer-events: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface-general-accent-primary);
    border: 1px solid var(--surface-general-accent-primary);
    cursor: pointer;
}

.range-slider input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface-general-accent-primary);
    border: 1px solid var(--surface-general-accent-primary);
    cursor: pointer;
}

/* ===== КОНТЕНТ ===== */
.catalog__content {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.catalog__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.catalog__sort {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.catalog__count {
    color: var(--base-neutral-lightest);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

/* ===== СЕТКА ===== */
.catalog__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
}

.catalog__grid .card-product {
    /* flex: 1 1 0; */
    width: calc(100% / 3 - 8px);
    min-width: 288px;
    max-width: 426px;
    height: auto;
}

/* ===== ПУСТОЙ РЕЗУЛЬТАТ ===== */
.catalog-empty {
    padding: 48px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.catalog-empty__title {
    color: var(--base-neutral-lightest);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
    max-width: 714px;
}

.catalog-empty__description {
    color: var(--base-neutral-lightest);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    max-width: 714px;
}

/* ===== ПАГИНАЦИЯ + ПОКАЗАТЬ ЕЩЁ ===== */
.catalog__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.catalog-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catalog-pagination__arrow {
    width: 48px;
    height: 48px;
    padding: 12px;
    background: var(--surface-general-accent-secondary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 300ms var(--easing-gentle);
}

.catalog-pagination__arrow:hover {
    background: var(--surface-general-secondary);
}

.catalog-pagination__arrow .icon {
    color: var(--surface-general-secondary);
}

.catalog-pagination__arrow:hover .icon {
    color: var(--surface-general-accent-secondary);
}

.catalog-pagination__arrow:disabled {
    opacity: 0.7;
    pointer-events: none;
}

.catalog-pagination__item {
    min-width: 48px;
    height: 48px;
    padding: 12px;
    background: var(--surface-general-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--base-neutral-lightest);
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    transition: outline-color 300ms var(--easing-gentle);
}

.catalog-pagination__item span {
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.catalog-pagination__item--current {
    outline: 1px solid var(--border-secondary);
    outline-offset: -1px;
}

.catalog-pagination__item--current span {
    background: var(--surface-general-accent-primary);
    color: var(--text-content-secondary);
}

.catalog-pagination__dots {
    padding: 12px;
    color: var(--base-neutral-lightest);
    font-size: 14px;
    font-weight: 700;
}

/* ============================================
   АДАПТИВ: ПЛАНШЕТ (835-1440) — шторка 360px
   ============================================ */
@media (max-width: 1440px) {
    .catalog__filters-toggle {
        display: inline-flex;
    }

    .catalog__layout {
        display: block;
    }

    .catalog__sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 360px;
        max-width: 100%;
        background: var(--surface-general-primary);
        border-radius: 0;
        padding: 20px 16px;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 400ms var(--easing-gentle);
        z-index: 1000;
        gap: 16px;
    }

    body.catalog--drawer-open .catalog__sidebar {
        transform: translateX(0);
    }

    body.catalog--drawer-open {
        overflow: hidden;
    }

    .catalog__overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(16, 16, 16, 0.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity 400ms var(--easing-gentle);
        z-index: 999;
    }

    body.catalog--drawer-open .catalog__overlay {
        opacity: 1;
        pointer-events: auto;
    }

    /* Шапка шторки */
    .catalog__drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
        margin-bottom: 16px;
    }

    .catalog__drawer-title {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        color: var(--base-neutral-lightest);
        font-size: 16px;
        font-weight: 600;
        text-transform: uppercase;
        line-height: 1.2;
    }

    .catalog__drawer-close,
    .catalog__drawer-back {
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        display: flex;
        color: var(--base-neutral-lightest);
    }

    .catalog__drawer-close .icon,
    .catalog__drawer-back .icon {
        fill: currentColor;
    }

    .catalog__drawer-back {
        display: none;
    }

    .catalog__clear-link {
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-link-default);
        font-size: 16px;
        font-weight: 600;
        text-transform: uppercase;
        padding: 0;
    }

    /* «Найти» в шторке видна всегда */
    .catalog__apply {
        display: flex;
    }

    .catalog__sidebar-foot {
        position: sticky;
        bottom: 0;
        background: var(--surface-general-primary);
        padding: 16px 0;
    }

    /* Скрываем десктоп-кнопку очистки в шторке */
    .catalog__clear-btn {
        display: none;
    }

    .catalog__sidebar-separator {
        display: none;
    }

    .filter-group__title {
        font-size: 16px;
    }

    .catalog__grid .card-product {
        width: calc(100% / 2 - 8px);
        max-width: none;
        min-width: 200px;
    }
}

/* ============================================
   АДАПТИВ: МОБИЛЬНЫЙ (≤834) — полноэкранный фильтр
   ============================================ */
@media (max-width: 834px) {
    .catalog__sidebar {
        width: 100%;
    }

    .catalog__drawer-close {
        display: none;
    }

    .catalog__drawer-back {
        display: flex;
    }

    .filter-group__count {
        display: none;
    }

    .filter-group__count--visible {
        display: flex;
    }

    .catalog-hero__title {
        font-size: 24px;
    }

    .catalog-empty__title {
        font-size: 22px;
    }

    .catalog__bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .catalog-pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media(max-width: 512px) {
    .catalog__grid .card-product {
        width: calc(100% / 1 - 8px);

    }
}