@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap");

/* ─── RESET & BASE ──────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy: #37465d;
  --navy-d: #253040;
  --navy-l: #4e627d;
  --gold: #c8a96e;
  --gold-d: #a8843a;
  --white: #ffffff;
  --bg: #f0f2f5;
  --border: #e2e6ec;
  --text: #1a2332;
  --muted: #6b7a90;
  --success: #16a34a;
  --error: #dc2626;

  --shadow-sm: 0 1px 3px rgba(26, 37, 64, 0.07);
  --shadow-md: 0 4px 16px rgba(26, 37, 64, 0.1);
  --shadow-lg: 0 12px 40px rgba(26, 37, 64, 0.14);
  --radius: 9px;
  --radius-lg: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
}

/* ─── TOP BAR ───────────────────────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  padding: 0 32px;
  height: 60px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--navy);
  line-height: 1.4;
}

.logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.top-nav ul {
  display: flex;
  gap: 4px;
  align-items: center;
}

.top-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 7px;
  transition: all 0.18s;
}

.top-nav a:hover {
  color: var(--navy);
  background: var(--bg);
}

.lang img {
  width: 20px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.lang img:hover {
  opacity: 1;
}

.mobile-menu-btn {
  display: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--navy);
}

/* ─── MAIN NAV ──────────────────────────────────────────────── */
.main-nav {
  background: var(--navy-d);
  padding: 0 32px;
}

.main-nav ul {
  display: flex;
  gap: 2px;
  max-width: 1400px;
  margin: 0 auto;
}

.main-nav a {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 13px 14px;
  position: relative;
  transition: color 0.18s;
}

.main-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.22s ease;
}

.main-nav a:hover {
  color: var(--white);
}
.main-nav a:hover::after {
  transform: scaleX(1);
}

/* ─── HERO ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  background:
    linear-gradient(
      155deg,
      rgba(37, 48, 64, 0.94) 0%,
      rgba(55, 70, 93, 0.85) 100%
    ),
    url("../assets/naslovna.jpeg") center/cover no-repeat;
  color: var(--white);
  text-align: center;
  padding: 80px 24px 72px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero h1 {
  /* font-family: "Playfair Display", serif; */
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero h1 span {
  color: var(--gold);
}

.hero > p {
  font-size: clamp(14px, 1.8vw, 17px);
  font-weight: 400;
  opacity: 0.72;
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── SEARCH BAR ────────────────────────────────────────────── */
.search-bar {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.search-bar input {
  flex: 1;
  padding: 13px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  /* font-family: "Plus Jakarta Sans", sans-serif; */
  background: rgba(255, 255, 255, 0.97);
  color: var(--text);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  outline: none;
  transition: box-shadow 0.2s;
}

.search-bar input:focus {
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.25),
    0 0 0 2px var(--gold);
}
.search-bar input::placeholder {
  color: var(--muted);
}

.search-bar button {
  background: var(--gold);
  color: var(--white);
  border: none;
  padding: 13px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: "Plus Jakarta Sans", sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 169, 110, 0.4);
  transition:
    background 0.18s,
    transform 0.14s;
  white-space: nowrap;
}

.search-bar button:hover {
  background: var(--gold-d);
  transform: translateY(-1px);
}
.search-bar button:active {
  transform: translateY(0);
}

/* ─── MAIN LAYOUT ───────────────────────────────────────────── */
main {
  display: flex;
  max-width: 1400px;
  margin: 28px auto;
  padding: 0 24px;
  gap: 22px;
  align-items: flex-start;
}

/* ─── SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
  flex: 0 0 300px;
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
}

.sidebar input,
.sidebar select {
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
  appearance: none;
  -webkit-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='%236b7a90' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.sidebar select {
  padding-right: 30px;
}

.sidebar input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%236b7a90' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-size: 14px;
  background-position: right 12px center;
  padding-right: 34px;
}

.sidebar input:focus,
.sidebar select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(55, 70, 93, 0.08);
  background-color: var(--white);
}

.sidebar label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 7px;
}

#resultCount {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

/* ─── STATS BOXES ───────────────────────────────────────────── */
.stats-container {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
}

.stat-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
  border: 1px solid var(--border);
  transition: box-shadow 0.18s;
}

.stat-box:hover {
  box-shadow: var(--shadow-sm);
}

.stat-box h4 {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.stat-box span {
  font-size: 12.5px !important;
  font-weight: 700 !important;
}

#budget-fbih-display {
  font-size: 15px !important;
  color: #6f42c1 !important;
}

