/* =========================================================
   Oglasi (KupujemProdajem raspored) + glavni meni na sredini
   ========================================================= */

/* ---------- Glavni meni: centriran, velika slova ---------- */
@media (min-width: 1141px) {
  .header > .container { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .header > .container > .logo { justify-self: start; }
  .header > .container > .header-actions { justify-self: end; }
  .nav { flex: none; }
  .nav { justify-content: center; }
  .nav > .nav-item > a { font-size: 13.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: 0 15px; }
  .nav > .nav-item > a::after { left: 15px; right: 15px; }
  .nav-count { letter-spacing: 0; }
}
@media (min-width: 1141px) and (max-width: 1280px) {
  .nav > .nav-item > a { font-size: 12.5px; letter-spacing: .05em; padding: 0 10px; }
  .nav > .nav-item > a::after { left: 10px; right: 10px; }
}

/* ---------- Zaglavlje oglasa sa pretragom ---------- */
.ads-hero { background: var(--bordo); color: #fff; padding: 30px 0 34px; position: relative; }
.ads-hero .crumbs, .ads-hero .crumbs a { color: #c3cde0; }
.ads-hero h2 { color: #fff; margin: 0; }
.ads-hero p { color: #c3cde0; margin: 6px 0 0; font-size: 16.5px; }
.ads-search { display: grid; grid-template-columns: minmax(0, 1fr) 230px auto; gap: 8px; margin-top: 22px; background: #fff; padding: 8px; border-radius: 16px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.45); }
.as-q, .as-city { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 54px; color: var(--muted); }
.as-city { border-left: 1px solid var(--line); }
.as-q input, .as-city select { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.as-city select { cursor: pointer; }
.ads-search .btn { height: 54px; border-radius: 12px; }

/* ---------- Raspored: sidebar + lista ---------- */
.ads-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; padding: 26px 0 64px; align-items: start; }
.ads-side { position: sticky; top: 96px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); max-height: calc(100vh - 116px); display: flex; flex-direction: column; overflow: hidden; }
.ads-side-body { overflow-y: auto; }
.ads-box { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ads-box:last-child { border-bottom: 0; }
.ads-box h5 { margin: 0 0 10px; font-size: 15px; font-weight: 800; color: var(--ink); }
.ad-cats { display: grid; gap: 2px; margin: 0 -8px; }
.ad-cats > a { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.ad-cats > a svg.lucide { width: 18px; height: 18px; color: var(--bordo); flex-shrink: 0; }
.ad-cats > a span { flex: 1; min-width: 0; }
.ad-cats b { font-size: 13px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.ad-cats > a:hover { background: #f5f7fb; }
.ad-cats > a.open { color: var(--bordo); font-weight: 800; }
.ad-cats > a.active { background: var(--bordo); color: #fff; }
.ad-cats > a.active svg.lucide, .ad-cats > a.active b { color: #fff; }
.ad-subcats { display: grid; gap: 1px; margin: 2px 0 6px 28px; padding-left: 10px; border-left: 2px solid var(--line); }
.ad-subcats a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; color: var(--ink-2); }
.ad-subcats a:hover { background: #f5f7fb; }
.ad-subcats a.active { background: var(--brand-50); color: var(--bordo); font-weight: 800; }
.ad-price { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; color: var(--muted); }
.ad-price .input { height: 46px; }
.ad-cond { grid-template-columns: repeat(3, 1fr); }
.ads-promo { display: flex; gap: 12px; align-items: center; background: var(--ok-50); }
.ads-promo svg.lucide { color: var(--ok); width: 24px; height: 24px; flex-shrink: 0; }
.ads-promo b { display: block; color: #14532d; }
.ads-promo span { font-size: 14px; color: #166534; }
.ads-side .gf-head, .ads-side .gf-foot { display: none; }

/* traka iznad liste */
.ads-main { min-width: 0; }
.ads-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; scroll-margin-top: 100px; }
.ads-count { font-size: 15.5px; color: var(--muted); margin-right: auto; }
.ads-count b { color: var(--ink); font-size: 17px; }
.ads-tools { display: flex; gap: 8px; align-items: center; }
.ads-tools .geo-sort { height: 44px; }
.ads-view { display: inline-flex; }
.ads-view button { width: 40px; padding: 0; justify-content: center; height: 36px; }
.ads-fbtn { display: none; }
#adActive { margin-bottom: 12px; }
#adActive:empty { display: none; }

/* ---------- Red oglasa: slika levo, tekst desno ---------- */
.ad-list { display: grid; gap: 12px; }
.ad-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.ad-row:hover { border-color: var(--bordo); box-shadow: var(--shadow-lg); }
.ad-row.is-feat { border-color: #f5c56b; box-shadow: 0 0 0 1px #f5c56b, var(--shadow); background: linear-gradient(90deg, #fff, #fffbf2); }
.ad-img { position: relative; display: block; background: #e6eaf2 center/cover; min-height: 180px; }
.ad-noimg { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-50), #e1e7f2); color: var(--bordo); }
.ad-noimg svg.lucide { width: 44px; height: 44px; stroke-width: 1.5; opacity: .7; }
.ad-ph { position: absolute; left: 10px; bottom: 10px; display: inline-flex; gap: 5px; align-items: center; height: 26px; padding: 0 9px; border-radius: 30px; background: rgba(8,14,30,.72); color: #fff; font-size: 13px; font-weight: 700; }
.ad-ph svg.lucide { width: 14px; height: 14px; }
.ad-feat { position: absolute; left: 10px; top: 10px; display: inline-flex; gap: 5px; align-items: center; height: 26px; padding: 0 10px; border-radius: 30px; background: #f5a623; color: #2a1800; font-size: 12.5px; font-weight: 800; }
.ad-feat svg.lucide { width: 14px; height: 14px; }
.ad-body { padding: 16px 18px 14px; display: flex; flex-direction: column; min-width: 0; }
.ad-top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.ad-top h3 { margin: 0; font-size: 18px; line-height: 1.35; font-family: var(--font); font-weight: 800; letter-spacing: -.01em; }
.ad-top h3 a { color: var(--ink); }
.ad-top h3 a:hover { color: var(--red); }
.ad-save { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--muted); cursor: pointer; transition: .2s; }
.ad-save svg.lucide { width: 18px; height: 18px; }
.ad-save:hover { color: var(--red); border-color: #f6c9cd; }
.ad-save.on { color: var(--red); background: var(--danger-50); border-color: #f6c9cd; }
.ad-save.on svg.lucide { fill: var(--red); }
.ad-desc { margin: 6px 0 10px; font-size: 15px; color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ad-cat { font-size: 13px; font-weight: 700; color: var(--bordo); background: var(--brand-50); padding: 3px 10px; border-radius: 20px; }
.ad-cond { font-size: 13px; font-weight: 700; color: var(--ink-2); background: #eef1f6; padding: 3px 10px; border-radius: 20px; }
.ad-cond.new { color: var(--ok); background: var(--ok-50); }
.ad-new { font-size: 13px; font-weight: 700; color: #fff; background: var(--red); padding: 3px 10px; border-radius: 20px; }
.ad-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ad-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); min-width: 0; }
.ad-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ad-meta svg.lucide { width: 15px; height: 15px; }
.ad-seller svg.lucide { color: var(--ok); }
.ad-price { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--bordo); white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ad-price small { font-size: 15px; }
.ad-price-na { font-family: var(--font); font-size: 15px; font-weight: 700; color: var(--ink-2); }

/* mreža (alternativni prikaz) */
.ad-list.is-grid { grid-template-columns: repeat(3, 1fr); }
.ad-list.is-grid .ad-row { grid-template-columns: 1fr; }
.ad-list.is-grid .ad-img { aspect-ratio: 4 / 3; min-height: 0; }
.ad-list.is-grid .ad-top h3 { font-size: 16px; }
.ad-list.is-grid .ad-desc { -webkit-line-clamp: 2; font-size: 14px; }
.ad-list.is-grid .ad-foot { flex-direction: column; align-items: flex-start; }
.ad-list.is-grid .ad-meta span:nth-child(3) { display: none; }

/* paginacija */
.ad-pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.ad-pager button { height: 46px; min-width: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font: inherit; font-weight: 700; font-size: 15px; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ad-pager button:hover:not(:disabled) { border-color: var(--bordo); color: var(--bordo); }
.ad-pager button.active { background: var(--bordo); border-color: var(--bordo); color: #fff; }
.ad-pager button:disabled { opacity: .4; cursor: default; }
.ad-pager button svg.lucide { width: 18px; height: 18px; }
.ap-nums { display: flex; gap: 6px; align-items: center; }
.ap-gap { color: var(--muted); padding: 0 4px; }
.ap-info { flex-basis: 100%; text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- Tablet ---------- */
@media (max-width: 1140px) {
  .ads-layout { grid-template-columns: minmax(0, 1fr); padding-top: 18px; }
  .ads-fbtn { display: inline-flex; }
  .ads-side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 2700; max-height: 86vh; max-height: 86dvh; border-radius: 18px 18px 0 0; border: 0; transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -20px 60px rgba(13,21,38,.25); }
  .adf-open .ads-side { transform: none; }
  .adf-open #adFBg { opacity: 1; visibility: visible; }
  .ads-side .gf-head { display: flex; }
  .ads-side .gf-foot { display: flex; }
  .ad-list.is-grid { grid-template-columns: repeat(2, 1fr); }
}
/* ---------- Telefon: kompaktan red — slika levo, tekst desno ---------- */
@media (max-width: 860px) {
  .ads-hero { padding: 24px 0 26px; }
  .ads-hero .fh-row .btn { width: 100%; }
  .ads-search { grid-template-columns: 1fr; padding: 6px; gap: 0; }
  .as-q, .as-city { height: 52px; }
  .as-city { border-left: 0; border-top: 1px solid var(--line); }
  .ads-search .btn { margin-top: 6px; }
  .ads-bar { flex-wrap: wrap; gap: 8px; }
  .ads-fbtn { flex: 1 1 100%; justify-content: center; height: 46px; }
  .ads-count { margin-right: auto; }
  .ads-tools .geo-sort { height: 42px; max-width: 170px; }
  .ad-row { grid-template-columns: 124px minmax(0, 1fr); border-radius: 12px; }
  .ad-img { min-height: 0; }
  .ad-ph { left: 6px; bottom: 6px; height: 22px; font-size: 11.5px; padding: 0 7px; }
  .ad-feat { left: 6px; top: 6px; height: 22px; font-size: 11px; padding: 0 7px; }
  .ad-feat svg.lucide { display: none; }
  .ad-body { padding: 10px 12px 10px; }
  .ad-top h3 { font-size: 15.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .ad-save { width: 34px; height: 34px; margin: -2px -4px 0 0; }
  .ad-desc { display: none; }
  .ad-tags { margin: 6px 0 8px; gap: 4px; }
  .ad-tags span { font-size: 12px; padding: 2px 8px; }
  .ad-foot { flex-direction: column-reverse; align-items: flex-start; gap: 4px; padding-top: 8px; }
  .ad-price { font-size: 19px; }
  .ad-meta { font-size: 13px; gap: 2px 10px; }
  .ad-meta .ad-seller { display: none; }
  .ad-list.is-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ad-list.is-grid .ad-row { grid-template-columns: 1fr; }
  .ad-list.is-grid .ad-tags { display: none; }
  .ap-nums button:not(.active) { display: none; }
  .ap-nums .ap-gap { display: none; }
  .ad-pager button span { display: none; }
  .ad-pager button { min-width: 52px; }
}
@media (max-width: 380px) {
  .ad-row { grid-template-columns: 108px minmax(0, 1fr); }
  .ad-top h3 { font-size: 15px; }
}
