/* ============================================================
   Cart — псевдо-корзина (страница /cart, тост, бейдж, кнопки)
   ============================================================ */

/* ---- Кнопки «В корзину» на карточках ---- */
button[data-cart-add] { cursor: pointer; }
button[data-cart-add].cart-added { background: #16a34a !important; border-color: #16a34a !important; color: #fff !important; }
.product-actions button[data-cart-add] { padding: 10px 14px; font-size: 13px; white-space: nowrap; }

/* ---- Бейдж корзины в шапке ---- */
.cart-nav-link { position: relative; }
.cart-nav-link .cart-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: #f39c12; color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1;
}

/* ---- Тост ---- */
.cart-toast {
    position: fixed; right: 20px; bottom: 24px; z-index: 12000;
    max-width: 320px; padding: 14px 18px;
    background: #1e293b; color: #fff; border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    font-size: 14px; line-height: 1.45;
}
.cart-toast--show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.cart-toast-text { margin-bottom: 6px; }
.cart-toast-link { color: #fbbf24; font-weight: 600; text-decoration: none; }
.cart-toast-link:hover { text-decoration: underline; }
@media (max-width: 640px) {
    .cart-toast { left: 16px; right: 16px; max-width: none; bottom: 16px; }
}

/* ---- Страница корзины ---- */
.cart-page-wrapper { max-width: 980px; margin: 0 auto; }
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; margin-top: 20px; }
.cart-items-list { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
    display: grid; grid-template-columns: 96px 1fr auto auto; gap: 16px; align-items: center;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px;
}
.cart-item-img {
    width: 96px; height: 96px; border-radius: 8px; background: #f8fafc;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.cart-item-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cart-item-img--empty { color: #cbd5e1; font-size: 12px; }
.cart-item-brand { font-size: 11.5px; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.cart-item-name { font-size: 15px; font-weight: 600; color: #1e293b; text-decoration: none; }
.cart-item-name:hover { color: var(--primary, #f39c12); }
.cart-item-price { font-size: 14px; color: #475569; margin-top: 6px; }

.cart-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.cart-qty { display: inline-flex; align-items: center; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.cart-qty button {
    width: 32px; height: 32px; border: none; background: #f8fafc; color: #334155;
    font-size: 16px; font-weight: 700; cursor: pointer; transition: background .15s;
}
.cart-qty button:hover { background: #fff7ea; color: var(--primary, #f39c12); }
.cart-qty input {
    width: 44px; height: 32px; border: none; text-align: center; font-size: 14px; font-weight: 600;
    color: #1e293b; outline: none; -moz-appearance: textfield;
}
.cart-qty input::-webkit-outer-spin-button, .cart-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item-sum { font-size: 15px; font-weight: 700; color: #1e293b; white-space: nowrap; }
.cart-item-remove {
    border: none; background: none; color: #94a3b8; cursor: pointer; font-size: 20px; line-height: 1;
    padding: 4px; transition: color .15s;
}
.cart-item-remove:hover { color: #ef4444; }

/* ---- Итого + форма оформления ---- */
.cart-summary {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px;
    position: sticky; top: 16px;
}
.cart-summary-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 14px; color: #475569; margin-bottom: 8px; }
.cart-summary-row strong { color: #1e293b; }
.cart-summary-total {
    display: flex; justify-content: space-between; align-items: baseline;
    border-top: 1px solid #e2e8f0; margin-top: 12px; padding-top: 12px; margin-bottom: 16px;
    font-size: 16px; font-weight: 700; color: #1e293b;
}
.cart-summary-total .cart-total-value { font-size: 20px; color: var(--primary, #f39c12); }
.cart-clear-btn { background: none; border: none; color: #94a3b8; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; margin-bottom: 14px; }
.cart-clear-btn:hover { color: #ef4444; }

.cart-form .form-group { margin-bottom: 12px; }

/* ---- Способ оплаты / лизинг ---- */
.cart-payment-options { display: flex; flex-direction: column; gap: 6px; }
.cart-pay-option {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13.5px; color: #334155; cursor: pointer; transition: border-color .2s, background .2s;
}
.cart-pay-option:hover { border-color: #f39c12; }
.cart-pay-option input { accent-color: #f39c12; width: 16px; height: 16px; flex-shrink: 0; margin: 0; }
.cart-pay-option:has(input:checked) { border-color: #f39c12; background: #fff7ea; }
.cart-leasing-banks {
    margin-top: 10px; padding: 12px; background: #fffbeb;
    border: 1px dashed #f59e0b; border-radius: 8px;
}
.cart-leasing-banks > label { font-size: 12.5px; font-weight: 600; color: #92400e; }
.cart-bank-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cart-bank-list .cart-pay-option { background: #fff; }
.cart-form label { display: block; font-size: 13px; font-weight: 600; color: #1e293b; margin-bottom: 5px; }
.cart-form input[type="text"], .cart-form input[type="tel"], .cart-form input[type="email"], .cart-form textarea {
    width: 100%; padding: 11px 13px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 14px; font-family: inherit; color: #1e293b; box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}
.cart-form input:focus, .cart-form textarea:focus {
    outline: none; border-color: #f39c12; box-shadow: 0 0 0 3px rgba(243,156,18,.12);
}
.cart-form textarea { resize: vertical; min-height: 72px; }
.cart-agree { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: #475569; cursor: pointer; }
.cart-agree input { margin-top: 2px; accent-color: #f39c12; width: 15px; height: 15px; flex-shrink: 0; }
.cart-agree a { color: #f39c12; }
.cart-submit {
    width: 100%; padding: 14px; border: none; border-radius: 10px;
    background: #f39c12; color: #fff; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: background .2s, transform .15s; margin-top: 4px;
}
.cart-submit:hover:not(:disabled) { background: #e67e22; transform: translateY(-1px); }
.cart-submit:disabled { opacity: .55; cursor: not-allowed; }
.cart-error { display: none; margin-top: 10px; padding: 10px 12px; background: #fee2e2; color: #b91c1c; border-radius: 8px; font-size: 13px; }
.cart-error--show { display: block; }

/* ---- Пустая корзина ---- */
.cart-empty {
    text-align: center; padding: 60px 20px; background: #fff;
    border: 1px dashed #cbd5e1; border-radius: 12px; margin-top: 20px;
}
.cart-empty-icon { font-size: 44px; margin-bottom: 12px; }
.cart-empty h2 { font-size: 20px; margin-bottom: 8px; }
.cart-empty p { color: #64748b; margin-bottom: 18px; }

/* ---- Успех ---- */
.cart-success {
    text-align: center; padding: 48px 24px; background: #f0fdf4;
    border: 1px solid #bbf7d0; border-radius: 12px; margin-top: 20px;
}
.cart-success-icon {
    width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
    background: #16a34a; color: #fff; display: flex; align-items: center; justify-content: center;
}
.cart-success h2 { font-size: 22px; color: #14532d; margin-bottom: 8px; }
.cart-success p { color: #166534; max-width: 480px; margin: 0 auto; }

.cart-note { font-size: 12.5px; color: #94a3b8; line-height: 1.5; margin-top: 12px; }

@media (max-width: 900px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
}
@media (max-width: 640px) {
    .cart-item { grid-template-columns: 72px 1fr; grid-template-rows: auto auto; }
    .cart-item-img { width: 72px; height: 72px; }
    .cart-item-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}
