.catalog_slider {
    position: relative;
    margin-top: 48px;
}

.catalog_track {
    display: flex;
    gap: 8px;
    overflow: hidden;
    scroll-behavior: smooth;
}

.catalog_arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(0 0 0 / 15%);
    color: var(--color-white);
    font-size: 20px;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 0.2s ease;
}

.catalog_has_overflow .catalog_arrow {
    display: flex;
}

.catalog_arrow:hover {
    background: rgb(0 0 0 / 30%);
}

.catalog_arrow_left {
    left: 12px;
}

.catalog_arrow_right {
    right: 12px;
}

.catalog_category_item {
    position: relative;
    flex: 1 0 243px;
    height: 570px;
    overflow: hidden;
    border-radius: 9px;
    background-color: var(--color-background-muted);
    color: var(--color-ink-800);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.catalog_category_image {
    position: absolute;
    top: auto;
    right: min(-20px, calc(100% - 263px));
    bottom: 160px;
    width: 243px;
    min-width: 243px;
    max-width: none;
    height: auto;
    object-fit: contain;
    object-position: center;
    transform: none;
    transition: transform 0.2s ease;
}

.catalog_category_image_placeholder {
    background-color: var(--color-background-muted);
}

.catalog_category_title {
    position: absolute;
    bottom: 25px;
    left: 20px;
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
}

@media (min-width: 1366px) {
    .catalog_slider_grid .catalog_track {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        overflow: visible;
    }

    .catalog_slider_grid .catalog_arrow {
        display: none !important;
    }
}

@media (max-width: 1365px) {
    .catalog_slider {
        margin-top: 40px;
    }

    .catalog_track {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
        overflow: visible;
    }

    .catalog_arrow {
        display: none !important;
    }

    .catalog_category_item {
        flex: unset;
        height: 223px;
    }

    .catalog_category_item:nth-child(5n + 1),
    .catalog_category_item:nth-child(5n + 2) {
        grid-column: span 2;
    }

    .catalog_category_item:nth-child(5n + 3) {
        grid-column: span 4;
    }

    .catalog_category_item:nth-child(5n + 4) {
        grid-column: span 3;
    }

    .catalog_category_item:nth-child(5n + 5) {
        grid-column: span 1;
    }

    .catalog_category_item:last-child:nth-child(5n + 1),
    .catalog_category_item:last-child:nth-child(5n + 4) {
        grid-column: 1 / -1;
    }

    .catalog_category_image {
        top: 0;
        right: 0;
        bottom: auto;
        width: auto;
        min-width: 0;
        height: 100%;
        object-position: right center;
        transform: none;
    }

    .catalog_category_title {
        bottom: 12px;
        left: 16px;
    }
}

@media (min-width: 760px) and (max-width: 1365px) {
    .catalog_category_image {
        right: auto;
        left: 50%;
        width: auto;
        min-width: 0;
        max-width: none;
        height: 100%;
        object-fit: contain;
        object-position: left center;
    }
}

@media (max-width: 759px) {
    .catalog_slider {
        margin-top: 32px;
    }

    .catalog_track {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 13px;
    }

    .catalog_category_item:nth-child(5n + 1),
    .catalog_category_item:nth-child(5n + 2),
    .catalog_category_item:nth-child(5n + 3),
    .catalog_category_item:nth-child(5n + 4),
    .catalog_category_item:nth-child(5n + 5) {
        grid-column: auto;
        height: auto;
    }

    .catalog_category_item:nth-child(6n + 1),
    .catalog_category_item:nth-child(6n + 2) {
        grid-column: span 3;
        height: 223px;
    }

    .catalog_category_item:nth-child(6n + 3) {
        grid-column: span 6;
        height: 128px;
    }

    .catalog_category_item:nth-child(6n + 4) {
        grid-column: span 4;
        height: 223px;
    }

    .catalog_category_item:nth-child(6n + 5) {
        grid-column: span 2;
        height: 223px;
    }

    .catalog_category_item:nth-child(6n + 6) {
        grid-column: span 6;
        height: 128px;
    }

    .catalog_category_item:last-child:nth-child(6n + 1),
    .catalog_category_item:last-child:nth-child(6n + 4) {
        grid-column: 1 / -1;
    }

    .catalog_category_item:nth-child(6n + 1) .catalog_category_image,
    .catalog_category_item:nth-child(6n + 2) .catalog_category_image,
    .catalog_category_item:nth-child(6n + 5) .catalog_category_image {
        right: auto;
        width: auto;
        min-width: 0;
        max-width: none;
        object-fit: contain;
        object-position: center;
        transform: none;
    }

    .catalog_category_item:nth-child(6n + 1) .catalog_category_image,
    .catalog_category_item:nth-child(6n + 2) .catalog_category_image {
        top: 16px;
        right: -20px;
        left: auto;
        max-width: calc(100% - 14px);
        height: calc(100% - 66px);
    }

    .catalog_category_item:nth-child(6n + 3) .catalog_category_image,
    .catalog_category_item:nth-child(6n + 6) .catalog_category_image {
        top: 0;
        right: auto;
        left: 50%;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: 100%;
        object-fit: cover;
        object-position: left center;
        transform: none;
    }

    .catalog_category_item:nth-child(6n + 4) .catalog_category_image {
        top: -16px;
        right: auto;
        left: 50%;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: calc(100% + 32px);
        object-fit: cover;
        object-position: left center;
        transform: none;
    }

    .catalog_category_item:nth-child(6n + 5) .catalog_category_image {
        top: 12px;
        right: -20px;
        left: auto;
        max-width: calc(100% - 10px);
        height: calc(100% - 62px);
    }

    .catalog_category_title {
        bottom: 10px;
        left: 12px;
        font-size: 15px;
    }
}

@media (hover: hover) {
    .catalog_category_item:hover {
        background-color: var(--color-ink-800);
        color: var(--color-white);
    }

    .catalog_category_item:hover .catalog_category_image {
        transform: scale(1.1);
    }
}
