:root {
  --blue: #1e6fd9;
  --blue-dark: #14539f;
  --ink: #1a2233;
  --muted: #6b7280;
  --border: #e5e9f0;
  --bg: #f6f8fb;
  --white: #ffffff;
  --red: #e6402e;
  --gold: #e0a92a;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 30, 60, .06), 0 1px 2px rgba(20, 30, 60, .04);
  --shadow-md: 0 4px 16px rgba(20, 30, 60, .08);
}

* { box-sizing: border-box; }
html, body { color-scheme: light only; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.2rem; border-radius: 8px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-white { background: #fff; color: var(--blue-dark); }
.btn-white:hover { background: #f0f5ff; }

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.site-header-inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.brand { display: flex; align-items: center; margin-right: auto; }
.main-nav { display: flex; gap: 1.5rem; }
.main-nav a { font-weight: 600; color: var(--ink); font-size: .95rem; }
.main-nav a:hover { color: var(--blue); }
.btn-add { margin-left: .5rem; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }
.mobile-nav { display: none; flex-direction: column; padding: .5rem 20px 1rem; border-top: 1px solid var(--border); background: #fff; }
.mobile-nav a { padding: .6rem 0; font-weight: 600; border-bottom: 1px solid var(--border); }

@media (max-width: 780px) {
  .main-nav { display: none; }
  .btn-add { display: none; }
  .nav-toggle { display: block; }
  .mobile-nav.hidden { display: none; }
  .mobile-nav:not(.hidden) { display: flex; }
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #14539f 0%, #1e6fd9 55%, #2f8de0 100%);
  padding: 3.5rem 0 3rem;
  background-size: cover; background-position: center;
}
.hero--bg { position: relative; }
.hero--bg::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(10,30,60,.72) 0%, rgba(10,30,60,.45) 100%);
}
.hero-inner { position: relative; z-index: 1; }
.hero-title { color: #fff; font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0 0 .5rem; }
.hero-sub { color: #dbe7fb; max-width: 640px; margin: 0 0 1.75rem; font-size: 1.05rem; }

.hero-search, .filter-bar .fb-row {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: .9rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end;
}
.hs-field { display: flex; flex-direction: column; gap: .3rem; flex: 1 1 160px; min-width: 140px; }
.hs-field label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.hs-field select, .hs-field input, .fb-row-more input, .fb-row-more select {
  border: 1px solid var(--border); border-radius: 7px; padding: .6rem .7rem; font-size: .95rem;
  background: #fff; color: var(--ink); font-family: inherit;
}
.hs-field-loc { flex: 2 1 240px; }
.hs-loc-wrap { position: relative; }
.hs-loc-wrap input { width: 100%; }
.loc-clear-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: none; background: none; font-size: 1.2rem; color: var(--muted); cursor: pointer;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
}
.hs-submit { flex: 0 0 auto; height: 42px; }

/* Autocomplete */
.ac-anchor { position: relative; }
.ac-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md);
  max-height: 320px; overflow-y: auto; z-index: 50;
}
.ac-item { padding: .6rem .8rem; cursor: pointer; font-size: .93rem; }
.ac-item.active, .ac-item:hover { background: #eef4ff; }
.ac-sub { color: var(--muted); font-size: .82rem; }

/* ── Filter bar (results page) ───────────────────────────────────────── */
.section-gap-sm { padding-top: 1.5rem; }
.filter-bar { display: flex; flex-direction: column; gap: .6rem; }
.fb-row-more {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .75rem; display: flex; flex-wrap: wrap; gap: .6rem;
}
.fb-row-more input, .fb-row-more select { flex: 1 1 130px; min-width: 110px; }

/* ── Sections / lists ─────────────────────────────────────────────────── */
.section-gap { padding: 2.5rem 0; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.section-title { font-size: 1.35rem; margin: 0; }
.section-more { color: var(--blue); font-weight: 600; font-size: .92rem; }
.section-more:hover { text-decoration: underline; }

.results-count { color: var(--muted); font-weight: 600; margin-bottom: 1rem; }
.results-empty { background: #fff; border-radius: var(--radius); padding: 3rem 1.5rem; text-align: center; box-shadow: var(--shadow); }
.results-empty p { color: var(--muted); margin-bottom: 1.2rem; }

.offer-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem;
}

.offer-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s;
}
.offer-card:hover { box-shadow: var(--shadow-md); border-color: #cfe0fb; transform: translateY(-2px); }
.offer-card.is-featured { border-color: #f4d38a; }
.offer-card.is-premium { border-color: #e6a8a0; }

.offer-card-img {
  position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #eef1f5;
}
.offer-card-img img { width: 100%; height: 100%; object-fit: cover; }
.offer-card-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; }
.badge {
  position: absolute; top: 8px; left: 8px; font-size: .72rem; font-weight: 700;
  padding: .25rem .55rem; border-radius: 5px; color: #fff;
}
.badge-featured { background: var(--gold); }
.badge-premium { background: var(--red); }
.offer-card-source { position: absolute; top: 8px; right: 8px; }

.offer-card-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: .35rem; min-width: 0; padding: .9rem; }
.offer-card-price { white-space: nowrap; }
.offer-card-price strong { font-size: 1.15rem; color: var(--blue-dark); }
.offer-card-price-m2 { margin-left: .4rem; font-size: .8rem; color: var(--muted); }

.offer-card-title {
  margin: 0; font-size: 1rem; line-height: 1.35; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.offer-card-loc { color: var(--muted); font-size: .88rem; }
.offer-card-province { color: #9aa4b2; }

.offer-card-params { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .82rem; color: var(--ink); }
.offer-card-params span { display: inline-flex; align-items: center; }
.offer-card-tag {
  background: #eef4ff; color: var(--blue-dark); padding: .12rem .5rem; border-radius: 5px; font-weight: 600; font-size: .76rem;
}

.offer-source-tag { font-size: .74rem; font-weight: 700; padding: .2rem .55rem; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.offer-source-tag--private { background: #e8f7ee; color: #1a7a41; }
.offer-source-tag--agency { background: #fff; color: #445; }
.offer-card-agency-link { margin-top: auto; padding-top: .35rem; color: var(--blue); font-size: .85rem; font-weight: 600; }
.offer-card-agency-link:hover { text-decoration: underline; }

@media (max-width: 620px) {
  .offer-list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
}

/* ── Skeleton (stan ładowania) ───────────────────────────────────────── */
.offer-skeleton { cursor: default; }
.skeleton-block, .skeleton-line {
  background: linear-gradient(90deg, #eef1f5 25%, #e4e8ee 37%, #eef1f5 63%);
  background-size: 400% 100%; animation: skeleton-shimmer 1.4s ease infinite; border-radius: 4px;
}
.skeleton-line { height: .8rem; margin: .15rem 0; }
.skeleton-line--price { width: 40%; height: 1rem; }
.skeleton-line--title { width: 85%; height: 1rem; margin-top: .3rem; }
.skeleton-line--sm { width: 55%; }
@keyframes skeleton-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── Pagination ───────────────────────────────────────────────────────── */
.pagination { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin: 2rem 0; }
.pg-btn {
  padding: .5rem .85rem; border-radius: 7px; background: #fff; border: 1px solid var(--border);
  font-weight: 600; font-size: .9rem;
}
.pg-btn:hover { border-color: var(--blue); color: var(--blue); }
.pg-active { background: var(--blue); color: #fff; border-color: var(--blue); }
.pg-disabled { opacity: .4; }
.pg-dots { padding: .5rem .3rem; color: var(--muted); }

/* ── CTA ──────────────────────────────────────────────────────────────── */
.cta-block {
  background: linear-gradient(135deg, #14539f, #1e6fd9);
  border-radius: var(--radius); padding: 2rem; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.cta-block h2 { margin: 0 0 .3rem; font-size: 1.3rem; }
.cta-block p { margin: 0; color: #dbe7fb; }
.mb-6 { margin-bottom: 2.5rem; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer { background: #101a2e; color: #c3ccdd; margin-top: 3rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; padding: 2.5rem 20px; }
.footer-brand { max-width: 340px; }
.footer-brand img { filter: brightness(0) invert(1); margin-bottom: .75rem; }
.footer-brand p { font-size: .88rem; color: #8b96ad; }
.footer-links { display: flex; flex-direction: column; gap: .55rem; }
.footer-links a { font-size: .92rem; }
.footer-links a:hover { color: #fff; }
.footer-copy { padding: 1rem 20px; border-top: 1px solid #1e2a44; font-size: .82rem; color: #6d7791; }
