/* ==========================================================================
   BookBiH — zajednički dizajn sistem (javni dio sajta)
   Boje su tokeni na :root; tamni način ih redefiniše pod [data-theme="dark"].
   Komponente koriste samo tokene, pa rade u oba načina.
   ========================================================================== */

:root {
  --primary: #21838a;
  --primary-dark: #1a6a70;
  --primary-light: #e0f0f1;
  --primary-contrast: #ffffff;
  --accent: #f4a423;
  --accent-dark: #e8891c;
  --danger: #ef4444;
  --success: #10b981;
  --star: #f5b301;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f4f6;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e5e7eb;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 8px rgba(15, 23, 42, .04);
  --shadow: 0 4px 24px rgba(15, 23, 42, .07);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .12);

  --hero-grad: linear-gradient(135deg, #21838a 0%, #1a6a70 55%, #124f55 100%);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --primary: #2f9aa2;
  --primary-dark: #21838a;
  --primary-light: rgba(47,154,162, .16);
  --primary-contrast: #ffffff;
  --bg: #0b1220;
  --surface: #121b2d;
  --surface-2: #1a2438;
  --text: #e6e9ef;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --border: #253149;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
  --hero-grad: linear-gradient(135deg, #123f3f 0%, #0c2d2d 60%, #0b1220 100%);
  color-scheme: dark;
}

/* ── Osnova ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
.text-muted { color: var(--muted) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

.page-title { font-size: clamp(1.35rem, 2.4vw, 1.75rem); font-weight: 800; letter-spacing: -.01em; }
.section-title { font-size: clamp(1.25rem, 2.2vw, 1.5rem); font-weight: 800; margin-bottom: .25rem; letter-spacing: -.01em; }
.section-sub { color: var(--muted); margin-bottom: 0; }
.eyebrow {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}

/* ── Navigacija ─────────────────────────────────────────── */
.navbar { background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); }
.navbar-brand { font-weight: 800; font-size: 1.2rem; color: var(--primary) !important; letter-spacing: -.01em; }
.navbar-brand .logo-emoji { font-size: 1.4rem; margin-right: 4px; }
.nav-link { font-weight: 600; color: var(--text) !important; }
.nav-link:hover { color: var(--primary) !important; }
.btn-nav-primary {
  background: var(--primary); color: var(--primary-contrast) !important;
  border-radius: 10px; padding: .45rem 1rem !important; font-weight: 700; font-size: .875rem;
}
.btn-nav-primary:hover { background: var(--primary-dark); }
.lang-select {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 4px 8px; font-weight: 600;
  cursor: pointer; background: var(--surface); color: var(--text); font-size: .85rem; outline: none;
}
.theme-toggle {
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  width: 36px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; font-size: 1rem; line-height: 1;
}
.theme-toggle:hover { border-color: var(--primary); }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: inline; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.dropdown-menu { border-color: var(--border); box-shadow: var(--shadow); border-radius: 12px; }

