.cart-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cart-clear-link {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.cart-empty {
    text-align: center;
    padding: 32px 0 16px 0;
}

.cart-empty-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.cart-empty-icon svg {
    width: 100%;
    height: 100%;
}

.cart-empty-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
}

.cart-empty-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

/* ===== Строка товара в корзине ===== */

.cart-item {
    position: relative;
    display: flex;
    gap: 12px;
    background-color: var(--bg-block);
    border-radius: var(--radius-block);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 14px;
    margin-bottom: 12px;
}

.cart-item-remove-form {
    position: absolute;
    top: 10px;
    right: 10px;
}

.cart-item-remove {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--color-text-muted);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cart-item-image {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-main);
    border-radius: 14px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 2px;
    padding-right: 22px;
}

.cart-item-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.cart-item-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    /* Прижимаем ряд цена+количество к низу блока, чтобы он не "съезжал"
       выше у товаров без цвета/категории (меньше строк .cart-item-meta
       перед ним) - см. обратную связь от Васи 09.09.2026. */
    margin-top: auto;
}

.cart-item-price {
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

.cart-item-price-old {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-price-old);
    text-decoration: line-through;
    margin-left: 6px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-main);
    border-radius: 999px;
    padding: 6px 12px;
    margin: 0 -4px 0 0;
}

.cart-item-qty button {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 18px;
    padding: 0;
    color: var(--color-text);
}

.cart-item-qty span {
    font-size: 14px;
    font-weight: 700;
    min-width: 14px;
    text-align: center;
}

/* ===== Секции оформления заказа ===== */

.checkout-section {
    background-color: var(--bg-block);
    border-radius: var(--radius-block);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 18px;
    margin-top: 14px;
}

.checkout-section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

.checkout-input {
    width: 100%;
    border: 1.5px solid #ececec;
    border-radius: 24px;
    padding: 14px 18px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    background-color: var(--bg-block);
    color: var(--color-text);
}

.checkout-input::placeholder {
    color: var(--color-text-muted);
}

.checkout-input:focus {
    outline: none;
    border-color: var(--color-text);
}

.checkout-input:last-child {
    margin-bottom: 0;
}

.checkout-input:disabled {
    opacity: 1;
    color: var(--color-text);
}

.field-error-text {
    display: none;
    color: #c0392b;
    font-size: 12px;
    margin: -4px 0 10px 4px;
}

.field-error-text.is-visible {
    display: block;
}

/* ===== Карточки-переключатели (способ доставки / тип и форма оплаты) =====
   Настоящие радиокнопки (input спрятан прозрачным поверх всей карточки) —
   переключение состояния делает сам браузер, JS не нужен. */

.checkout-option-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.checkout-option-row .checkout-option-card {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.checkout-option-row .checkout-option-card-text {
    white-space: normal;
    overflow-wrap: break-word;
}

.checkout-option-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1.5px solid #ececec;
    border-radius: 16px;
    padding: 14px 16px;
    background-color: #fff;
    cursor: pointer;
    margin-bottom: 8px;
}

.checkout-option-card:last-child {
    margin-bottom: 0;
}

.checkout-option-card--wide {
    width: 100%;
}

.checkout-option-card input[type="radio"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.checkout-option-card-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 14px;
    color: var(--color-text);
}

.checkout-option-card-hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-muted);
}

.checkout-option-check {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #d8d8d8;
    background-color: #fff;
    flex-shrink: 0;
}

.checkout-option-card:has(input:checked) {
    border-color: var(--color-text);
    background-color: #fff;
}

.checkout-option-card:has(input:checked) .checkout-option-check {
    background-color: var(--color-text);
    border-color: var(--color-text);
}

.checkout-option-card:has(input:checked) .checkout-option-check::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}

/* ===== Промокод ===== */

.promo-input-wrap {
    position: relative;
    flex: 1;
}

.promo-input-wrap .checkout-input {
    margin-bottom: 0;
    padding-right: 44px;
}

.promo-input--applied {
    border-color: #2fa84f;
}

.promo-input--invalid {
    border-color: #c0392b;
}

.promo-check-badge {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #2fa84f;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-apply-btn,
.promo-remove-btn {
    background: none;
    border: 1.5px solid #ececec;
    border-radius: 24px;
    padding: 0 20px;
    min-width: 118px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    color: var(--color-text);
    text-align: center;
}

.promo-error-text {
    color: #c0392b;
    font-size: 13px;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 4px 0;
    color: var(--color-text-muted);
}

.checkout-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 17px;
    font-weight: 800;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid #eee;
    color: var(--color-text);
}

.checkout-summary-row[hidden],
.checkout-summary-total[hidden],
.checkout-payment-split[hidden] {
    display: none;
}

.checkout-payment-split {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.checkout-payment-split-tile {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 10px;
    border-radius: 14px;
    background-color: var(--bg-main);
    text-align: center;
}

.checkout-payment-split-label {
    font-size: 12px;
    color: var(--color-text-muted);
}

.checkout-payment-split-amount {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-text);
}

/* ===== Согласие с условиями =====
   Чекбокс — САМ по себе, без <label> вокруг всего текста: раньше тап
   в любом месте абзаца (включая случайный промах мимо ссылки) переключал
   галку. Теперь только сам маленький квадрат — переключаемый элемент,
   а ссылки внутри текста кликабельны независимо и никак не пересекаются
   с ним по площади нажатия. */

.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 0 4px;
}

.terms-row--tight {
    margin-top: 8px;
}

.terms-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--color-text);
    cursor: pointer;
}

.terms-text {
    font-size: 13px;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.terms-link {
    color: #1a73e8;
    font-weight: 600;
    text-decoration: underline;
}

.checkout-submit-btn {
    width: 100%;
    text-align: center;
    padding: 17px;
    border-radius: var(--radius-block);
    background-color: #1a1a1a;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    border: none;
    margin-top: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    transition: opacity 0.15s ease;
}

.checkout-submit-btn:active {
    opacity: 0.85;
}

.checkout-input--error {
    border-color: #c0392b;
}

.terms-row--error .terms-checkbox {
    outline: 2px solid #c0392b;
    outline-offset: 3px;
    border-radius: 4px;
}

.terms-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%) translateY(12px);
    max-width: calc(100% - 32px);
    background-color: #1a1a1a;
    color: #fff;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.terms-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
