/* =========================================================
   Ассортимент — auto-parts page section
   ========================================================= */

.assortment {
    background: #fff;
    padding: 48px 120px 24px;
}

.assortment__inner {
    display: flex;
    flex-direction: column;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ----- Header -------------------------------------------- */

.assortment__header {
    display: flex;
    align-items: center;
    gap: 32px;
}

.assortment__header-left {
    width: 4px;
    flex-shrink: 0;
    align-self: stretch;
    background: var(--color-primary);
}

.assortment__header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.assortment__title {
    font-family: var(--font-neo);
    font-size: 48px;
    line-height: 58px;
    letter-spacing: -1.8px;
    color: var(--color-black);
    font-weight: normal;
    margin: 0;
}

.assortment__desc-block {
    /* desktop: no extra treatment, border is from header-left */
}

.assortment__desc {
    font-family: var(--font-inter);
    font-size: 19px;
    line-height: 30px;
    color: var(--color-text-muted);
    max-width: 800px;
    margin: 0;
}

.assortment__logo {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: #D4DBDB;
}

.assortment__logo svg {
    display: block;
    width: 100%;
    height: auto;
}

/* ----- Grid ---------------------------------------------- */

.assortment__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.assortment__card--extra {
    display: none;
}

/* ----- Cards --------------------------------------------- */

.assortment__card {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.assortment__card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--color-bg-light);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.assortment__card-link {
    position: absolute;
    inset: 0;
    display: block;
    z-index: 1;
}

.assortment__card-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s ease;
}

.assortment__card-link:hover::after {
    background: rgba(0, 0, 0, 0.18);
}

.assortment__card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-width: none;
}

.assortment__card-name {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.assortment__card-name-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.assortment__card-name-link:hover .assortment__card-title {
    color: var(--color-primary);
}

.assortment__card-title {
    font-family: var(--font-neo);
    font-size: 24px;
    line-height: 28px;
    color: var(--color-black);
    font-weight: normal;
    margin: 0;
}

.assortment__card-sub {
    font-family: var(--font-inter);
    font-size: 19px;
    line-height: 30px;
    color: var(--color-black);
    opacity: 0.7;
    margin: 0;
}

/* ----- Footer -------------------------------------------- */

.assortment__footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 32px;
}

.assortment__divider {
    width: 100%;
    border: none;
    border-top: 1px solid #d0d0d0;
    margin: 0;
}

/* button inherits from .btn--ghost in buttons.css */

/* ==========================================================
   Tablet  ≤ 1170 px
   ========================================================== */

@media (max-width: 1170px) {
    .assortment {
        padding: 48px 40px 32px;
    }

    .assortment__inner {
        gap: 48px;
    }

    .assortment__title {
        font-size: 36px;
        line-height: 44px;
        letter-spacing: -1.2px;
    }

    .assortment__desc {
        font-size: 16px;
        line-height: 24px;
    }

    .assortment__logo {
        width: 180px;
        height: auto;
    }

    .assortment__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .assortment__card-title {
        font-size: 20px;
    }

    .assortment__card-sub {
        font-size: 16px;
    }
}

/* ==========================================================
   Mobile  ≤ 640 px
   ========================================================== */

@media (max-width: 640px) {
    .assortment {
        padding: 32px 24px;
    }

    .assortment__inner {
        gap: 32px;
    }

    /* On mobile: title alone at the top, then desc-block with its own border */
    .assortment__header {
        flex-direction: column;
        gap: 0;
    }

    .assortment__header-left {
        display: none;
    }

    .assortment__title {
        font-size: 32px;
        line-height: 37px;
        letter-spacing: 0;
        margin-bottom: 32px;
    }

    .assortment__desc-block {
        display: flex;
        gap: 16px;
    }

    .assortment__desc-block::before {
        content: '';
        width: 4px;
        flex-shrink: 0;
        background: var(--color-primary);
    }

    .assortment__desc {
        font-size: 14px;
        line-height: 22px;
        max-width: none;
    }

    .assortment__logo {
        display: none;
    }

    /* Grid: 2 columns */
    .assortment__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 16px;
    }

    .assortment__card {
        gap: 16px;
    }

    .assortment__card-title {
        font-family: var(--font-neo);
        font-size: 18px;
        line-height: normal;
        font-weight: 500;
    }

    .assortment__card-sub {
        font-family: var(--font-neo);
        font-size: 16px;
        line-height: 21px;
        color: var(--color-text-muted);
        opacity: 1;
    }

    /* Footer: full-width button */
    .assortment__footer {
        align-items: stretch;
    }

    .assortment__footer .btn {
        width: 100%;
        height: 44px;
        font-size: 16px;
        line-height: 21px;
        justify-content: center;
    }
}
