/* My Orders page — Hanzo red/black theme */
.orders-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.orders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--red-border);
  background: rgba(12, 12, 12, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.orders-header .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}

.orders-header .brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.orders-header .brand span { color: var(--red); }

.orders-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.orders-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s;
}

.orders-nav a:hover {
  color: var(--text);
  background: var(--red-dim);
}

.orders-nav a.active {
  color: #fff;
  background: var(--red-dim);
  border: 1px solid var(--red-border);
}

.orders-main {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.orders-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.orders-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.orders-hero h1 i { color: var(--red); font-size: 1.5rem; }

.orders-hero p {
  color: var(--muted);
  font-size: 0.95rem;
}

.orders-card {
  background: rgba(17, 17, 17, 0.95);
  border: 1px solid var(--red-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--red-dim);
}

.orders-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.35rem;
  background: var(--surface2);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.orders-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.orders-tab:hover { color: var(--text); }

.orders-tab.active {
  background: linear-gradient(135deg, var(--red), #6600cc);
  color: #fff;
  box-shadow: 0 4px 16px var(--red-glow);
}

.orders-tab i { font-size: 0.9rem; }

.field-group { margin-bottom: 1rem; }

.field-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.field-label i { color: var(--red); font-size: 0.75rem; }

.orders-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.orders-input:focus {
  border-color: var(--red-border);
  box-shadow: 0 0 0 3px var(--red-dim);
}

.orders-input::placeholder { color: #555; }

.orders-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.orders-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.orders-btn.primary {
  background: linear-gradient(135deg, var(--red), #6600cc);
  color: #fff;
  box-shadow: 0 4px 20px var(--red-glow);
  margin-top: 0.5rem;
}

.orders-btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--red-glow);
}

.orders-btn.secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.orders-btn.secondary:hover:not(:disabled) {
  border-color: var(--red-border);
}

.orders-btn.sm {
  width: auto;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.field-hint {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 1rem;
}

.auth-toggle {
  text-align: center;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-toggle button {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.logged-in-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--red-dim);
  border: 1px solid var(--red-border);
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.logged-in-bar strong { color: #fff; }

/* Order result */
.order-result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.order-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.order-result-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.order-result-header .price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #22c55e;
}

.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

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

.detail-row .label { color: var(--muted); }

.detail-row .value { text-align: right; font-weight: 500; }

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-pill.pending,
.status-pill.pending_verification {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.status-pill.paid,
.status-pill.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-pill.expired {
  background: rgba(154, 68, 239, 0.15);
  color: #9a44ef;
}

.license-block {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 10px;
}

.license-block h4 {
  font-size: 0.85rem;
  color: #22c55e;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.license-item { margin-bottom: 0.75rem; }
.license-item:last-child { margin-bottom: 0; }

.license-item .product {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.license-row {
  display: flex;
  gap: 0.5rem;
}

.license-code {
  flex: 1;
  padding: 0.65rem 0.75rem;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  color: #fff;
  word-break: break-all;
}

.copy-btn {
  padding: 0.5rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font);
  transition: all 0.15s;
  white-space: nowrap;
}

.copy-btn:hover {
  border-color: var(--red-border);
  color: var(--red);
}

.copy-btn.copied { color: #22c55e; border-color: rgba(34, 197, 94, 0.4); }

.notice {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-top: 1rem;
  line-height: 1.5;
}

.notice.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.notice.info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.notice.error {
  background: rgba(154, 68, 239, 0.1);
  border: 1px solid rgba(154, 68, 239, 0.25);
  color: #d1a5fc;
}

.notice.success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.action-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Order list cards */
.orders-list { display: flex; flex-direction: column; gap: 0.75rem; }

.order-list-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  cursor: pointer;
  transition: all 0.15s;
}

.order-list-card:hover {
  border-color: var(--red-border);
  background: rgba(128, 0, 255, 0.04);
}

.order-list-card .top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.order-list-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.order-list-card .meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.order-list-card .amount {
  font-weight: 700;
  color: #22c55e;
  white-space: nowrap;
}

.order-list-card .actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.empty-state i {
  font-size: 2.5rem;
  color: var(--red);
  opacity: 0.5;
  margin-bottom: 0.75rem;
}

.empty-state a {
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
}

.empty-state a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .orders-header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
  }

  .orders-nav {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .orders-nav a {
    flex: 1 1 calc(50% - 0.35rem);
    justify-content: center;
    min-height: 44px;
    font-size: 0.8rem;
    padding: 0.55rem 0.5rem;
  }

  .orders-main {
    padding: 1.25rem 0.85rem calc(2.5rem + env(safe-area-inset-bottom));
  }

  .orders-hero h1 { font-size: 1.35rem; }

  .orders-card { padding: 1rem; border-radius: 14px; }

  .orders-tab { font-size: 0.75rem; padding: 0.6rem 0.4rem; }

  .orders-input { font-size: 16px; min-height: 48px; }

  .orders-btn { min-height: 48px; }

  .order-result-header { flex-direction: column; }

  .order-list-card .top { flex-direction: column; }

  .order-list-card .actions { flex-direction: column; }

  .order-list-card .actions .orders-btn { width: 100%; }

  .license-row { flex-direction: column; }

  .copy-btn { width: 100%; min-height: 44px; }
}

@media (max-width: 480px) {
  .orders-tabs { flex-direction: column; }

  .orders-tab { width: 100%; }
}
