/* =============================================
   Бонусный кошелёк — страница /bonus
   ============================================= */

.bonus-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 30px 16px 60px;
}

.bonus-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    transition: color var(--transition-medium);
}

.bonus-back-link:hover {
    color: var(--primary-dark);
}

.bonus-page-title {
    font-size: 24px;
    color: var(--secondary);
    margin-bottom: 24px;
}

.bonus-page-title i {
    color: var(--primary);
    margin-right: 8px;
}

/* === Карточка входа === */

.bonus-login-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 30px;
}

.bonus-login-title {
    font-size: 18px;
    color: var(--secondary);
    margin-bottom: 6px;
}

.bonus-login-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
    font-weight: 400;
}

.bonus-login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bonus-form-group label {
    display: block;
    font-size: 13px;
    color: var(--secondary);
    margin-bottom: 4px;
    font-weight: 600;
}

.bonus-form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    transition: border-color var(--transition-medium);
}

.bonus-form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.bonus-login-error {
    padding: 8px 12px;
    background: #fdecea;
    color: var(--error);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
}

.bonus-login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.bonus-login-btn:hover {
    background: var(--primary-dark);
}

/* Ссылка на политику обработки персональных данных под кнопкой входа */
.bonus-privacy-note {
    margin-top: 12px;
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.4;
    color: #777;
    text-align: center;
}

.bonus-privacy-note a {
    color: inherit;
    text-decoration: underline;
}

.bonus-login-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* === Дашборд === */

.bonus-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bonus-balance-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    position: relative;
}

.bonus-balance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.bonus-greeting {
    font-size: 16px;
    color: var(--secondary);
    margin-bottom: 4px;
    font-weight: 400;
}

.bonus-balance-label {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.bonus-balance-value {
    font-size: 36px;
    color: var(--primary);
    font-weight: 700;
    line-height: 1.2;
}

.bonus-balance-value small {
    font-size: 16px;
    color: #888;
    font-weight: 400;
}

.bonus-balance-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bonus-balance-icon i {
    font-size: 24px;
    color: var(--primary);
}

.bonus-info-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.bonus-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--secondary);
    font-weight: 400;
}

.bonus-info-item i {
    color: var(--primary);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.bonus-expiry {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #fff8e1;
    border-radius: var(--border-radius-sm);
}

.bonus-expiry-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary);
}

.bonus-expiry-item i {
    color: #f57f17;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.bonus-expiry-hint {
    margin: 0;
    font-size: 12px;
    color: #888;
}

.bonus-spending-info {
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
}

.bonus-spending-info.bonus-spending-info--online {
    background: #e8f5e9;
    color: #2e7d32;
}

.bonus-spending-info.bonus-spending-info--cashier {
    background: #fff8e1;
    color: #f57f17;
}

.bonus-logout-btn {
    margin-top: 12px;
    background: none;
    border: 1px solid #ddd;
    color: #888;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.bonus-logout-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

/* Кнопки под балансом: «Мои заказы» и «Выйти» в одну строку, на узком экране переносятся */
.bonus-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.bonus-actions .bonus-logout-btn {
    margin-top: 0;
}

.bonus-orders-btn,
.bonus-actions .bonus-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

/* Тот же вид, что у кнопки «Мои заказы» в шапке (my-orders.css) */
.bonus-orders-btn {
    background: var(--secondary);
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.bonus-orders-btn i {
    font-size: 12px;
}

.bonus-orders-btn:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.bonus-orders-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* === История === */

.bonus-history-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.bonus-history-title {
    font-size: 18px;
    color: var(--secondary);
    margin-bottom: 16px;
}

.bonus-history-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bonus-history-loading {
    text-align: center;
    color: #888;
    padding: 20px;
}

.bonus-history-empty {
    text-align: center;
    color: #aaa;
    padding: 30px 10px;
    font-size: 14px;
}

.bonus-tx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
}

.bonus-tx-row:last-child {
    border-bottom: none;
}

.bonus-tx-left {
    flex: 1;
    min-width: 0;
}

.bonus-tx-desc {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bonus-tx-date {
    font-size: 12px;
    color: #aaa;
}

.bonus-tx-right {
    text-align: right;
    flex-shrink: 0;
}

.bonus-tx-points {
    font-size: 16px;
    font-weight: 700;
}

.bonus-tx-points--earned {
    color: var(--success);
}

.bonus-tx-points--spent {
    color: var(--error);
}

.bonus-tx-balance {
    font-size: 11px;
    color: #bbb;
}

.bonus-history-more-btn {
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    background: var(--light);
    border: 1px solid #ddd;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    color: var(--secondary);
    cursor: pointer;
    transition: all var(--transition-medium);
}

.bonus-history-more-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* === Адаптив === */

@media (max-width: 768px) {
    .bonus-page {
        padding: 20px 12px 40px;
    }

    .bonus-balance-value {
        font-size: 28px;
    }

    .bonus-login-card,
    .bonus-balance-card,
    .bonus-history-card {
        padding: 18px;
    }
}
