/* ================================================================
   shop.css — стили корзины, избранного, тостов
   ================================================================ */

/* ── Toast ───────────────────────────────────────────────────── */
.shop-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: #222;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 9999;
}
.shop-toast--show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.shop-toast--success { background: #166534; }
.shop-toast--info    { background: #1e40af; }
.shop-toast--error   { background: #991b1b; }

/* ── Счётчик на иконке ───────────────────────────────────────── */
[data-shop-cart-count],
[data-shop-fav-count] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--color-primary, #2563eb);
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* ── Кнопка В корзину ────────────────────────────────────────── */
[data-add-to-cart].in-cart {
    background: var(--color-success, #166534);
    border-color: var(--color-success, #166534);
    color: #fff;
}

/* ── Кнопка избранного ───────────────────────────────────────── */
[data-toggle-fav] {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #9ca3af;
    font-size: 20px;
    line-height: 1;
    transition: color .2s, transform .15s;
}
[data-toggle-fav]:hover                { color: #e11d48; transform: scale(1.15); }
[data-toggle-fav].is-fav              { color: #e11d48; }
[data-toggle-fav].is-fav::before      { content: '♥'; }
[data-toggle-fav]:not(.is-fav)::before { content: '♡'; }

/* ── Мини-корзина ────────────────────────────────────────────── */
.shop-mini-cart__empty  { padding: 16px; color: #6b7280; text-align: center; }
.shop-mini-cart__list   { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.shop-mini-cart__item   { display: flex; align-items: center; gap: 10px;
                           padding: 10px 14px; border-bottom: 1px solid #f3f4f6; }
.shop-mini-cart__thumb  { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.shop-mini-cart__info   { flex: 1; min-width: 0; }
.shop-mini-cart__name   { display: block; font-size: 13px; color: inherit; text-decoration: none;
                           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-mini-cart__name:hover { text-decoration: underline; }
.shop-mini-cart__qty-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.shop-mini-cart__qty-btn { width: 22px; height: 22px; border: 1px solid #d1d5db; background: #f9fafb;
                            border-radius: 4px; cursor: pointer; font-size: 14px; line-height: 1;
                            display: flex; align-items: center; justify-content: center; }
.shop-mini-cart__qty-btn:hover { background: #e5e7eb; }
.shop-mini-cart__qty    { font-size: 13px; min-width: 20px; text-align: center; }
.shop-mini-cart__right  { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.shop-mini-cart__price  { font-size: 13px; font-weight: 600; white-space: nowrap; }
.shop-mini-cart__remove { background: none; border: none; cursor: pointer;
                           color: #9ca3af; font-size: 14px; line-height: 1; padding: 2px; }
.shop-mini-cart__remove:hover { color: #ef4444; }
.shop-mini-cart__footer { padding: 12px 14px; border-top: 1px solid #e5e7eb;
                           display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-mini-cart__total  { font-size: 14px; }

/* ── Страница корзины ────────────────────────────────────────── */
.shop-cart-empty          { text-align: center; padding: 60px 20px; color: #6b7280; }
.shop-cart-empty .btn     { margin-top: 16px; }
.shop-cart-items          { display: flex; flex-direction: column; }

.shop-cart-row {
    display: grid;
    grid-template-columns: 80px 1fr 110px 140px 110px 36px;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}
@media (max-width: 768px) {
    .shop-cart-row                { grid-template-columns: 64px 1fr 36px; }
    .shop-cart-row__price         { display: none; }
    .shop-cart-row__qty           { grid-column: 2; }
    .shop-cart-row__total         { grid-column: 2; font-weight: 600; }
    .shop-cart-row__remove        { grid-column: 3; grid-row: 1; }
}
.shop-cart-row__thumb  { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }
.shop-cart-row__name a { color: inherit; text-decoration: none; }
.shop-cart-row__name a:hover { text-decoration: underline; }
.shop-cart-row__price  { color: #6b7280; }
.shop-cart-row__qty    { display: flex; align-items: center; gap: 6px; }
.shop-cart-row__total  { font-weight: 600; }
.shop-cart-row__remove { background: none; border: none; cursor: pointer;
                          color: #9ca3af; font-size: 18px; }
.shop-cart-row__remove:hover { color: #ef4444; }

.shop-cart-qty-btn {
    width: 32px; height: 32px;
    border: 1px solid #d1d5db; background: #f9fafb;
    border-radius: 6px; cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.shop-cart-qty-btn:hover { background: #e5e7eb; }

.shop-cart-qty-input {
    width: 52px; text-align: center;
    border: 1px solid #d1d5db; border-radius: 6px;
    padding: 4px; font-size: 14px;
}
.shop-cart-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.shop-cart-footer {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 20px 0; gap: 16px; flex-wrap: wrap;
}
.shop-cart-summary { display: flex; align-items: center; gap: 20px; }
.shop-cart-total   { font-size: 18px; }
