:root { --deal: #d92d20; --deal-bg: #fdecea; }
@media (prefers-color-scheme: dark) { :root { --deal: #ff7a6e; --deal-bg: #3a1716; } }

.deals-layout { display: flex; align-items: flex-start; min-height: calc(100vh - 56px); }

/* --- drzewo kategorii --- */
.tree {
  position: sticky;
  top: 0;
  width: 290px;
  flex: none;
  max-height: 100vh;
  overflow-y: auto;
  padding: 18px 10px 30px 18px;
  border-right: 1px solid var(--line);
  background: var(--card);
}
.tree h2 { margin: 0 0 10px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.node { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 8px; cursor: pointer; user-select: none; }
.node:hover { background: var(--bg); }
.node.sel { background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: var(--accent); font-weight: 600; }
.node .tw { width: 16px; flex: none; color: var(--muted); font-size: 10px; text-align: center; transition: transform .15s; }
.node.open > .tw { transform: rotate(90deg); }
.node .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .cnt { font-size: 11px; font-variant-numeric: tabular-nums; padding: 1px 7px; border-radius: 999px; background: var(--deal-bg); color: var(--deal); font-weight: 600; }
.node.nooffers { color: var(--muted); }
.node.nooffers .cnt { background: transparent; color: var(--muted); font-weight: 400; }
.node.root { font-weight: 600; margin-bottom: 4px; }
.kids { margin-left: 14px; border-left: 1px solid var(--line); padding-left: 4px; }

/* --- nagłówek --- */
.deals-main { flex: 1; min-width: 0; }
.deals-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 22px 28px 6px; }
.crumbs { color: var(--muted); font-size: 12px; min-height: 16px; }
.crumbs a { color: inherit; text-decoration: none; cursor: pointer; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.deals-head h1 { margin: 2px 0 0; font-size: 24px; }
.deals-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { font: inherit; border: 0; background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.summary { margin: 0; padding: 0 28px; color: var(--muted); }

/* --- kafelek okazji --- */
.deal .photo { padding: 14px; }
.off {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 10px;
  background: var(--deal);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--deal) 35%, transparent);
}
.deal .price b { color: var(--deal); }
.save { font-size: 12.5px; font-weight: 600; color: var(--down); }
.spark { display: block; width: 100%; height: 34px; margin-top: 2px; }
.spark path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.spark circle { fill: var(--deal); }
.when { font-size: 11.5px; color: var(--muted); }

@media (max-width: 860px) {
  .deals-layout { flex-direction: column; }
  .tree { position: static; width: 100%; max-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
}
