.basket-main-container {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header__icons {
    position: relative;
}

/* =========================
   Мини-корзина
   ========================= */

.header-mini-cart {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 14px);
    right: 0;

    display: flex;
    flex-direction: column;

    width: 426px;
    max-width: calc(100vw - 24px);
    max-height: min(649px, calc(100vh - 120px));

    color: #111;
    background-color: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);

    transition:
            opacity 0.2s ease,
            visibility 0.2s ease,
            transform 0.2s ease;
}

/*
 * Невидимая область между кнопкой корзины
 * и выпадающим блоком, чтобы hover не обрывался.
 */
.header-mini-cart::before {
    content: "";

    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;

    height: 16px;
}

.header-mini-cart--active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* =========================
   Список товаров
   ========================= */

.header-mini-cart__products {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 16px;

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.header-mini-cart__product {
    display: flex;
    align-items: flex-start;
    gap: 22px;

    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 16px 0;

    background: transparent;
    border: 0;
    border-bottom: 1px solid #e5e5e5;
    border-radius: 0;
    box-shadow: none;
}

.header-mini-cart__product:last-child {
    border-bottom: 0;
}

/* =========================
   Изображение
   ========================= */

.header-mini-cart__image-link {
    position: relative;

    flex: 0 0 118px;
    display: block;

    width: 118px;
    height: 143px;
    min-width: 118px;
    margin: 0;
    padding: 0;

    background-color: #eef1f2;
    overflow: hidden;
}

.header-mini-cart__image {
    display: block;

    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;

    object-fit: cover;
    object-position: center top;
}

.header-mini-cart__discount {
    position: absolute;
    right: 4px;
    bottom: 4px;

    padding: 2px 4px;

    color: #fff;
    font-size: 9px;
    line-height: 1;
    background-color: #111;
}

/* =========================
   Контент карточки
   ========================= */

.header-mini-cart__content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;

    min-width: 0;
    height: 143px;
    margin: 0;
    padding: 0;
}

.header-mini-cart__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;

    width: 100%;
    min-width: 0;
    min-height: 24px;
    margin: 0;
    padding: 0;
}

.header-mini-cart__article {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;

    color: #999;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* =========================
   Удаление
   ========================= */

.header-mini-cart__remove {
    flex: 0 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;
    margin: -2px 0 0;
    padding: 0;

    color: #111;
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
}

.header-mini-cart__remove-icon {
    display: block;

    width: 16px;
    height: 16px;

    pointer-events: none;
}

.header-mini-cart__remove:hover {
    opacity: 0.5;
}

/* =========================
   Название
   ========================= */

.header-mini-cart__name {
    display: -webkit-box;

    width: 100%;
    min-width: 0;
    margin: 1px 0 0;
    padding: 0;

    color: #111;
    font-size: 18px;
    font-weight: 400;
    line-height: 22px;
    text-decoration: none;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.header-mini-cart__name:hover {
    color: #111;
    opacity: 0.65;
}

/* =========================
   Свойства
   ========================= */

.header-mini-cart__properties {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 14px;

    width: 100%;
    min-width: 0;
    margin: 6px 0 0;
    padding: 0;
}

.header-mini-cart__property {
    display: flex;
    align-items: center;
    gap: 4px;

    min-width: 0;
    margin: 0;
    padding: 0;

    font-size: 9px;
    font-weight: 400;
    line-height: 12px;
}

.header-mini-cart__property-name {
    flex: 0 0 auto;
    color: #aaa;
}

.header-mini-cart__property-value {
    min-width: 0;
    max-width: 90px;

    color: #777;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* =========================
   Цена и количество
   ========================= */

.header-mini-cart__price {
    margin: auto 0 0;
    padding: 0;

    color: #111;
    font-size: 24px;
    font-weight: 500;
    line-height: 28px;
    white-space: nowrap;
}

.header-mini-cart__discount-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;

    margin: 3px 0 0;
    padding: 0;

    font-size: 9px;
    line-height: 11px;
}

.header-mini-cart__old-price {
    color: #999;
    text-decoration: line-through;
}

.header-mini-cart__economy {
    color: #398b4b;
}

.header-mini-cart__quantity {
    margin: 3px 0 0;
    padding: 0;

    color: #111;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    white-space: nowrap;
}

/* =========================
   Пустая корзина
   ========================= */

.header-mini-cart__empty {
    padding: 32px 12px;

    color: #777;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}

/* =========================
   Нижняя часть
   ========================= */

.header-mini-cart__footer {
    flex: 0 0 auto;

    width: 100%;
    margin: 0;
    padding: 16px;

    background-color: #fff;
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.header-mini-cart__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    width: 100%;
    margin: 0;
    padding: 0;
}

.header-mini-cart__summary-label {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;

    color: #111;
    font-size: 18px;
    font-weight: 400;
    line-height: 22px;
}

.header-mini-cart__summary-price {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;

    color: #111;
    font-size: 24px;
    font-weight: 500;
    line-height: 28px;
    text-align: right;
    white-space: nowrap;
}

/* =========================
   Ссылки внизу
   ========================= */

.header-mini-cart__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    width: 100%;
    margin: 18px 0 0;
    padding: 0;
}

.header-mini-cart__action {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;

    min-width: 0;
    margin: 0;
    padding: 0;

    color: #111;
    font-size: 20px;
    font-weight: 400;
    line-height: 24px;
    text-decoration: none;
    white-space: nowrap;
}

.header-mini-cart__action:hover {
    color: #111;
    opacity: 0.55;
}

.header-mini-cart__action-icon {
    flex: 0 0 16px;
    display: block;

    width: 16px;
    height: 16px;
}

/* =========================
   SVG-спрайт
   ========================= */

.header-mini-cart__sprite {
    position: absolute;

    width: 0;
    height: 0;

    overflow: hidden;
}

/* =========================
   Скролл
   ========================= */

.header-mini-cart__products::-webkit-scrollbar {
    width: 4px;
}

.header-mini-cart__products::-webkit-scrollbar-track {
    background: transparent;
}

.header-mini-cart__products::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

/* Firefox */
.header-mini-cart__products {
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* =========================
   Планшет и мобильные
   ========================= */

@media (max-width: 1024px) {
    .basket-main-container {
        display: none;
    }

    .header-mini-cart {
        position: fixed;
        top: auto;
        right: 12px;
        bottom: 76px;
        left: auto;

        max-height: calc(100vh - 100px);
    }

    .header-mini-cart::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-mini-cart {
        right: 8px;

        width: calc(100vw - 16px);
        max-width: none;
    }

    .header-mini-cart__products {
        padding-right: 12px;
        padding-left: 12px;
    }

    .header-mini-cart__product {
        gap: 14px;
        padding: 14px 0;
    }

    .header-mini-cart__image-link {
        flex-basis: 100px;

        width: 100px;
        height: 130px;
        min-width: 100px;
    }

    .header-mini-cart__content {
        height: 130px;
    }

    .header-mini-cart__footer {
        padding: 14px 12px;
    }

    .header-mini-cart__actions {
        gap: 10px;
    }
}

@media (max-width: 380px) {
    .header-mini-cart__image-link {
        flex-basis: 88px;

        width: 88px;
        height: 118px;
        min-width: 88px;
    }

    .header-mini-cart__content {
        height: 118px;
    }

    .header-mini-cart__actions {
        flex-direction: column;
        align-items: flex-start;
    }
}