:root {
  --green: #1a6b50;
  --green-dark: #145640;
  --green-mid: #458e76;
  --green-soft: #e7f0ed;
  --green-line: #cfe2db;
  --ink: #413f4d;
  --ink-2: #676571;
  --muted: #8d8c94;
  --line: #ececed;
  --line-2: #d9d9db;
  --bg: #f6f5f6;
  --card: #fff;
  --red: #dc3545;
  --red-soft: #ffe4e4;
  --ok: #198754;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(65, 63, 77, .06), 0 4px 16px rgba(65, 63, 77, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, .brand, .price { font-family: Manrope, Inter, sans-serif; }
h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; margin: 0 0 10px; font-weight: 800; }
h2 { font-size: 22px; margin: 0 0 14px; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 700; }
a { color: var(--green); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.app { flex: 1; padding-bottom: 48px; }

/* Fejléc */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.brand b { color: var(--green); font-weight: 800; }
.brand-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--green); color: #fff; display: grid; place-items: center; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a, .nav button.linklike { text-decoration: none; color: var(--ink-2); font-weight: 500; padding: 8px 12px; border-radius: 10px; }
.nav a:hover { background: var(--bg); }
.nav a.active { color: var(--green); background: var(--green-soft); }
.nav .user-chip { font-size: 13px; color: var(--muted); padding: 0 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hero / kereső */
.hero { background: linear-gradient(180deg, var(--green-soft), var(--bg)); padding: 40px 0 28px; }
.hero p.lead { color: var(--ink-2); font-size: 17px; margin: 0 0 22px; max-width: 640px; }
.searchbar { display: flex; background: #fff; border: 2px solid var(--green-line); border-radius: 16px; padding: 6px; box-shadow: var(--shadow); max-width: 760px; }
.searchbar:focus-within { border-color: var(--green); }
.searchbar input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 17px; padding: 10px 14px; background: transparent; color: var(--ink); min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; align-items: center; }
select, input[type=number], input[type=email], input[type=text] {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; outline: 0;
}
select:focus, input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: thin; }
.chip { flex: 0 0 auto; border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--green-mid); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }

/* Gombok */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: #fff; color: var(--green); border: 1px solid var(--green-line); }
.btn-outline:hover { background: var(--green-soft); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f3c2c7; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.is-on { background: var(--green-soft); color: var(--green); }

/* Terméklista */
.results-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 12px; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.pcard { padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: transform .12s, box-shadow .12s; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(65, 63, 77, .12); }
.pcard .cat { font-size: 12px; color: var(--green); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.pcard .name { font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.35; min-height: 2.7em; }
.pcard .name:hover { color: var(--green); }
.pcard .pricebox { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-top: auto; }
.price { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.price small { font-size: 13px; font-weight: 600; color: var(--muted); }
.unitprice { font-size: 13px; color: var(--muted); }
.chains { display: flex; flex-wrap: wrap; gap: 6px; }
.cpill { font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; color: var(--ink-2); white-space: nowrap; }
.cpill.best { background: var(--green-soft); border-color: var(--green-line); color: var(--green); font-weight: 600; }
.more { display: flex; justify-content: center; margin: 24px 0; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

.bell { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--green-line); background: #fff; color: var(--green); display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.bell:hover { background: var(--green-soft); }
.bell.on { background: var(--green); color: #fff; border-color: var(--green); }

/* Termékoldal */
.crumbs { margin: 22px 0 10px; font-size: 14px; }
.crumbs a { text-decoration: none; }
.detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }
.panel { padding: 20px; }
.panel + .panel { margin-top: 20px; }
table.prices { width: 100%; border-collapse: collapse; font-size: 14px; }
table.prices th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 8px; border-bottom: 1px solid var(--line); }
table.prices td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.prices tr:last-child td { border-bottom: 0; }
table.prices .num { text-align: right; white-space: nowrap; }
.avail { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; width: 80px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.avail i { display: block; height: 100%; background: var(--green-mid); }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-weight: 600; }
.badge.gray { background: var(--line); color: var(--ink-2); }
.badge.red { background: var(--red-soft); color: var(--red); }

.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label.title { font-weight: 600; font-size: 14px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.radio input { margin-top: 4px; accent-color: var(--green); }
.radio + .radio { margin-top: 8px; }
.inline-input { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.inline-input input { width: 130px; }

/* Feliratkozások */
.sub-list { display: flex; flex-direction: column; gap: 12px; }
.sub { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 18px; }
@media (max-width: 700px) { .sub { grid-template-columns: 1fr; } }
.sub .name { font-weight: 600; color: var(--ink); text-decoration: none; }
.sub .name:hover { color: var(--green); }
.sub .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Belépés */
.narrow { max-width: 460px; margin: 48px auto; }
.narrow .panel { padding: 28px; }
.notice { background: var(--green-soft); border: 1px solid var(--green-line); border-radius: 12px; padding: 14px 16px; }
.notice.warn { background: #fff8e1; border-color: #ffe08a; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 50; max-width: calc(100% - 32px); }
.toast.error { background: var(--red); }

.spinner { width: 28px; height: 28px; border: 3px solid var(--green-line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.footer { background: #fff; border-top: 1px solid var(--line); padding: 22px 0; font-size: 13px; color: var(--ink-2); }
.footer p { margin: 4px 0; }

@media (max-width: 560px) {
  .brand > span:last-child { display: none; }
  .nav a { padding: 8px; }
  .nav .user-chip { display: none; }
  .hero { padding-top: 24px; }
}