/* ── Footer ─────────────────────────────────────────────── */
.footer { background: #0b1220; color: #9ca3af; padding: 2.5rem 0 1.5rem; margin-top: 4rem; font-size: .875rem; }
.footer a { color: #9ca3af; text-decoration: none; }
.footer a:hover { color: #fff; }
.footer .brand { color: #fff; font-weight: 800; font-size: 1.05rem; }
.footer-heading { color: #fff; font-weight: 700; margin-bottom: .5rem; }
.footer hr { border-color: #1f2a3f; opacity: 1; }

/* ── Poruke ─────────────────────────────────────────────── */
.messages-container { position: fixed; top: 72px; right: 1rem; z-index: 1080; width: min(360px, calc(100vw - 2rem)); }
.toast-msg {
  background: var(--surface); color: var(--text); border-radius: 12px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); border-left: 4px solid var(--primary);
  padding: .875rem 1rem; margin-bottom: .5rem; animation: toastIn .3s ease; font-size: .92rem;
}
.toast-msg.error { border-left-color: var(--danger); }
.toast-msg.warning { border-left-color: #f59e0b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ── Dugmad ─────────────────────────────────────────────── */
.btn-brand {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--primary); color: var(--primary-contrast); border: none; border-radius: 12px;
  padding: .8rem 1.4rem; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.btn-brand:hover { background: var(--primary-dark); color: var(--primary-contrast); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn-brand:active { transform: translateY(1px); }
.btn-brand:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-brand.btn-lg { padding: 1rem 1.5rem; font-size: 1.05rem; border-radius: 14px; }
.btn-brand.w-100 { display: flex; }
.btn-soft {
  display: inline-flex; align-items: center; gap: .4rem; background: var(--primary-light); color: var(--primary);
  border: none; border-radius: 10px; padding: .5rem .9rem; font-weight: 700; font-size: .875rem;
  text-decoration: none; cursor: pointer; transition: filter .15s;
}
.btn-soft:hover { filter: brightness(.96); color: var(--primary); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: .4rem; background: transparent; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 10px; padding: .5rem .9rem; font-weight: 600;
  font-size: .875rem; text-decoration: none; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ── Površine ───────────────────────────────────────────── */
.surface {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.25rem;
}
.surface + .surface { margin-top: 1rem; }
.surface h3, .surface-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin-bottom: 1rem;
}

/* ── Kartica biznisa (početna, pretraga, omiljeni) ──────── */
.biz-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.biz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.biz-card__cover {
  aspect-ratio: 16 / 9; background: var(--primary-light); display: flex; align-items: center;
  justify-content: center; font-size: 2.75rem; overflow: hidden; position: relative;
}
.biz-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.biz-card:hover .biz-card__cover img { transform: scale(1.04); }
.biz-card__logo {
  position: absolute; left: 12px; bottom: -22px; width: 48px; height: 48px; border-radius: 12px;
  background: var(--surface); border: 2px solid var(--surface); box-shadow: var(--shadow-sm);
  overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.biz-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.biz-card__body { padding: 1rem; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.biz-card__cover:has(.biz-card__logo) + .biz-card__body { padding-top: 1.75rem; }
.biz-card__name { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.biz-card__meta { font-size: .8rem; color: var(--muted); }
.biz-card__foot { margin-top: auto; padding-top: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; font-weight: 700; }
.rating .star { color: var(--star); }
.rating .count { color: var(--muted); font-weight: 500; }
.chip-next {
  background: var(--primary-light); color: var(--primary); border-radius: 8px;
  padding: 3px 8px; font-size: .74rem; font-weight: 700; white-space: nowrap;
}
.chip-next.is-none { background: var(--surface-2); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); color: var(--text-2);
  border-radius: 999px; padding: 3px 10px; font-size: .75rem; font-weight: 600; }

/* Omiljeni — srce */
.fav-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: none; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.05rem;
  transition: transform .15s;
}
.fav-btn:hover { transform: scale(1.08); }
.fav-btn .on { display: none; }
.fav-btn.is-fav .on { display: inline; }
.fav-btn.is-fav .off { display: none; }
.fav-inline { position: static; width: auto; height: auto; border-radius: 10px; padding: .45rem .8rem; gap: .35rem; font-weight: 700; font-size: .85rem; color: var(--text); }

/* ── Kategorije ─────────────────────────────────────────── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .85rem; }
.cat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem .9rem;
  text-align: center; text-decoration: none; color: var(--text); transition: all .2s;
}
.cat-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow); color: var(--primary); }
.cat-card__icon {
  width: 52px; height: 52px; margin: 0 auto .55rem; border-radius: 14px; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.cat-card__name { font-size: .85rem; font-weight: 700; }
.cat-card__count { font-size: .74rem; color: var(--muted); margin-top: 2px; }

/* ── Prazno stanje ──────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 2.5rem 1.25rem; background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state__icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--primary-light); margin: 0 auto .9rem;
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
}

/* ── Skeleton učitavanje ────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 55%, var(--surface)) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px;
}
.skeleton-slot { height: 42px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ── Zvjezdice / recenzije ──────────────────────────────── */
.stars { color: var(--star); letter-spacing: 1px; }
.stars .off { color: var(--border); }
.review { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.review:last-child { border-bottom: none; }
.review__head { display: flex; align-items: center; gap: .6rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--primary-contrast);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem;
  flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.owner-reply {
  margin-top: .6rem; margin-left: 2.6rem; background: var(--surface-2); border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0; padding: .6rem .85rem; font-size: .875rem;
}
.rating-bars .bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; flex: 1; }
.rating-bars .bar > span { display: block; height: 100%; background: var(--star); border-radius: 99px; }

/* ── Poklon bon ─────────────────────────────────────────── */
.gift-card {
  background: linear-gradient(135deg, var(--primary) 0%, #124f55 100%); color: #fff;
  border-radius: 18px; padding: 1.25rem 1.4rem; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.gift-card::after { content: '🎁'; position: absolute; right: -8px; bottom: -18px; font-size: 5.5rem; opacity: .12; }
.gift-card.is-used { filter: grayscale(.85); opacity: .75; }
.gift-card__biz { font-size: .8rem; font-weight: 700; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.gift-card__code { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 1.35rem; font-weight: 800; letter-spacing: .08em; margin-top: .25rem; }
.gift-card__amount { font-size: 1.5rem; font-weight: 800; }

/* ── Donja traka na mobitelu (npr. "Rezerviši") ─────────── */
.mobile-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: none;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 -6px 24px rgba(0,0,0,.08);
}
.mobile-cta .btn-brand { width: 100%; }
@media (max-width: 991.98px) {
  .mobile-cta { display: flex; gap: .75rem; align-items: center; }
  body.has-mobile-cta { padding-bottom: 88px; }
}

/* ── Lightbox ───────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 2000; background: rgba(5, 10, 20, .92); display: none;
  align-items: center; justify-content: center; padding: 1rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 50%;
  width: 44px; height: 44px; font-size: 1.4rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox__close { top: 16px; right: 16px; }
.lightbox__nav.prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__nav.next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__caption { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #e5e7eb; font-size: .9rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.gallery-grid a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-grid a:hover img { transform: scale(1.05); }

/* ── Mapa ───────────────────────────────────────────────── */
.map-box { height: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); z-index: 0; }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 10px 12px; font-family: var(--font); }
.map-pop__name { font-weight: 800; font-size: .95rem; color: #0f172a; }
.map-pop__meta { font-size: .8rem; color: #64748b; }

/* ── PWA instalacija ────────────────────────────────────── */
.install-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1060; max-width: 420px; margin: 0 auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: .9rem 1rem; display: none; align-items: center; gap: .75rem;
}
.install-banner.show { display: flex; }
body.has-mobile-cta .install-banner { bottom: 96px; }

/* ── Tamni način: Bootstrap i često korištene klase ──────── */
[data-theme="dark"] .bg-white { background-color: var(--surface) !important; }
[data-theme="dark"] .bg-light { background-color: var(--surface-2) !important; }
[data-theme="dark"] .text-dark { color: var(--text) !important; }
[data-theme="dark"] .border, [data-theme="dark"] .border-bottom, [data-theme="dark"] .border-top { border-color: var(--border) !important; }
[data-theme="dark"] .card { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select {
  background-color: var(--surface-2); border-color: var(--border); color: var(--text);
}
[data-theme="dark"] .form-control::placeholder { color: var(--muted); }
[data-theme="dark"] .table { --bs-table-bg: transparent; color: var(--text); }
[data-theme="dark"] .btn-outline-secondary { color: var(--text-2); border-color: var(--border); }
