/* Корзина (offcanvas) и общие элементы списка позиций чекаута */

.cart-offcanvas {
    width: min(440px, 100vw) !important;
}

.cart-offcanvas .offcanvas-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.cart-count-badge {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-scroll {
    background: #f6f7f9;
    padding: 12px;
}

.cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #6b7280;
    padding: 40px 16px;
    text-align: center;
}

.cart-empty .bi {
    font-size: 2.6rem;
    color: #d1d5db;
}

.cart-order {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.cart-order__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f1f3;
}

.cart-order__title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 0.9rem;
}

.cart-order__title strong {
    overflow-wrap: anywhere;
}

.cart-order__kind {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #dc3545;
}

.cart-order__system {
    font-size: 0.78rem;
    color: #6b7280;
}

.cart-order__actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.cart-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.cart-icon-btn:hover {
    color: #dc3545;
    border-color: #dc3545;
}

.cart-lines {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cart-line {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #f3f4f6;
    font-size: 0.85rem;
}

.cart-line:first-child {
    border-top: 0;
}

.cart-line__img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    background: #f9fafb;
}

.cart-line__img--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
    font-size: 1.2rem;
}

.cart-line__name {
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.cart-line__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.cart-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.cart-chip--opt {
    background: #fef2f2;
    color: #b91c1c;
}

.cart-line__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: nowrap;
}

.cart-line__qty {
    font-size: 0.72rem;
    color: #6b7280;
}

.cart-summary {
    border-top: 1px solid #e5e7eb;
    background: #fff;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    font-size: 0.9rem;
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    color: #4b5563;
    margin-bottom: 4px;
}

.cart-summary__total {
    color: #111827;
    font-weight: 800;
    font-size: 1.05rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 6px;
    margin-top: 6px;
}

.cart-summary__note {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: right;
}

/* --- Чекаут: обзор всей корзины --- */
.checkout-review {
    background: #f6f7f9;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 24px;
}

.checkout-review__title {
    font-weight: 800;
    margin: 0 0 12px;
}

.cart-order__sum {
    font-weight: 800;
    white-space: nowrap;
}

.checkout-totals {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 420px;
    margin-left: auto;
    font-size: 0.95rem;
}

@media (max-width: 575.98px) {
    .checkout-review {
        padding: 10px;
    }

    .checkout-totals {
        max-width: none;
    }
}

/* --- Индикатор загрузки (busy.js) --- */
.page-busy {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(2px);
}

.page-busy.is-visible {
    display: flex;
}

.page-busy__box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    font-weight: 700;
    color: #111827;
}

html.is-busy, html.is-busy body {
    cursor: progress;
}

/* --- Конфигуратор: строка автосохранения и сброса (plan_state.js) --- */
.konfig-draft-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 12px 0 8px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    font-size: 0.85rem;
}

.konfig-draft-bar__state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4b5563;
}

.konfig-draft-bar__state .bi {
    color: #9ca3af;
    font-size: 1.1rem;
}

.konfig-draft-bar[data-state="saved"] .bi,
.konfig-draft-bar[data-state="restored"] .bi {
    color: #16a34a;
}

.konfig-draft-bar[data-state="restored"] {
    border-color: #bfdbfe;
    background: #eff6ff;
}
