/* Explain: Styles for cart icon, badge, items, quantity controls, and buttons. */
/* Корзина: значок в шапке, элементы списка, счётчик количества */
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--green-color);
    transition: all 250ms ease;
}

.cart-link:hover,
.cart-link:focus-visible {
    border-color: var(--green-color);
    color: var(--gold-deep);
}

.cart-badge {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    min-width: 1.2rem;
    height: 1.2rem;
    padding-inline: 0.25rem;
    border-radius: 999px;
    background: var(--gold-color);
    color: var(--green-deep);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2rem;
    text-align: center;
}

.cart-badge.is-hidden {
    display: none;
}

.cart-hidden {
    display: none !important;
}

.cart-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-soft);
    background: var(--surface-color);
    box-shadow: var(--shadow-card);
}

.cart-item-img {
    width: 5.25rem;
    height: 5.25rem;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 1rem;
    background: var(--surface-warm);
}

.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--green-color);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 200ms ease;
}

.qty-btn:hover {
    border-color: var(--green-color);
    background: var(--green-color);
    color: var(--gold-soft);
}

.qty-value {
    min-width: 2rem;
    text-align: center;
    font-weight: 700;
    color: var(--green-color);
}

.cart-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-left: auto;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 200ms ease;
}

.cart-remove:hover {
    color: #b23b3b;
    background: rgba(178, 59, 59, 0.1);
}

.add-cart {
    width: 100%;
    padding-block: 0.55rem;
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .cart-item {
        padding: 0.65rem;
        gap: 0.6rem;
    }

    .cart-item-img {
        width: 4rem;
        height: 4rem;
    }

    .add-cart {
        font-size: 0.78rem;
    }
}