*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --hot: #ff4500;
  --rising: #22c55e;
  --stable: #64748b;
  --falling: #ef4444;
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

h1 { font-size: 1.5rem; font-weight: 700; }
.subtitle { font-size: 0.75rem; color: var(--muted); direction: ltr; text-align: right; }
.last-updated { font-size: 0.7rem; color: var(--muted); }

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.filter-btn:hover { border-color: var(--hot); color: var(--text); }
.filter-btn.active { background: var(--hot); border-color: var(--hot); color: white; }

main { max-width: 1200px; margin: 2rem auto; padding: 0 1.5rem; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 900px) { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .products-grid { grid-template-columns: 1fr; } }

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

.product-card:hover { transform: translateY(-2px); border-color: #475569; }
.product-card.hot { border-color: var(--hot); }

.card-image {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #0f172a;
  padding: 1rem;
}

.card-image-placeholder {
  width: 100%;
  height: 180px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }

.card-badges { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.badge-hot {
  background: var(--hot);
  color: white;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
}

.badge-direction {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.badge-direction.rising { background: rgba(34,197,94,0.15); color: var(--rising); }
.badge-direction.stable { background: rgba(100,116,139,0.15); color: var(--stable); }
.badge-direction.falling { background: rgba(239,68,68,0.15); color: var(--falling); }

.score-bar-wrap { display: flex; align-items: center; gap: 0.6rem; }
.score-label { font-size: 1.1rem; font-weight: 700; min-width: 2.5rem; }
.score-bar { flex: 1; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 999px; background: var(--hot); transition: width 0.6s; }

.card-name { font-size: 0.95rem; font-weight: 600; line-height: 1.4; }
.card-reason { font-size: 0.75rem; color: var(--muted); line-height: 1.5; direction: ltr; text-align: left; }
.card-chart { height: 50px; margin-top: 0.25rem; }

.card-footer { padding: 0 1rem 1rem; }

.makhazin-link {
  display: block;
  text-align: center;
  background: rgba(255,69,0,0.1);
  border: 1px solid rgba(255,69,0,0.3);
  color: var(--hot);
  padding: 0.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.makhazin-link:hover { background: rgba(255,69,0,0.2); }

.loading-state { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 3rem; }

footer { text-align: center; padding: 2rem; color: var(--muted); font-size: 0.75rem; }
