/* Мини-виджет корзины в шапке сайта (ТЗ п.3) */

.header-cart-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.header-cart-wrap .header-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-cart__count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e21f26;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    font-weight: bold;
}

.header-cart-wrap.empted .header-cart__count,
.header-cart-wrap .header-cart[data-count="0"] + .ajax_basket .basket-mini__head-count {
    display: none;
}

.header-cart-wrap .ajax_basket {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 999;
    display: none;
    width: 360px;
    padding-top: 12px;
    text-align: left;
}

.header-cart-wrap.opened .ajax_basket {
    display: block;
}

.basket-mini__inner {
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    padding: 14px;
    max-height: 70vh;
    overflow: auto;
}

.basket-mini__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    font-weight: bold;
    color: #333;
}

.basket-mini__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.basket-mini__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f2f2f2;
    position: relative;
}

.basket-mini__image {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.basket-mini__image img {
    max-width: 100%;
    max-height: 100%;
}

.basket-mini__info {
    flex: 1 1 auto;
    min-width: 0;
}

.basket-mini__title {
    display: block;
    font-size: 13px;
    line-height: 1.3;
    color: #333;
    max-height: 34px;
    overflow: hidden;
}

.basket-mini__stock {
    display: inline-block;
    margin: 3px 0;
    font-size: 11px;
    line-height: 1.4;
}

.basket-mini__stock--in {
    color: #1c9e3f;
}

.basket-mini__stock--out {
    color: #999;
}

.basket-mini__amount,
.basket-mini__summ {
    font-size: 12px;
    color: #666;
}

.basket-mini__summ {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.basket-mini__remove {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    cursor: pointer;
    background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center no-repeat;
    background-size: 14px 14px;
}

.basket-mini__remove:hover {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e21f26' stroke-width='2'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
}

.basket-mini__foot {
    padding-top: 12px;
    text-align: right;
}

.basket-mini__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 15px;
    color: #333;
}

.basket-mini__total-value {
    font-weight: bold;
    font-size: 17px;
}

.basket-mini__order {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
}

.basket-mini__links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

.basket-mini__link,
.basket-mini__clear {
    color: #777;
    cursor: pointer;
    text-decoration: underline;
}

.basket-mini__clear:hover,
.basket-mini__link:hover {
    color: #e21f26;
}

.basket-mini__empty {
    padding: 8px 0;
    text-align: center;
    color: #777;
    font-size: 13px;
}

.basket-mini__empty-text {
    margin-bottom: 6px;
}

@media (max-width: 600px) {
    .header-cart-wrap .ajax_basket {
        width: 300px;
        right: -60px;
    }
}
