:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #172033;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #748096;
  --border: #e5e9f1;
  --accent-a: #6c4cff;
  --accent-b: #12a6ff;
  --danger: #e11d48;
  --shadow: 0 10px 32px rgba(30, 41, 59, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, a { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--border); padding: 26px 18px 20px; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 26px; color: #141b2d; text-decoration: none; font-size: 20px; font-weight: 850; letter-spacing: -.035em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); box-shadow: 0 8px 20px rgba(88, 83, 255, .24); }
.side-nav { display: grid; gap: 6px; }
.side-nav__item { width: 100%; border: 0; display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 12px; border-radius: 11px; color: #677287; text-decoration: none; background: transparent; text-align: left; font-size: 14px; font-weight: 650; }
.side-nav__item:hover { background: #f6f7fb; color: #2c3549; }
.side-nav__item.is-active { color: #5a42e8; background: linear-gradient(90deg, rgba(108,76,255,.11), rgba(18,166,255,.05)); box-shadow: inset 3px 0 0 #6c4cff; }
.side-nav__button { appearance: none; }
.side-nav__icon { width: 20px; text-align: center; font-size: 16px; }
.side-nav__count { margin-left: auto; min-width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; padding: 0 7px; background: #f0f2f7; color: #657087; font-size: 11px; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding: 18px 8px 0; display: flex; gap: 10px; align-items: flex-start; color: #6e798d; font-size: 11px; }
.sidebar-footer strong { display: block; color: #303a4f; font-size: 12px; margin-bottom: 2px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.12); flex: 0 0 auto; margin-top: 4px; }

.main { min-width: 0; max-width: 1440px; width: 100%; margin: 0 auto; padding: 32px 34px 64px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.eyebrow, .section-kicker { margin: 0 0 7px; color: #8a94a8; font-weight: 800; letter-spacing: .11em; font-size: 10px; }
h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.topbar__subtitle { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.update-pill { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: #6b7589; font-size: 12px; box-shadow: 0 5px 18px rgba(30,41,59,.035); }
.update-pill .live-dot { margin: 0; }

.toolbar { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.search-box { flex: 1; min-width: 250px; height: 46px; display: flex; gap: 10px; align-items: center; padding: 0 15px; border-radius: 12px; border: 1px solid var(--border); background: #fff; color: #98a1b1; box-shadow: 0 4px 16px rgba(30,41,59,.03); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 14px; }
.search-box input::placeholder { color: #a2aabb; }
.filter-row { display: flex; gap: 7px; flex-wrap: wrap; }
.filter-chip { min-height: 38px; padding: 0 13px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: #6d778a; font-size: 12px; font-weight: 750; }
.filter-chip.is-active { color: #5d43ea; border-color: rgba(108,76,255,.32); background: rgba(108,76,255,.075); }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.summary-card { background: #fff; border: 1px solid var(--border); border-radius: 15px; padding: 17px; display: flex; gap: 13px; align-items: center; box-shadow: var(--shadow); }
.summary-card__icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; font-weight: 900; font-size: 13px; color: #6649ef; background: linear-gradient(135deg, rgba(108,76,255,.11), rgba(18,166,255,.08)); }
.summary-card__icon--live { color: #18a957; background: #eaf9ef; }
.summary-card span { display: block; color: #818ba0; font-size: 11px; margin-bottom: 5px; }
.summary-card strong { display: block; font-size: 21px; letter-spacing: -.025em; }

.dashboard-section, .state-panel { background: #fff; border: 1px solid var(--border); border-radius: 17px; padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 16px; }
.section-head h2, .favorites-drawer h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.result-count { color: #8790a2; font-size: 12px; }

.product-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.product-grid--top { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.product-card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid #e8ebf1; border-radius: 14px; background: #fff; overflow: hidden; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.product-card:hover { transform: translateY(-2px); border-color: #d9ddec; box-shadow: 0 14px 28px rgba(30,41,59,.08); }
.product-card:focus-visible { outline: 3px solid rgba(108,76,255,.24); outline-offset: 2px; border-color: rgba(108,76,255,.45); }
.product-card__visual { position: relative; height: 148px; display: grid; place-items: center; background: linear-gradient(145deg, #f8f9fc, #f1f4f9); border-bottom: 1px solid #eef0f5; overflow: hidden; }
.product-card__image { width: 100%; height: 100%; object-fit: contain; padding: 12px; background: #fff; }
.product-card__placeholder { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #6c4cff; background: #fff; border: 1px solid #e3e7ef; font-size: 20px; font-weight: 900; box-shadow: 0 6px 18px rgba(30,41,59,.06); }
.product-card__favorite { position: absolute; right: 9px; top: 9px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; border: 1px solid rgba(221,225,234,.92); background: rgba(255,255,255,.93); color: #788397; font-size: 16px; }
.product-card__favorite.is-active { color: #e11d48; background: #fff0f4; border-color: #ffd6e1; }
.product-card__discount { position: absolute; left: 9px; top: 9px; padding: 5px 8px; border-radius: 8px; background: #eef2f7; color: #4e5a70; font-size: 11px; font-weight: 900; }
.product-card__discount--medium { background: #fff1cc; color: #8b5b00; }
.product-card__discount--high { background: #ffe4d2; color: #a34316; }
.product-card__discount--hot { background: #ffe0e5; color: #c4143d; }
.product-card__body { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.product-card__meta { min-height: 20px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.product-card__shop { color: #818ba0; font-size: 10px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.product-card__category { max-width: 100%; padding: 3px 6px; border-radius: 999px; background: #f2f4f8; color: #7d8799; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card__title { margin: 0 0 12px; font-size: 13px; line-height: 1.42; min-height: 37px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card__title-link { color: inherit; text-decoration: none; }
.product-card__title-link:hover { color: #5d43ea; }
.product-card__prices { display: flex; align-items: baseline; gap: 7px; margin-top: auto; }
.product-card__price { font-size: 17px; letter-spacing: -.025em; }
.product-card__old-price { color: #9aa3b3; font-size: 11px; text-decoration: line-through; }
.product-card__saving { margin-top: 5px; color: #657087; font-size: 10px; }
.product-card__saving strong { color: #2d374b; }
.product-card__stock { margin-top: 7px; color: #169447; font-size: 10px; font-weight: 800; }
.product-card__stock.is-out { color: #b4233b; }
.product-card__link { margin-top: 11px; min-height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: #4f3bd3; background: #f3f0ff; font-size: 11px; font-weight: 800; transition: background .15s ease, transform .15s ease; }
.product-card__link:hover { background: #ebe6ff; transform: translateY(-1px); }

.shop-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.shop-status { border: 1px solid #e8ebf1; border-radius: 13px; padding: 14px; display: flex; align-items: center; gap: 11px; }
.shop-status__dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.11); }
.shop-status__body { min-width: 0; }
.shop-status__body strong { display: block; font-size: 13px; }
.shop-status__body span { display: block; color: #8791a3; font-size: 11px; margin-top: 3px; }
.shop-status__badge { margin-left: auto; color: #149447; background: #ebf9ef; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 850; }

.state-panel { min-height: 180px; display: none; place-items: center; text-align: center; color: #7a8599; }
.state-panel strong { display: block; color: #2a3448; margin: 8px 0 4px; }
.state-panel span { display: block; font-size: 13px; }
.spinner { width: 26px; height: 26px; border: 3px solid #e8eaf0; border-top-color: #6c4cff; border-radius: 50%; animation: spin .8s linear infinite; }
.state-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #b4233b; background: #fff0f3; font-weight: 900; }
.secondary-button { margin-top: 13px; min-height: 36px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: #566176; font-weight: 750; padding: 0 12px; }
.empty-inline { display: none; min-height: 140px; padding: 22px; place-items: center; text-align: center; color: #7c8699; }
.empty-inline__icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: #f2f4f8; color: #7b86a0; margin-bottom: 9px; }
.empty-inline strong { color: #2d374b; display: block; margin-bottom: 4px; }
.empty-inline span { font-size: 12px; }
.empty-compact { display: none; color: #8a93a4; font-size: 12px; padding: 10px 0; }

.favorites-drawer { position: fixed; inset: 0 0 0 auto; width: min(500px, 94vw); z-index: 50; background: #fff; border-left: 1px solid var(--border); box-shadow: -24px 0 50px rgba(30,41,59,.16); padding: 24px; overflow: auto; }
.favorites-drawer[hidden] { display: none; }
.favorites-drawer::before { content: ''; position: fixed; inset: 0 500px 0 0; background: rgba(15,23,42,.18); pointer-events: none; }
.favorites-drawer__header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.favorites-drawer .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.icon-button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: #6e788b; font-size: 20px; }

[data-salehunter-state="loading"] [data-salehunter-state-panel="loading"],
[data-salehunter-state="error"] [data-salehunter-state-panel="error"] { display: grid; }
[data-salehunter-state="ready"] [data-salehunter-content],
[data-salehunter-state="empty"] [data-salehunter-content] { display: block; }
[data-salehunter-state="loading"] [data-salehunter-content],
[data-salehunter-state="error"] [data-salehunter-content] { display: none; }
[data-salehunter-state="empty"] [data-salehunter-empty] { display: grid; }
[data-salehunter-state="empty"] [data-salehunter-items] { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .product-grid, .product-grid--top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 16px; }
  .brand { padding-bottom: 14px; }
  .side-nav { display: flex; overflow-x: auto; }
  .side-nav__item { width: auto; flex: 0 0 auto; }
  .sidebar-footer { display: none; }
  .main { padding: 24px 18px 50px; }
}
@media (max-width: 720px) {
  .topbar, .toolbar { flex-direction: column; align-items: stretch; }
  .topbar__right { align-self: flex-start; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .product-grid, .product-grid--top, .favorites-drawer .product-grid { grid-template-columns: 1fr 1fr; }
  .shop-status-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .summary-grid, .product-grid, .product-grid--top, .favorites-drawer .product-grid { grid-template-columns: 1fr; }
  .main { padding-inline: 13px; }
}

/* UL-03.17 – navigációs nézetek */
.dashboard-view[hidden] { display: none !important; }
.dashboard-view { animation: viewIn .16s ease-out; }
.dashboard-section--page { min-height: 420px; }
.product-grid--page { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.section-link { color: #6246ea; text-decoration: none; font-size: 12px; font-weight: 800; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }
.side-nav__item[aria-current="page"] { color: #6246ea; background: linear-gradient(90deg, rgba(108,76,255,.11), rgba(18,166,255,.05)); }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1180px) { .product-grid--page { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .product-grid--page { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .product-grid--page { grid-template-columns: 1fr; } }

/* UL-03.18 – Search & Filters */
.toolbar--filters { display: block; }
.toolbar__primary { display: flex; align-items: center; gap: 14px; }
.toolbar__primary .search-box { flex: 1 1 420px; }
.toolbar__secondary { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto; gap: 10px; align-items: end; margin-top: 12px; }
.select-control { min-width: 0; }
.select-control > span { display: block; margin: 0 0 5px 2px; color: #8490a4; font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.select-control select { width: 100%; min-height: 38px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: #455066; padding: 0 32px 0 11px; font: inherit; font-size: 11px; font-weight: 700; outline: none; }
.select-control select:focus-visible { border-color: #806cff; box-shadow: 0 0 0 3px rgba(108,76,255,.12); }
.clear-filters { min-height: 38px; border: 1px solid #ded9ff; border-radius: 10px; background: #f7f5ff; color: #5d47da; padding: 0 12px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.clear-filters[hidden] { display: none; }
.filter-result { min-height: 38px; display: inline-flex; align-items: center; justify-content: flex-end; color: #8a93a5; font-size: 10px; white-space: nowrap; }
.filter-result strong { color: #475267; margin-right: 4px; }
@media (max-width: 900px) { .toolbar__primary { align-items: stretch; flex-direction: column; } .toolbar__secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .toolbar__secondary { grid-template-columns: 1fr; } .filter-result { justify-content: flex-start; } }


/* UL-03.19 – Kedvencek véglegesítése */
.favorites-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.clear-favorites { min-height: 32px; padding: 0 10px; border: 1px solid #e6e9f0; border-radius: 9px; background: #fff; color: #737d91; font-size: 11px; font-weight: 800; cursor: pointer; }
.clear-favorites:hover { color: #b4233b; border-color: #f0cbd3; background: #fff7f8; }
.product-card--saved-offline { border-style: dashed; }
.product-card__saved-badge { position: absolute; left: 9px; top: 9px; padding: 5px 8px; border-radius: 8px; background: #eef2ff; color: #5d43ea; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.product-card__inactive-note { margin-top: auto; padding: 8px 9px; border-radius: 9px; background: #f7f8fb; color: #7d8799; font-size: 10px; line-height: 1.45; }
.sr-status { position: fixed; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 720px) { .favorites-actions { justify-content: flex-start; } }


/* UL-03.20 – Dashboard Polish */
:root {
  --focus-ring: 0 0 0 3px rgba(108, 76, 255, .18);
  --panel-shadow: 0 10px 28px rgba(31, 41, 55, .055);
}
html { scroll-behavior: smooth; }
body { min-width: 320px; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .7; }
.skip-link {
  position: fixed; left: 14px; top: 10px; z-index: 1000; transform: translateY(-140%);
  padding: 9px 12px; border-radius: 9px; background: #171c2b; color: #fff; text-decoration: none;
  font-size: 12px; font-weight: 800; box-shadow: 0 8px 24px rgba(15,23,42,.22);
}
.skip-link:focus { transform: translateY(0); }
:where(a, button, input, select, [tabindex]):focus-visible { outline: none; box-shadow: var(--focus-ring); }
.dashboard-section, .summary-card, .toolbar, .state-panel { box-shadow: var(--panel-shadow); }
.summary-card, .dashboard-section, .toolbar, .product-card, .shop-status { transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(30,41,59,.09); }
.toolbar { position: relative; z-index: 3; }
.state-panel { margin-top: 18px; border: 1px solid var(--border); border-radius: 16px; background: #fff; padding: 28px; }
[data-salehunter-state="loading"] .toolbar { opacity: .72; pointer-events: none; }
[data-salehunter-state="error"] .update-pill .live-dot { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.11); }
[data-salehunter-state="loading"] .update-pill .live-dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.11); }
.feed-freshness { font-size: 10px; letter-spacing: .08em; font-weight: 800; }
.feed-freshness[data-status="live"] { color: #16a34a; }
.feed-freshness[data-status="stale"] { color: #d97706; }
.empty-inline, .empty-compact { border-radius: 12px; }
.empty-inline { background: linear-gradient(180deg, #fbfcff, #f8f9fc); border: 1px dashed #e5e8ef; }
.product-card__favorite { transition: transform .12s ease, background .12s ease, color .12s ease; }
.product-card__favorite:active { transform: scale(.92); }
.clear-filters, .clear-favorites, .secondary-button { cursor: pointer; }
.filter-chip { cursor: pointer; }
.filter-chip:focus-visible, .clear-filters:focus-visible, .clear-favorites:focus-visible, .secondary-button:focus-visible { box-shadow: var(--focus-ring); }

@media (max-width: 900px) {
  .sidebar { overflow: hidden; }
  .side-nav { scrollbar-width: none; padding-bottom: 2px; }
  .side-nav::-webkit-scrollbar { display: none; }
  .topbar { gap: 14px; }
  .update-pill { max-width: 100%; }
}
@media (max-width: 720px) {
  .main { padding-top: 20px; }
  .topbar h1 { font-size: clamp(26px, 8vw, 34px); }
  .toolbar { padding: 12px; }
  .filter-row { overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-chip { flex: 0 0 auto; }
  .summary-card { min-height: 94px; }
  .dashboard-section { padding: 16px; }
  .section-head { align-items: flex-start; gap: 10px; }
  .section-link { white-space: normal; text-align: right; }
}
@media (max-width: 480px) {
  .sidebar { padding: 12px 10px; }
  .brand { padding-inline: 4px; }
  .side-nav__item { padding-inline: 11px; }
  .main { padding: 16px 10px 42px; }
  .summary-grid { gap: 9px; }
  .summary-card { padding: 14px; }
  .dashboard-section { border-radius: 14px; padding: 14px; }
  .product-card { border-radius: 13px; }
  .topbar__subtitle { font-size: 12px; }
  .update-pill { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
