/* CG nekretnine — mobilno prvo */
:root {
  --bg: #0c1218;
  --bg-elevated: #141c26;
  --surface: #1a2432;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f2f4f7;
  --text-muted: #9aa4b2;
  --accent: #3dd6c3;
  --accent-dim: #2a9d8f;
  --accent-glow: rgba(61, 214, 195, 0.25);
  --warm: #e8b86d;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-display: "Outfit", var(--font-sans);
  --header-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --tap: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.45rem 1rem;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-dim);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23ffffff' fill-opacity='0.72' d='M8 22V12l8-6 8 6v10h-5v-7h-6v7H8z'/%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  background-size: 66% auto, cover;
  background-position: center, center;
  background-repeat: no-repeat;
  box-shadow: 0 0 24px var(--accent-glow);
}

.logo-accent {
  color: var(--accent);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.nav-main a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.25rem;
  border-radius: var(--radius-sm);
}

.nav-main a:hover,
.nav-main a[aria-current="page"] {
  color: var(--accent);
}

.nav-main--header {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

.header-user-nav {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  max-width: min(100%, 22rem);
}

.header-user-email,
.header-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-logout {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.header-user-logout:hover {
  color: var(--text);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-google-panel {
  margin-top: 0.5rem;
  padding: 1.25rem 1.35rem;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius, 12px);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.auth-google-title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.auth-google-lead {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 34rem;
}

.auth-google-btn-wrap {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  align-items: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.auth-google-btn-slot {
  min-height: 44px;
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.auth-google-btn-slot > div {
  max-width: 100% !important;
}

.search-panel--page .search-form,
.search-panel--page .auth-google-panel {
  max-width: 100%;
  box-sizing: border-box;
}

.auth-google-origin {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  line-height: 1.45;
}

.auth-google-origin-label {
  display: block;
  margin-bottom: 0.35rem;
}

.auth-google-origin-code {
  display: block;
  margin: 0.25rem 0 0.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  word-break: break-all;
  background: color-mix(in srgb, var(--bg) 100%, var(--accent) 6%);
  border-radius: 6px;
}

.auth-google-origin-note {
  display: block;
  font-size: 0.78rem;
  opacity: 0.95;
}

.auth-google-hint {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 36rem;
}

/* Mobilni meni — dugme se dodaje samo na telefonu (mobile-nav.js) */
.site-header .nav-menu-toggle {
  display: none !important;
}

.nav-menu-icon--close {
  display: none;
}

.site-header.is-nav-open .nav-menu-icon--open {
  display: none;
}

.site-header.is-nav-open .nav-menu-icon--close {
  display: block;
}

.nav-drawer-backdrop {
  display: none;
}

/* Desktop: logo | meni | akcije u jednom redu */
@media (min-width: 768px) {
  .site-header {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 0.75rem;
    padding: 0.45rem 1rem;
  }

  .header-inner {
    display: contents;
  }

  .site-header > .site-nav-panel,
  .site-header > .nav-main--header {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    min-width: 0;
  }

  .nav-drawer-backdrop {
    display: none !important;
  }

  .site-header .nav-menu-toggle {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media (max-width: 767px) {
  .site-header {
    position: sticky;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  .site-header.is-mobile-nav .header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo center menu";
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.4rem 0.85rem;
    gap: 0.35rem;
  }

  .site-header.is-mobile-nav .logo {
    grid-area: logo;
    justify-self: start;
    font-size: 1rem;
    flex: none;
    min-width: 0;
  }

  .logo-mark {
    width: 30px;
    height: 30px;
  }

  .site-header.is-mobile-nav .nav-actions {
    grid-area: center;
    justify-self: center;
    margin-left: 0;
    flex-shrink: 0;
    gap: 0.35rem;
  }

  .site-header.is-mobile-nav .nav-menu-toggle {
    grid-area: menu;
    justify-self: end;
    display: inline-flex !important;
    flex-shrink: 0;
    margin: 0;
  }

  .nav-actions .btn-primary {
    display: inline-flex;
    padding: 0 0.85rem;
    min-height: 38px;
    font-size: 0.82rem;
  }

  .header-inner {
    position: relative;
    z-index: 3;
  }

  .site-header > .site-nav-panel,
  .site-header > .nav-main--header {
    display: none;
    position: relative;
    z-index: 2;
    width: 100%;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.35rem 0.85rem 0.85rem;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
    max-height: min(70vh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
  }

  .site-header.is-nav-open > .site-nav-panel,
  .site-header.is-nav-open > .nav-main--header {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    flex: none !important;
    overflow-x: hidden !important;
  }

  .header-inner > .nav-main--header {
    display: none !important;
  }

  .site-header > .site-nav-panel a[href="dodaj-oglas.html"],
  .site-header > .nav-main--header a[href="dodaj-oglas.html"] {
    display: none;
  }

  .site-header > .site-nav-panel a,
  .site-header > .nav-main--header a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 0.8rem 0.35rem;
    border-bottom: 1px solid var(--border);
    white-space: normal;
  }

  .site-header > .site-nav-panel a:last-of-type,
  .site-header > .nav-main--header a:last-of-type {
    border-bottom: none;
  }

  .site-header > .site-nav-panel .header-user-nav,
  .site-header > .nav-main--header .header-user-nav {
    display: flex !important;
    width: 100%;
    max-width: none;
    margin-top: 0.5rem;
    padding: 0.75rem 0.35rem 0.15rem;
    border-top: 1px solid var(--border);
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.95rem;
  }

  .site-header > .site-nav-panel .header-user-name,
  .site-header > .nav-main--header .header-user-name {
    white-space: normal;
    font-weight: 600;
    color: var(--text);
  }

  .nav-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }

  .nav-drawer-backdrop[hidden] {
    display: none;
  }

  body.nav-drawer-open {
    overflow: hidden;
  }

  .hero-gallery {
    display: none;
  }
}

@media (max-width: 640px) {
  .nav-actions .btn-icon {
    min-width: var(--tap);
    min-height: var(--tap);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: var(--bg);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn-icon {
  min-width: var(--tap);
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-danger {
  background: color-mix(in srgb, #e85d5d 85%, #000);
  color: #fff;
  border: none;
}

.btn-danger:hover {
  filter: brightness(1.06);
}

.btn-sm {
  min-height: 36px;
  padding: 0 0.65rem;
  font-size: 0.8rem;
}

/* Hero */
.hero {
  position: relative;
  padding: 1.25rem 1rem 0;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-bg {
  position: absolute;
  inset: -20% -10% auto;
  height: 320px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-glow), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(232, 184, 109, 0.12), transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  padding-bottom: 1.25rem;
}

.hero-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 5.5vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.hero-lead {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 36ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.hero-gallery {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.hero-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

@media (max-width: 767px) {
  .hero-content {
    display: none !important;
  }

  .hero {
    padding-top: 0.5rem;
  }

  .hero-gallery {
    display: none !important;
  }
}

.search-hint {
  margin: 0 0 0.5rem;
}

.text-link {
  color: var(--accent);
  text-decoration: none;
}

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

.section-sub--spaced {
  margin-top: 1rem;
}

.map-pick {
  width: 100%;
  height: min(420px, 55vh);
  min-height: 220px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
}

.map-help {
  margin: 0 0 0.75rem;
  max-width: 60ch;
}

.map-status {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.detail-map-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 16 / 10;
  max-height: 420px;
}

.detail-map-frame {
  width: 100%;
  height: 100%;
  min-height: 260px;
  border: 0;
  display: block;
}

/* Search panel */
.search-panel {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  margin-bottom: 2rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-row-full {
  grid-column: 1 / -1;
}

.search-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .search-row-split {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  .search-form--compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
  }
}

.field-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input,
.select {
  min-height: var(--tap);
  padding: 0 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  width: 100%;
}

.input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.input:focus,
.select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa4b2' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.chip:has(:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--text);
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Listings */
.section {
  padding: 0 1rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-head {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.results-sort {
  min-width: min(340px, 100%);
}

.home-sort {
  flex: 0 1 auto;
  min-width: min(220px, 100%);
  margin: 0;
}

.home-sort .field-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.home-sort .select--compact {
  min-height: 38px;
  padding: 0.4rem 2rem 0.4rem 0.7rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
}

.section-head--listings {
  align-items: flex-end;
}

.section-head--sort-only {
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.section-head--sort-only .home-sort {
  margin-left: auto;
}

.section-head-main {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 560px) {
  .results-sort {
    width: 100%;
    min-width: 0;
  }

  .section-head--listings {
    align-items: stretch;
    gap: 0.65rem;
  }

  .home-sort {
    width: 100%;
    min-width: 0;
  }
}

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}

.card:active {
  transform: scale(0.99);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(12, 18, 24, 0.85);
  backdrop-filter: blur(6px);
  color: var(--accent);
}

.card-badge--featured {
  left: auto;
  right: 0.65rem;
  color: var(--warm);
}

.card--featured {
  border-color: color-mix(in srgb, var(--warm) 35%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--warm) 22%, transparent);
}

.card-price .price-suffix {
  font-size: 0.82em;
  font-weight: 600;
  color: var(--text-muted);
}

.card-body {
  padding: 0.9rem 1rem 1.1rem;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.card-meta {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-price {
  margin: 0.65rem 0 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--warm);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  margin: 0;
}

/* CTA */
.cta {
  padding-bottom: calc(2.5rem + var(--safe-bottom));
}

.cta-card {
  background: linear-gradient(145deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
}

.cta-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.cta-text {
  margin: 0.6rem 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 32ch;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.site-footer {
  padding: 1.25rem 1rem calc(1.5rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Desktop: hero + search side by side */
@media (min-width: 768px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    padding-top: 2rem;
  }

  .hero-bg {
    grid-column: 1 / -1;
    height: 280px;
  }

  .hero-content {
    padding-top: 0.5rem;
  }

  .search-panel {
    margin-bottom: 0;
  }

  .btn-primary:not(.btn-block) {
    min-height: 42px;
  }

  .nav-actions .btn-primary {
    padding: 0 1.25rem;
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 1.5rem;
    max-width: 100%;
  }

  .hero-lead {
    font-size: 0.92rem;
  }

  .chip {
    min-height: 36px;
    padding: 0 0.65rem;
    font-size: 0.82rem;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .card-body {
    padding: 0.8rem 0.85rem 0.95rem;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .card-meta {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .card-price {
    font-size: 1.02rem;
  }

  .admin-table {
    font-size: 0.78rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.5rem 0.45rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .card {
    transition: none;
  }

  .btn:active,
  .card:active {
    transform: none;
  }
}

/* Stranice (pretraga, oglas, dodaj, statičke) */
.page-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

.page-head {
  margin-bottom: 1.25rem;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-lead {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 52ch;
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.input-file {
  padding: 0.55rem 0.65rem;
  font-size: 0.9rem;
}

.upload-preview {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.upload-preview img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
}

.photo-add-label {
  margin-top: 0.5rem;
  cursor: pointer;
  text-align: center;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.photo-thumb {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.photo-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-thumb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.35rem;
  justify-content: center;
}

.detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.detail-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.detail-thumb-btn {
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  overflow: hidden;
  width: 72px;
  height: 54px;
  flex: 0 0 auto;
}

.detail-thumb-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-thumb-btn.is-active,
.detail-thumb-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.card-badge--photos {
  right: auto;
  left: 0.5rem;
  bottom: 0.5rem;
  top: auto;
  background: rgba(15, 23, 42, 0.75);
}

.my-listings {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.my-listings-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.my-listings-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.my-listings-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.my-listings-link:hover .my-listings-title {
  color: var(--accent);
}

.my-listings-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.my-listings-thumb--empty {
  display: block;
  background: var(--border);
}

.my-listings-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.my-listings-title {
  font-size: 1rem;
  line-height: 1.3;
}

.my-listings-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.faq-dl {
  margin: 1rem 0 0;
}

.faq-dl dt {
  font-weight: 600;
  margin-top: 1rem;
}

.faq-dl dd {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.input[readonly] {
  opacity: 0.92;
  cursor: default;
}

.section--tight {
  padding-top: 0;
}

.search-panel--page {
  margin-bottom: 1.5rem;
}

.search-row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 760px) {
  .search-row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

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

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.notice-banner {
  background: color-mix(in srgb, var(--warm) 12%, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.notice-banner code {
  font-size: 0.8em;
  color: var(--accent);
}

.notice-banner--warn {
  background: color-mix(in srgb, #e8a030 16%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  color: var(--text);
}

.form-page {
  max-width: 640px;
}

.form-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1rem 1.1rem;
  margin: 0 0 1rem;
  background: var(--bg-elevated);
}

.form-legend {
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0 0.35rem;
}

.textarea {
  min-height: 120px;
  resize: vertical;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.form-error {
  color: #f0a0a0;
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.form-success {
  color: var(--accent);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.prose-block p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  max-width: 60ch;
}

/* Detalj oglasa */
.detail-article {
  margin-top: 0.5rem;
}

.detail-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .detail-grid {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
  }
}

.detail-image-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.detail-image-wrap img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.detail-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.detail-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.detail-loc {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

.detail-price {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--warm);
}

.detail-dl {
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.65rem;
}

.detail-dl > div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.detail-dl dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.detail-dl dd {
  margin: 0;
}

.contact-phone-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.05rem;
}

.contact-phone-link:hover {
  text-decoration: underline;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.contact-actions .contact-btn {
  flex: 0 0 auto;
  min-height: var(--tap);
  font-size: 0.88rem;
  padding: 0 0.85rem;
}

.contact-actions .contact-btn--call {
  flex: 1 1 auto;
  min-width: 5.5rem;
}

.contact-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  min-width: var(--tap);
  padding: 0;
  border: none;
}

.contact-btn--icon svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.contact-btn--viber {
  background: #7360f2;
  color: #fff;
}

.contact-btn--viber:hover {
  filter: brightness(1.08);
}

.contact-btn--whatsapp {
  background: #25d366;
  color: #fff;
}

.contact-btn--whatsapp:hover {
  filter: brightness(1.08);
}

.detail-dl dd .contact-actions {
  margin-top: 0.75rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.detail-opis-text {
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* SEO blokovi */
.seo-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.seo-card {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
}

.seo-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-family: var(--font-display, inherit);
}

.seo-card p {
  margin: 0 0 0.65rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.seo-faq .faq-list {
  margin: 0;
  max-width: 42rem;
}

.faq-list .faq-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.faq-list .faq-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.faq-list dt {
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.faq-list dd {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent, #0f766e);
  text-decoration: underline;
}

/* Admin */
.admin-body {
  min-height: 100dvh;
}

.admin-login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.admin-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
}

.admin-login-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.admin-login-hint {
  font-size: 0.8rem !important;
}

.admin-login-hint code {
  font-size: 0.75em;
  color: var(--accent);
}

.admin-topbar {
  position: relative;
}

.admin-main {
  padding-top: 1.25rem;
}

/* Jasno sakrij/prikaži admin sekcije (tabovi) — izbjegava „prazan“ sadržaj ako [hidden] nije konzistentan */
.admin-main > .admin-section[hidden] {
  display: none !important;
}

.admin-main > .admin-section:not([hidden]) {
  display: block;
}

.admin-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.admin-tab {
  flex: 1;
  min-height: var(--tap);
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.admin-tab.is-active {
  background: var(--surface);
  color: var(--accent);
}

.admin-section {
  margin-bottom: 2rem;
}

.admin-mail-details {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.admin-mail-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.admin-mail-details .section-sub {
  margin: 0.5rem 0 0;
}

/* Upozorenja za E-poštu (npr. nema PHP / nije JSON) — nije ista boja kao prava greška */
#mailSaveMsg.admin-mail-warn {
  color: var(--text-muted);
  border-left: 3px solid #c9a227;
  padding-left: 0.65rem;
  margin-top: 0.5rem;
}


.admin-toolbar {
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  background: var(--bg-elevated);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  background: var(--surface);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-mjesta-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-mjesta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.admin-align-end {
  align-self: end;
}
