:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --ink: #111418;
  --ink-2: #5b6470;
  --line: #e4e7eb;
  --line-hover: #c9ced4;
  --brand: #d7261e;
  --brand-hover: #b81f18;
  --good: #0e7a3e;
  --good-bg: rgba(14, 122, 62, 0.08);
  --good-line: rgba(14, 122, 62, 0.25);
  --link: #0b5cad;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}

.num, .price-now, .price-old, .discount-txt, .meta-line, td.num, th.num {
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-sm {
  width: 14px;
  height: 14px;
}

/* Sticky 56px Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-name span {
  font-weight: 400;
  color: var(--ink-2);
}

.brand-tagline {
  display: none;
  font-size: 12px;
  color: var(--ink-2);
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

@media (min-width: 1120px) {
  .brand-tagline { display: inline-block; }
}

.search-form {
  flex: 1 1 240px;
  max-width: 420px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 10px;
}

.search-form:focus-within {
  background: var(--surface);
  border-color: var(--ink);
}

.search-form .icon {
  color: var(--ink-2);
}

.search-form input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  flex-shrink: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--brand); }

/* Non-sticky 40px Category Bar */
.cat-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.cat-list {
  display: flex;
  align-items: stretch;
  gap: 20px;
  height: 40px;
  overflow-x: auto;
  scrollbar-width: none;
}

.cat-list::-webkit-scrollbar { display: none; }

.cat-link {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  padding-top: 2px;
}

.cat-link:hover { color: var(--ink); }

.cat-link.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--brand);
}

/* Main 2-column layout (864 + 24 + 312 = 1200) */
.page-main {
  padding-top: 20px;
  padding-bottom: 48px;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 24px;
  align-items: start;
}

/* Editorial Header inside left column (starts around y=116, card at y<=200) */
.edition-head {
  margin-bottom: 12px;
}

.edition-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
}

.edition-top h1 {
  margin: 0;
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
}

.sort-select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
}

.edition-meta {
  margin: 2px 0 4px;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-2);
}

.disclosure-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-2);
}

.disclosure-line a {
  color: var(--link);
  text-decoration: none;
}

.disclosure-line a:hover { text-decoration: underline; }

/* Buttons */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  background: var(--brand);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid var(--brand);
  cursor: pointer;
  white-space: nowrap;
}

.btn-cta:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-cta-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.btn-ghost:hover { border-color: var(--line-hover); }

/* Featured Card (#1 deal, ~240px height) */
.deal-featured {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.deal-featured:hover, .deal-row:hover {
  border-color: var(--line-hover);
}

.deal-thumb {
  width: 200px;
  height: 200px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}

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

.deal-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.deal-shop {
  font-weight: 600;
  color: var(--ink);
}

.test-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0 6px;
  height: 18px;
  line-height: 16px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--bg);
}

.deal-title {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-title a { text-decoration: none; }
.deal-title a:hover { color: var(--link); }

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  color: var(--good);
  background: var(--good-bg);
  border: 1px solid var(--good-line);
  margin-bottom: 10px;
}

.price-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.price-now {
  font-size: 28px;
  line-height: 32px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.discount-txt {
  font-size: 16px;
  font-weight: 600;
  color: var(--brand);
}

.price-old {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: line-through;
}

.omnibus-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-2);
}

.sparkline {
  display: inline-block;
  vertical-align: middle;
}

.editor-note {
  margin: 10px 0 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cta-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.micro-partner {
  font-size: 11px;
  line-height: 14px;
  color: var(--ink-2);
}

.deal-extra-meta {
  font-size: 13px;
  color: var(--ink-2);
}

.deal-extra-meta a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

.deal-extra-meta a:hover { text-decoration: underline; }

/* Compact Deal Rows (#2+) */
.deal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.deal-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.deal-row-thumb {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

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

.deal-row-title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-row-title a { text-decoration: none; }
.deal-row-title a:hover { color: var(--link); }

.deal-row-price {
  font-size: 22px;
  line-height: 26px;
  font-weight: 700;
}

.deal-row-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

/* Watched Offers Table ("Obserwujemy") */
.watched-section {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
}

.watched-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.watched-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.watched-head span {
  font-size: 13px;
  color: var(--ink-2);
}

.watched-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.watched-table th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-2);
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}

.watched-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.watched-table tr:last-child td { border-bottom: none; }
.watched-table th.num, .watched-table td.num { text-align: right; white-space: nowrap; }

.watched-footer {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.watched-footer a {
  color: var(--link);
  text-decoration: none;
}

/* Sidebar (312px) */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
}

.side-box h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.side-list {
  margin: 0 0 12px;
  padding-left: 16px;
  font-size: 13px;
  color: var(--ink-2);
  display: grid;
  gap: 6px;
}

.side-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}

.side-link:hover { text-decoration: underline; }

/* AdSense Blocks */
.ad-slot {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}

.ad-slot-sidebar {
  min-height: 274px;
  position: sticky;
  top: 72px;
}

.ad-slot-infeed {
  min-height: 112px;
  margin: 8px 0;
}

.ad-label {
  display: block;
  font-size: 11px;
  line-height: 14px;
  color: var(--ink-2);
  margin-bottom: 6px;
  text-align: left;
}

/* Deal detail page */
.breadcrumb {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-2);
}

.breadcrumb a { color: var(--link); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.detail-img {
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

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

.detail-title {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  color: var(--ink);
}

/* Info pages */
.info-card {
  max-width: 780px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
}

.info-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
}

.info-lead {
  margin: 0 0 20px;
  font-size: 15px;
  color: var(--ink-2);
}

.info-sec {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.info-sec h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.info-sec p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 20px 0;
  font-size: 13px;
  color: var(--ink-2);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink);
}

.footer-links a:hover { color: var(--brand); }

.footer-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-2);
}

/* Responsive */
@media (max-width: 980px) {
  .layout-grid { grid-template-columns: 1fr; }
  .ad-slot-sidebar { position: static; }
}

@media (max-width: 680px) {
  .nav-row { height: auto; padding: 8px 0; flex-wrap: wrap; gap: 8px; }
  .search-form { order: 3; max-width: 100%; flex-basis: 100%; }
  .deal-featured { grid-template-columns: 1fr; }
  .deal-thumb { width: 100%; height: 180px; }
  .deal-row { grid-template-columns: 76px minmax(0, 1fr); }
  .deal-row-thumb { width: 76px; height: 76px; }
  .deal-row-cta { grid-column: 1 / -1; align-items: flex-start; }
  .detail-card { grid-template-columns: 1fr; }
  .detail-img { width: 100%; height: 220px; }
}
