@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

.orders-container {
  max-width: 850px;
  margin: 50px auto;
  padding: 0 24px;
  font-family: 'Montserrat', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 32px;
  letter-spacing: -0.5px;
}

/* Кнопка назад */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

.back-btn:hover {
  color: #0f172a;
}

/* Минималистичная карточка */
.order-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 28px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  margin-bottom: 28px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.order-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* Шапка заказа */
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.order-id {
  font-weight: 700;
  font-size: 1.15rem;
  color: #0f172a;
}

/* Сдержанные статусы */
.order-status {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: #f1f5f9;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.order-status.status-processing, .order-status.status-setting_up { 
  background-color: #fef3c7; 
  color: #d97706; 
}
.order-status.status-delivered { 
  background-color: #dcfce7; 
  color: #15803d; 
}
.order-status.status-canceled { 
  background-color: #fee2e2; 
  color: #b91c1c; 
}

/* Строгая информационная сетка */
.order-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
  margin-bottom: 24px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-item.full-width {
  grid-column: 1 / -1;
}

.meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
}

/* Промокод */
.promo-badge-clean {
  background-color: #fafafa;
  border: 1px dashed #e2e8f0;
  color: #475569;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Список товаров */
.order-items {
  margin: 28px 0;
}

.order-items h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.order-items ul.goods {
  padding: 0;
  list-style: none;
  margin: 0;
}

.order-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.95rem;
  color: #334155;
}

.product-name {
  font-weight: 500;
}

.product-dash {
  flex: 1;
  border-bottom: 1px dashed #e2e8f0;
  margin: 0 16px;
  position: relative;
  top: -4px;
}

.product-price {
  font-weight: 600;
  color: #0f172a;
}

/* Нижняя строка */
.order-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

.order-total {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.total-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-amount {
  font-weight: 700;
  color: #e38929;
  font-size: 1.4rem;
  transition: color 0.2s ease;
}

/* Кнопки отмены */
.cancel-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.cancel-btn.active {
  background-color: #fff1f2;
  border-color: #ffe4e6;
  color: #e11d48;
}

.cancel-btn.active:hover {
  background-color: #e11d48;
  border-color: #e11d48;
  color: #ffffff;
}

.cancel-btn.inactive {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

.empty-message {
  text-align: center;
  color: #64748b;
  font-size: 1.1rem;
  margin-top: 48px;
}

/* Адаптив */
@media (max-width: 640px) {
  .order-meta-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .order-footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .cancel-btn {
    width: 100%;
    text-align: center;
  }
}

/* Позиционирование элементов внутри кнопки */
.cancel-btn.active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
}

/* Скрытый по умолчанию спиннер */
.cancel-btn .btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff; /* Цвет вращающейся линии спиннера */
  animation: spin-cancel 0.8s linear infinite;
  margin-left: 8px;
}

/* Состояние во время отправки запроса */
.cancel-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.cancel-btn.loading .btn-spinner {
  display: inline-block; /* Показываем крутилку */
}

/* Анимация вращения */
@keyframes spin-cancel {
  to { transform: rotate(360deg); }
}