#budget-fbih-display + h4,
.stat-box:has(#budget-fbih-display) h4 {
  font-size: 10px !important;
}

#donated-display {
  color: var(--success) !important;
}
#returned-display {
  color: #2563eb !important;
}
#monthly-rent-amount {
  color: #d97706 !important;
}
#sold-display {
  color: var(--error) !important;
}

/* ─── CONTENT ───────────────────────────────────────────────── */
.content {
  flex: 1;
  min-width: 0;
}

/* ─── GRID ──────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ─── CARD ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.card-image {
  height: 180px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #e8ecf0;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.38s ease;
}

.card:hover .card-image img {
  transform: scale(1.05);
}

/* category badge */
.card-image::after {
  content: attr(data-badge);
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--navy-d);
  color: rgba(255, 255, 255, 0.9);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
}

.card-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-body p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 2px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.specs {
  font-size: 11.5px;
  color: var(--text);
  background: var(--bg);
  padding: 4px 9px;
  border-radius: 6px;
  margin: 6px 0 3px;
  display: inline-block;
  border: 1px solid var(--border);
}

.price {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: var(--navy-d) !important;
  margin: auto 0 12px !important;
  padding-top: 10px;
  letter-spacing: -0.01em;
}

.card-buttons {
  display: flex;
  gap: 7px;
  margin-top: 2px;
}

.card-buttons button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  font-family: "Plus Jakarta Sans", sans-serif;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--navy-l);
}

.btn-secondary {
  background: var(--bg);
  color: var(--navy);
  border: 1.5px solid var(--border) !important;
}
.btn-secondary:hover {
  background: var(--border);
}

/* loading / empty / error */
.loading,
.error,
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  font-size: 14px;
  color: var(--muted);
}
.error {
  color: var(--error);
}

/* ─── PAGINATION ────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin: 28px 0 12px;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  font-family: "Plus Jakarta Sans", sans-serif;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.pagination-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  box-shadow: 0 3px 10px rgba(37, 48, 64, 0.3);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ─── MODAL ─────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 26, 0.88);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(6px);
}

.modal.show {
  display: flex;
}

.modal img {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}

.modal .close {
  position: absolute;
  top: 20px;
  right: 26px;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  line-height: 1;
  transition: color 0.18s;
}
.modal .close:hover {
  color: var(--white);
}

.modal .prev,
.modal .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--white);
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.18s;
}
.modal .prev {
  left: 22px;
}
.modal .next {
  right: 22px;
}
.modal .prev:hover,
.modal .next:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ─── FOOTER ────────────────────────────────────────────────── */
footer {
  background: var(--navy-d);
  padding: 48px 32px 24px;
  margin-top: 60px;
  color: rgba(255, 255, 255, 0.55);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
}

.footer-logo img {
  width: 62px;
  margin-bottom: 10px;
  /* filter: brightness(0) invert(1) opacity(0.55); */
  border-radius: 100%;
}
.footer-logo p {
  font-size: 12px;
  max-width: 200px;
  line-height: 1.6;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.footer-nav a {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.18s;
}
.footer-nav a:hover {
  color: var(--gold);
}

.copyright {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.25);
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sidebar {
    flex: 0 0 228px;
  }
}

@media (max-width: 900px) {
  main {
    flex-direction: column;
  }
  .sidebar {
    position: static;
    width: 100%;
    flex: none;
  }
  .stats-container {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  .top-bar {
    padding: 0 16px;
  }
  .main-nav {
    padding: 0 16px;
  }

  .top-nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--white);
    position: absolute;
    top: 100%;
    left: 0;
    padding: 12px 16px;
    z-index: 100;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--border);
  }
  .top-nav ul.active {
    display: flex;
  }
  .main-nav ul {
    flex-direction: column;
    display: none;
    padding: 6px 0;
  }
  .main-nav ul.active {
    display: flex;
  }

  .hero {
    padding: 60px 16px 56px;
  }
  .hero::after {
    height: 36px;
    clip-path: ellipse(65% 100% at 50% 100%);
  }
  .search-bar {
    flex-direction: column;
    gap: 8px;
  }
  .search-bar input,
  .search-bar button {
    border-radius: 8px;
  }
  .search-bar button {
    width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
  }
  .stats-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .modal .prev,
  .modal .next {
    font-size: 24px;
    width: 40px;
    height: 40px;
  }
  footer {
    padding: 36px 16px 18px;
  }
  .footer-content {
    gap: 24px;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero::after {
    height: 28px;
    clip-path: ellipse(70% 100% at 50% 100%);
  }
  .stats-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
