/* --- common styles  home + cards --- */
:root {
  --bg:#0f172a;
  --card:#111827;
  --muted:#94a3b8;
  --txt:#e5e7eb;
  --accent:#22d3ee;
}

body {
  margin:0;
  font-family:Inter,system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg);
  color:var(--txt);
}

header {
  padding:20px 24px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
}

header .title {
  font-size:20px;
  font-weight:700;
}

.search {
  max-width:520px;
  flex:1;
}

.search input {
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid #1f2937;
  background:#0b1220;
  color:var(--txt);
}

.grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:16px;
  padding:16px;
}

.card {
  background:var(--card);
  border:1px solid #1f2937;
  border-radius:16px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.thumb {
  height:180px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
}

.thumb img {
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}

.content {
  padding:14px 14px 8px 14px;
}

.name a {
  color: var(--txt);
  text-decoration: none;
}

.name a:visited {
  color: var(--txt)]
}

.name a:hover {
  color: var(--accent);
}

.desc {
  color:var(--muted);
  font-size:14px;
  margin:0 0 10px 0;
  min-height:40px;
}

.tags {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.tag {
  font-size:12px;
  color:#0e7490;
  background:#082f49;
  border:1px solid #164e63;
  padding:4px 8px;
  border-radius:999px;
}

.footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px 14px 14px;
}

.price {
  font-weight:800;
}

.rating {
  color:#fde047;
}

.muted {
  color:var(--muted);
  font-size:12px;
}

.topbar-links a {
  color:var(--accent);
  text-decoration:none;
  margin-left:12px;
}

/* --- styles for item-details --- */
.layout {
  display:grid;
  grid-template-columns:1fr 320px;
  gap:16px;
  padding:16px;
}
.panel {
  background:#111827;
  border:1px solid #1f2937;
  border-radius:16px;
  padding:16px;
}
.stack { display:flex; gap:12px; align-items:flex-start; }
.thumb { width:200px; height:160px; background:#0b1220; display:flex; align-items:center; justify-content:center; border-radius:12px; }
.thumb img { max-width:100%; max-height:100%; object-fit:contain; }
.h1 { font-size:22px; font-weight:800; margin:0; }
.sidebar h3 { margin:0 0 8px 0; }
.sidebar .list { max-height:60vh; overflow:auto; display:flex; flex-direction:column; gap:8px; }
.compare-table { width:100%; border-collapse:separate; border-spacing:0 8px; }
.compare-table th, .compare-table td { padding:8px 12px; background:#0b1220; border-top:1px solid #1f2937; border-bottom:1px solid #1f2937; }
.row-title { font-weight:700; white-space:nowrap; }
.pill { display:inline-block; padding:2px 8px; border-radius:999px; background:#0b3b3b; border:1px solid #155e75; color:#67e8f9; font-size:12px; }
.topbar { display:flex; align-items:center; justify-content:space-between; padding:16px; }
.topbar a { color:#22d3ee; text-decoration:none; }
.actions { display:flex; gap:8px; align-items:center; }
.btn { padding:8px 12px; border-radius:10px; border:1px solid #1f2937; background:#0b1220; color:#e5e7eb; text-decoration:none; }


/* ===== Modal IA ===== */
#iaModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#iaModal .modal-content {
  background: var(--card);
  border: 1px solid #1f2937;
  border-radius: 16px;
  width: min(900px, 90vw);
  max-height: 80vh;
  height: 80vh;
  display: flex;
  flex-direction: column;
}

#iaModal .modal-header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
}

#iaModal .modal-header strong {
  font-size: 16px;
  font-weight: 700;
}

#iaModal .modal-body {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#iaText {
  flex: 1;
  width: 100%;
  padding: 12px;
  background: #0b1220;
  color: var(--txt);
  border: 0;
  border-radius: 8px;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  overflow-y: auto;
}
