/*
 * delovi.css — stilovi za katalog polovnih delova
 * WordPress: enqueuati kao wp_enqueue_style('delovi', get_template_directory_uri().'/delovi/delovi.css')
 */

/* ── PAGE HEADER ────────────────────────────────────────────────────────────── */
.page-header {
  background: var(--boja-pozadina); color: var(--boja-bela);
  padding: 28px 20px 24px;
  border-bottom: 1px solid #2a2d31;
}
.page-header-inner { max-width: var(--max-sirina-nav); margin: 0 auto; }

.breadcrumb {
  font-size: 13px; color: #6a6e74; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.breadcrumb a { color: #6a6e74; text-decoration: none; }
.breadcrumb a:hover { color: #C9CDD2; }
.breadcrumb svg { width: 12px; height: 12px; fill: #6a6e74; flex-shrink: 0; }

/* WP: h1 → the_archive_title() ili custom field naslova kataloga */
.page-header h1 {
  font-family: var(--font-naslov);
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: .02em; margin-bottom: 4px;
}
/* WP: span.ukupno-broj → found_posts iz WP_Query */
.page-header .ukupno { color: #8E9297; font-size: 14px; }
.page-header .ukupno b { color: #C9CDD2; }
.page-header .napomena-cene { color: #8E9297; font-size: 13px; font-style: italic; margin-bottom: 6px; }

/* ── FILTER BAR ─────────────────────────────────────────────────────────────── */
/* WP: filter forma šalje GET parametre → WP_Query ih prima kao meta_query / tax_query */
.filter-bar {
  background: var(--boja-celik);
  border-bottom: 1px solid #2a2d31;
  padding: 14px 20px;
  position: sticky; top: 63px; z-index: 40;
}
.filter-bar-inner {
  max-width: var(--max-sirina-nav); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.filter-search {
  display: flex; align-items: center; gap: 8px;
  background: #1e2124; border: 1px solid #3a3e44;
  border-radius: var(--radius); padding: 8px 14px;
  flex: 2; min-width: 200px;
}
.filter-search svg { width: 16px; height: 16px; fill: #a0a6ae; flex-shrink: 0; }
.filter-search input {
  background: none; border: none; outline: none;
  color: #fff; font-family: var(--font-body); font-size: 15px; width: 100%;
}
.filter-search input::placeholder { color: #a0a6ae; }

.filter-select {
  background: #1e2124; border: 1px solid #3a3e44;
  border-radius: var(--radius); padding: 9px 32px 9px 14px;
  color: #C9CDD2; font-family: var(--font-body); font-size: 14px;
  cursor: pointer; outline: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a6e74' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.filter-select:focus { border-color: var(--boja-primarna); }

/* ── LAYOUT ─────────────────────────────────────────────────────────────────── */
.katalog-wrap {
  max-width: var(--max-sirina-nav); margin: 0 auto; padding: 28px 20px;
}

/* ── GRID KARTICA ───────────────────────────────────────────────────────────── */
/* WP: .delovi-grid → wp_query loop, svaka .deo-kartica = jedan CPT 'delovi' post */
.delovi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* ── DEO KARTICA ────────────────────────────────────────────────────────────── */
.deo-kartica {
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: box-shadow .15s;
}
.deo-kartica:hover {
  box-shadow: 0 3px 14px rgba(0,0,0,.07);
}

/* WP: .deo-slika → the_post_thumbnail('medium') */
.deo-slika {
  aspect-ratio: 4 / 3;
  background: #E8E8E4;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.deo-slika img {
  width: 100%; height: 100%; object-fit: cover;
}
/* placeholder dok nema prave slike */
.deo-slika-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #B0B0A8; font-size: 12px; text-align: center; padding: 12px;
  font-family: var(--font-body);
}
.deo-slika-placeholder svg { width: 36px; height: 36px; fill: #C8C8C0; }

/* WP: .deo-badge → get_field('status') — "Na stanju" / "Prodato" / "Rezervisano" */
.deo-badge {
  position: absolute; top: 8px; left: 8px;
  background: #1a7a3a; color: #fff;
  font-family: var(--font-kondenz); font-weight: 700;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
}
.deo-badge.prodato { background: var(--boja-dim); }
.deo-badge.rezervisano { background: #B07800; }

.deo-body {
  padding: 14px; flex: 1;
  display: flex; flex-direction: column; gap: 6px;
}

/* WP: .deo-naziv → the_title() */
.deo-naziv {
  font-family: var(--font-kondenz);
  font-weight: 700; font-size: 16px;
  line-height: 1.2; letter-spacing: .01em;
}

/* WP: .deo-opis → the_excerpt() ili get_field('kratki_opis') */
.deo-opis {
  font-family: var(--font-opis);
  font-style: italic;
  font-size: 13px; color: var(--boja-dim);
  line-height: 1.5; flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deo-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
}

/* WP: .deo-cena → get_field('cena') */
.deo-cena {
  font-family: var(--font-kondenz);
  font-weight: 800; font-size: 22px;
  color: #1a7a3a;
}

.deo-akcija {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  background: var(--boja-primarna); color: #fff;
  padding: 7px 12px; border-radius: 8px;
  text-decoration: none; transition: background .15s;
}
.deo-akcija:hover { background: #9e1116; }
.deo-akcija.deo-akcija-viber { background: #7360F2; }
.deo-akcija.deo-akcija-viber:hover { background: #5d4dd6; }
.deo-akcija svg { width: 14px; height: 14px; fill: currentColor; }

/* ── PAGINACIJA ─────────────────────────────────────────────────────────────── */
.paginacija { margin-top: 32px; }

.pag-links {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 6px;
}
.pag-links a.page-numbers,
.pag-links span.page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  border-radius: 8px;
  font-family: var(--font-kondenz); font-weight: 700; font-size: 15px;
  border: 1px solid var(--boja-linija);
  background: var(--boja-bela); color: var(--boja-pozadina);
  text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.pag-links a.page-numbers:hover {
  background: var(--boja-pozadina); color: #fff;
  border-color: var(--boja-pozadina);
}
.pag-links span.current {
  background: var(--boja-primarna); color: #fff;
  border-color: var(--boja-primarna);
}
.pag-links span.dots {
  border-color: transparent; background: none;
  pointer-events: none; min-width: 20px;
}
.pag-links a.prev,
.pag-links a.next {
  padding: 0 14px; min-width: auto;
}
.pag-info {
  font-size: 13px; color: var(--boja-dim);
  text-align: center; margin-top: 10px;
}

/* ── CTA BANER ──────────────────────────────────────────────────────────────── */
/* WP: tekst ovog banera → Options page (ACF) ili widget */
.poziv-baner {
  background: var(--boja-pozadina); color: #fff;
  border-radius: var(--radius); padding: 24px 20px; margin-top: 32px;
  display: grid; gap: 16px; align-items: center;
}
.poziv-baner h3 { font-size: 22px; letter-spacing: .02em; }
.poziv-baner p { color: #B9BDC2; font-size: 15px; }
.poziv-baner .dugme-puno,
.filter-bar .dugme-puno { background: #C4161C !important; border-color: #C4161C !important; }
.poziv-baner .dugme-puno:hover,
.filter-bar .dugme-puno:hover { background: #111 !important; border-color: #111 !important; }

/* ── MOBILNI: samo ikonice u karticama ──────────────────────────────────────── */
@media (max-width: 759px) {
  .pozovi-tekst, .viber-tekst { display: none; }
  .deo-akcija { gap: 0; }
}

/* ── DESKTOP ────────────────────────────────────────────────────────────────── */
@media (min-width: 760px) {
  .filter-bar { top: 67px; }
  .delovi-grid { grid-template-columns: repeat(3, 1fr); }
  .poziv-baner { grid-template-columns: 1fr auto; }
}
@media (min-width: 1024px) {
  .delovi-grid { grid-template-columns: repeat(4, 1fr); }
}
