:root {
  --bg: #f5f6f8;
  --surface: #fff;
  --surface-2: #f0f2f5;
  --text: #1b1f24;
  --muted: #5b6776;
  --border: #dde2e8;
  --accent: #0a62c2;
  --accent-text: #fff;
  --warn-bg: #fff6df;
  --warn-text: #6b4e00;
  --err: #b42318;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1f26;
    --surface-2: #232a33;
    --text: #e8ebef;
    --muted: #a0abb9;
    --border: #2d3540;
    --accent: #5aa4ff;
    --accent-text: #0b1117;
    --warn-bg: #3a2f10;
    --warn-text: #f3d98b;
    --err: #ff8a80;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* accesibilitate */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--accent-text); padding: 8px 14px; border-radius: 8px; z-index: 20; text-decoration: none; }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }

/* antet și căutare */
.top { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 0; }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.brand { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.brand a { color: inherit; text-decoration: none; }
.top form { display: flex; gap: 8px; flex: 1 1 340px; min-width: 0; }
#q {
  flex: 1; min-width: 0; padding: 12px 14px; font: inherit; color: var(--text);
  background: var(--bg); border: 2px solid var(--border); border-radius: 10px;
}
#q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* butoane */
.btn {
  display: inline-block; text-align: center; text-decoration: none; cursor: pointer; font: inherit; font-weight: 600;
  padding: 11px 16px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost, .btn.secondary { background: transparent; color: var(--accent); }
.btn.ghost:hover, .btn.secondary:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); filter: none; }

/* titluri */
h1 { font-size: 1.5rem; margin: 18px 0 6px; }
.top h1 { margin: 0; }
h2 { font-size: 1.2rem; margin: 0; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 22px 0 14px; }
.status { margin: 0; color: var(--muted); font-size: .9rem; min-height: 1.4em; }

/* filtre */
.filters-box { margin-top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters-box summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style-position: inside; }
.badge-count { display: inline-block; min-width: 1.4em; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: .75rem; text-align: center; margin-left: 6px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; align-items: end; padding: 4px 16px 16px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.field select, .field input {
  width: 100%; padding: 9px 10px; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
.price-inputs { display: flex; align-items: center; gap: 6px; }
.price-inputs input { min-width: 0; }
.cur { color: var(--muted); font-size: .85rem; }

/* carduri uniforme */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.card-media { position: relative; aspect-ratio: 1 / 1; background: #fff; border-bottom: 1px solid var(--border); }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 8px; background: #fff; display: block; }
.card-media .ph {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px;
  background: var(--surface-2); color: var(--muted); font-size: .8rem; text-align: center; padding: 8px;
}
.card-media .ph svg { width: 40px; height: 40px; opacity: .55; }
.badge { position: absolute; top: 8px; left: 8px; z-index: 1; background: var(--warn-bg); color: var(--warn-text); font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px; flex: 1; }
.card h3 {
  margin: 0; font-size: .95rem; line-height: 1.3; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.9em;
}
.shop { margin: 0; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price { margin: 6px 0 10px; font-size: 1.2rem; font-weight: 700; margin-top: auto; padding-top: 6px; }
.card .btn { width: 100%; }
.skeleton { min-height: 340px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* stări */
.notice { text-align: center; padding: 28px 12px; color: var(--muted); }
.notice p { margin: 0 0 12px; }
.notice.error { color: var(--err); }
.notice a { color: var(--accent); }
.more-wrap { text-align: center; margin: 28px 0; }
.rank-note { margin: 0 0 14px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: .875rem; }
.demo { margin: 16px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); font-size: .875rem; }

/* pagini statice SEO */
.crumbs { list-style: none; display: flex; gap: 8px; padding: 0; margin: 16px 0 0; font-size: .875rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 8px; }
.crumbs a, .related a { color: var(--accent); }
.related { margin: 28px 0 0; }
.related ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 8px 0 0; }
.related a { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 99px; text-decoration: none; background: var(--surface); }
.related h2 { font-size: 1.05rem; }

/* subsol */
.foot { color: var(--muted); font-size: .8rem; padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--border); margin-top: 24px; }
.foot p { margin: 4px 0; }

@media (max-width: 560px) {
  .wrap { padding: 0 12px; }
  .top .wrap { gap: 8px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px; }
  .card h3 { font-size: .88rem; }
  .price { font-size: 1.05rem; }
  .btn { padding: 10px 12px; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) { .filters { grid-template-columns: 1fr; } }
