/* ============================================================
   Kabl Hub — Mobile layout, navigation & ambient atmosphere
   Loaded after custom.css. Desktop unchanged above 721px.
   ============================================================ */

:root {
  --ambient-neon-warm: 255, 102, 28;
  --ambient-neon-brand: 255, 118, 42;
  --ambient-neon-hot: 1;
  --ambient-neon-mid: 0.88;
  --ambient-neon-soft: 0.52;
  --ambient-neon-spill: 0.22;
  --ambient-neon-gap-before-panel: 5px;
  --mobile-header-height: 56px;
  --mobile-page-gutter: clamp(12px, 4vw, 16px);
}

/* Bottom "Prikaži sve" — mobile-only placement */
body[data-page="landing"] .ads-panel__footer {
  display: none;
}

/* ---------- Ambient edge neon (mobile-only, scroll-reactive) ---------- */
.kabl-ambient {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.12s ease-out;
}

.kabl-ambient * {
  pointer-events: none;
}

.kabl-ambient.kabl-ambient--active {
  opacity: 1;
  transition: opacity 0.08s ease-out;
}

/* Top wash disabled — edge leak only on mobile */
.kabl-ambient__hero {
  display: none;
}

.kabl-ambient__edge {
  position: absolute;
  top: 50%;
  width: max(7px, calc(var(--mobile-page-gutter) - var(--ambient-neon-gap-before-panel)));
  max-width: calc(16px - var(--ambient-neon-gap-before-panel));
  height: clamp(340px, 64vh, min(70vh, 580px));
  transform: translate3d(0, -50%, 0);
  opacity: 1;
  filter: blur(2px);
  will-change: opacity;
}

.kabl-ambient__edge--left {
  left: 0;
  background:
    radial-gradient(
      ellipse 145% 96% at 0% 50%,
      rgba(var(--ambient-neon-warm), var(--ambient-neon-hot)) 0%,
      rgba(var(--ambient-neon-brand), var(--ambient-neon-mid)) 20%,
      rgba(var(--ambient-neon-brand), var(--ambient-neon-soft)) 38%,
      rgba(var(--ambient-neon-brand), var(--ambient-neon-spill)) 54%,
      transparent 66%
    );
}

.kabl-ambient__edge--right {
  right: 0;
  background:
    radial-gradient(
      ellipse 145% 96% at 100% 50%,
      rgba(var(--ambient-neon-warm), var(--ambient-neon-hot)) 0%,
      rgba(var(--ambient-neon-brand), var(--ambient-neon-mid)) 20%,
      rgba(var(--ambient-neon-brand), var(--ambient-neon-soft)) 38%,
      rgba(var(--ambient-neon-brand), var(--ambient-neon-spill)) 54%,
      transparent 66%
    );
}

.has-mobile-shell .main {
  position: relative;
  z-index: 1;
}

.has-mobile-shell nav.topnav--desktop,
.has-mobile-shell footer.footer {
  z-index: 1000;
}

/* ---------- Mobile-only shell ---------- */
@media (max-width: 720px) {
  html,
  body.has-mobile-shell {
    overflow-x: clip;
    max-width: 100%;
  }

  .main,
  .mobile-header,
  .mobile-header__inner,
  .footer,
  .page-container,
  .header,
  .header__inner,
  .ads-panel,
  .ads-panel__inner,
  .ads-list,
  .ad {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .topnav--desktop {
    display: none !important;
  }

  body.has-mobile-shell {
    padding-top: var(--mobile-header-height);
    padding-bottom: 62px;
  }

  .page-container {
    padding-left: var(--mobile-page-gutter);
    padding-right: var(--mobile-page-gutter);
  }

  .main {
    position: relative;
    z-index: 1;
    padding-top: 0;
    padding-bottom: 20px;
  }

  /* Mobile button system — prevent wrapping, match mockup scale */
  .btn {
    font-size: clamp(13px, 3.6vw, 16px);
    letter-spacing: clamp(0.3px, 0.12vw, 0.6px);
    line-height: 1.15;
    white-space: nowrap;
    max-width: 100%;
  }

  .btn--sm {
    font-size: clamp(10px, 2.85vw, 13px);
    letter-spacing: clamp(0.35px, 0.1vw, 0.7px);
    padding: clamp(7px, 2vw, 9px) clamp(10px, 2.8vw, 14px);
    border-radius: 7px;
  }

  .btn__plus {
    font-size: clamp(15px, 4.2vw, 19px);
    line-height: 1;
    flex-shrink: 0;
  }

  /* Disable hover-driven repaints on touch; panel keeps border only */
  .ads-panel,
  .ads-panel:hover,
  .ads-panel--results,
  .ads-panel--results:hover,
  .ads-panel--search,
  .ads-panel--search:hover,
  body[data-page="oglas"] .oglas-card,
  body[data-page="oglas"] .oglas-card:hover {
    transition: none;
    transform: none;
    box-shadow: none !important;
  }

  /* ---------- Fixed mobile header ---------- */
  .mobile-header {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    z-index: 1100;
    background-color: var(--color-bg);
    border-bottom: 1px solid rgba(31, 42, 68, 0.07);
    overflow-x: clip;
  }

  .mobile-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(10px, 3vw, 14px);
    min-height: var(--mobile-header-height);
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .mobile-header .mobile-header__inner.page-container {
    padding-left: 8px;
    padding-right: 12px;
  }

  .mobile-header__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    margin-left: 14px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-navy);
    touch-action: manipulation;
    transition: opacity 0.12s ease, background-color 0.12s ease, transform 0.1s ease;
  }

  .mobile-header__toggle:active {
    opacity: 0.55;
    background-color: rgba(28, 42, 68, 0.08);
    transform: scale(0.96);
  }

  .mobile-header__toggle svg {
    width: 44px;
    height: 44px;
    stroke-width: 2;
  }

  .mobile-header__toggle-icon--open,
  .mobile-header__toggle-icon--close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-header__toggle-icon--close {
    display: none;
  }

  .mobile-header.is-open .mobile-header__toggle-icon--open {
    display: none;
  }

  .mobile-header.is-open .mobile-header__toggle-icon--close {
    display: inline-flex;
  }

  .mobile-header.is-open .mobile-header__toggle svg {
    width: 44px;
    height: 44px;
    stroke-width: 2.4;
  }

  .mobile-header__logo {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 58%;
    margin-left: 0;
    margin-right: 36px;
    transition: opacity 0.12s ease;
  }

  .mobile-header__logo:active {
    opacity: 0.72;
  }

  .mobile-header__logo-img {
    height: clamp(38px, 11.5vw, 46px);
    width: auto;
    max-width: 100%;
    display: block;
  }

  /* ---------- Drawer ---------- */
  .mobile-drawer[hidden] {
    display: none;
  }

  .mobile-drawer:not([hidden]) {
    display: block;
  }

  .mobile-drawer {
    position: fixed;
    top: var(--mobile-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    pointer-events: none;
  }

  .mobile-drawer.is-open {
    pointer-events: auto;
  }

  .mobile-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 28, 35, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.22s ease;
  }

  .mobile-drawer.is-open .mobile-drawer__backdrop {
    opacity: 1;
  }

  .mobile-drawer__panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(78vw, 318px);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px 18px;
    background: linear-gradient(180deg, #161c22 0%, var(--color-navy-dark) 100%);
    color: #fff;
    border-top-right-radius: 26px;
    box-shadow: 10px 0 36px rgba(0, 0, 0, 0.32);
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .mobile-drawer.is-open .mobile-drawer__panel {
    transform: translateX(0);
  }

  .mobile-drawer__panel.is-dragging {
    transition: none;
  }

  .mobile-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .mobile-drawer__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 2px;
    font-family: "Inter", sans-serif;
    font-size: clamp(17px, 4.6vw, 18px);
    font-weight: 500;
    line-height: 1.2;
    color: #fff;
    touch-action: manipulation;
    transition: opacity 0.12s ease, color 0.15s ease;
  }

  .mobile-drawer__link:active {
    opacity: 0.68;
  }

  .mobile-drawer__link.is-active {
    color: var(--color-orange);
  }

  .mobile-drawer__icon {
    display: inline-flex;
    width: 22px;
    flex-shrink: 0;
    justify-content: center;
    color: inherit;
  }

  .mobile-drawer__icon svg {
    width: 20px;
    height: 20px;
  }

  .mobile-drawer__search {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 2px;
  }

  .mobile-drawer__search-icon {
    position: absolute;
    left: 12px;
    color: rgba(255, 255, 255, 0.72);
    pointer-events: none;
    display: inline-flex;
  }

  .mobile-drawer__search-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 48px 10px 38px;
    border: 0;
    border-radius: 999px;
    background: var(--color-myblue);
    color: #fff;
    font: inherit;
    font-size: clamp(14px, 3.8vw, 15px);
  }

  .mobile-drawer__search-input::-webkit-search-cancel-button,
  .mobile-drawer__search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
  }

  .mobile-drawer__search-input::-ms-clear,
  .mobile-drawer__search-input::-ms-reveal {
    display: none;
  }

  .mobile-drawer__search-submit {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--color-orange);
    color: #fff;
    touch-action: manipulation;
    cursor: pointer;
    transition: background-color 0.12s ease, transform 0.1s ease, opacity 0.12s ease;
  }

  .mobile-drawer__search-submit svg {
    width: 18px;
    height: 18px;
  }

  .mobile-drawer__search-submit:active {
    background: var(--color-orange-hover);
    transform: translateY(-50%) scale(0.94);
    opacity: 0.92;
  }

  .mobile-drawer__search-submit:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }

  .mobile-drawer__search-input::placeholder {
    color: rgba(255, 255, 255, 0.62);
  }

  .mobile-drawer__search-input:focus-visible {
    outline: 2px solid var(--color-orange);
    outline-offset: 1px;
  }

  .mobile-drawer__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 8px;
    background: var(--color-orange);
    color: #fff;
    font-family: "Oswald", sans-serif;
    font-size: clamp(13px, 3.6vw, 15px);
    font-weight: 500;
    letter-spacing: clamp(0.35px, 0.12vw, 0.65px);
    text-transform: uppercase;
    white-space: nowrap;
    touch-action: manipulation;
    box-shadow: 0 4px 14px rgba(232, 114, 58, 0.28);
    transition: background-color 0.12s ease, transform 0.1s ease, opacity 0.12s ease, box-shadow 0.12s ease;
  }

  .mobile-drawer__cta:active {
    background: var(--color-orange-hover);
    transform: translateY(1px);
    opacity: 0.92;
    box-shadow: 0 3px 10px rgba(232, 114, 58, 0.24);
  }

  .mobile-drawer__divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
    margin: 6px 0 2px;
  }

  .mobile-drawer__divider--footer {
    margin: 0;
  }

  .mobile-drawer__footer-group {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
  }

  .mobile-drawer__secondary {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .mobile-drawer__secondary-link {
    display: block;
    min-height: 42px;
    padding: 8px 2px;
    font-size: clamp(15px, 4.2vw, 16px);
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.9);
    touch-action: manipulation;
    transition: opacity 0.12s ease;
  }

  .mobile-drawer__secondary-link:active {
    opacity: 0.68;
  }

  .mobile-drawer__footer {
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 0;
  }

  .mobile-drawer__copy {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.52);
  }

  .mobile-drawer__social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: #fff;
    touch-action: manipulation;
    transition: opacity 0.12s ease;
  }

  .mobile-drawer__social:active {
    opacity: 0.68;
  }

  .mobile-drawer__social svg {
    width: 26px;
    height: 26px;
  }

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

  /* ---------- Global mobile header: hide duplicate page logos ---------- */
  .header__logo,
  .onama-header__logo,
  .oglas-card__logo {
    display: none !important;
  }

  body[data-page="oglas"] .oglas-card {
    border: 1px solid rgba(232, 114, 58, 0.45);
    border-radius: 14px;
    padding: 12px 10px;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  body[data-page="oglas"] .oglas-card__top {
    justify-content: center;
    margin-bottom: 12px;
  }

  body[data-page="oglas"] .oglas-card__actions {
    justify-content: center;
    width: 100%;
    gap: clamp(16px, 5vw, 22px);
  }

  /* ---------- Oglas detail mobile layout ---------- */
  body[data-page="oglas"] .oglas-layout {
    gap: 0;
  }

  body[data-page="oglas"] .oglas-side {
    gap: 0;
    align-items: stretch;
    padding: clamp(12px, 3.5vw, 16px);
    padding-bottom: 0;
    box-sizing: border-box;
  }

  body[data-page="oglas"] .oglas-hero__photo {
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: 1;
    margin: 0;
  }

  body[data-page="oglas"] .oglas-right {
    gap: 20px;
  }

  body[data-page="oglas"] .oglas-main {
    gap: 20px;
  }

  body[data-page="oglas"] .oglas-hero__body {
    display: flex;
    flex-direction: column;
  }

  body[data-page="oglas"] .oglas-hero__time {
    padding: 6px clamp(12px, 3.5vw, 16px) 0;
    margin: 0;
  }

  body[data-page="oglas"] .oglas-hero__title {
    margin-top: 16px;
    margin-bottom: 12px;
  }

  body[data-page="oglas"] .oglas-hero__description {
    font-size: clamp(16px, 4.2vw, 17px);
    line-height: 1.58;
  }

  body[data-page="oglas"] .oglas-hero__toggle {
    position: static;
    align-self: center;
    margin: 10px auto 4px;
    min-width: 40px;
    min-height: 40px;
  }

  .onama-header {
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 12px 0 10px;
  }

  .onama-header .glavni-naslov {
    margin: 0;
  }

  /* ---------- Mobile POSTAVI CTA (homepage style, all pages except postavi) ---------- */
  .header__cta,
  .header .glavno-dugme,
  .header__inner--oglasi .header__cta,
  .header__inner--oglasi .glavno-dugme {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    transform: none !important;
    min-height: 0;
    padding: 10px 20px;
    gap: 6px;
    font-family: "Oswald", sans-serif;
    font-size: clamp(13px, 3.65vw, 15px);
    font-weight: 500;
    letter-spacing: clamp(0.35px, 0.12vw, 0.55px);
    line-height: 1.15;
    border-radius: 7px;
    box-shadow: 0 4px 14px rgba(232, 114, 58, 0.3);
  }

  .header__cta:active,
  .header .glavno-dugme:active,
  .header__inner--oglasi .header__cta:active,
  .header__inner--oglasi .glavno-dugme:active {
    transform: translateY(1px) !important;
    box-shadow: 0 3px 10px rgba(232, 114, 58, 0.28);
    opacity: 0.92;
  }

  .header__cta .btn__plus,
  .header .glavno-dugme .btn__plus,
  .header__inner--oglasi .header__cta .btn__plus,
  .header__inner--oglasi .glavno-dugme .btn__plus {
    font-size: clamp(14px, 3.8vw, 16px);
  }

  body[data-page="postavi"] .header__cta,
  body[data-page="postavi"] .glavno-dugme {
    display: none !important;
  }

  /* ---------- Landing / home ---------- */
  body[data-page="landing"] .header {
    background: transparent;
  }

  body[data-page="landing"] .header__inner {
    padding-top: 10px;
    padding-bottom: 10px;
    justify-content: center;
    align-items: stretch;
  }

  .ads-panel,
  .ads-panel--results,
  .ads-panel--search {
    width: auto;
    max-width: none;
    margin-left: var(--mobile-page-gutter);
    margin-right: var(--mobile-page-gutter);
  }

  body[data-page="landing"] .ads-panel,
  body[data-page="oglasi"] .ads-panel--results,
  body[data-page="rezultati"] .ads-panel--search {
    padding: 12px 10px;
    border-radius: 14px;
    background-color: var(--color-card);
    border: 1px solid rgba(232, 114, 58, 0.45);
  }

  body[data-page="landing"] .ads-panel {
    margin-top: 18px;
  }

  body[data-page="oglasi"] .ads-panel--results,
  body[data-page="rezultati"] .ads-panel--search {
    margin-top: 12px;
    /* Match landing panel width: page-container padding is the sole horizontal inset */
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
  }

  body[data-page="landing"] .ads-panel__inner,
  body[data-page="oglasi"] .ads-panel--results .ads-panel__inner,
  body[data-page="rezultati"] .ads-panel--search .ads-panel__inner {
    padding: 4px 4px 12px;
    background: transparent;
  }

  body[data-page="landing"] .ads-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(7px, 2.1vw, 11px);
    margin-bottom: 11px;
  }

  body[data-page="landing"] .ads-panel__title {
    font-family: "Antonio", sans-serif;
    font-size: clamp(22px, 5.5vw, 26px);
    font-weight: 300;
    letter-spacing: clamp(0.4px, 0.15vw, 0.8px);
    line-height: 1.06;
    color: var(--color-title-page);
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
  }

  body[data-page="landing"] .ads-panel__show-all {
    margin-top: 0;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 18px;
    font-size: clamp(13px, 3.3vw, 14px);
    line-height: 1.15;
    border-radius: 7px;
    box-shadow: 0 3px 10px rgba(232, 114, 58, 0.25);
    transition: transform 0.1s ease, opacity 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
  }

  body[data-page="landing"] .ads-panel__show-all:active {
    transform: translateY(1px);
    opacity: 0.92;
    box-shadow: 0 2px 8px rgba(232, 114, 58, 0.22);
  }

  body[data-page="landing"] .ads-panel__footer {
    display: flex;
    justify-content: center;
    padding-top: 18px;
    padding-bottom: 2px;
  }

  /* ---------- Oglasi / rezultati page mobile header ---------- */
  body[data-page="oglasi"] .header__inner--oglasi,
  body[data-page="rezultati"] .header__inner--oglasi {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding-top: 10px;
  }

  body[data-page="oglasi"] .header__left,
  body[data-page="rezultati"] .header__left {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  body[data-page="oglasi"] .header__right,
  body[data-page="rezultati"] .header__right {
    align-items: flex-start;
    text-align: left;
  }

  body[data-page="oglasi"] .glavni-naslov,
  body[data-page="rezultati"] .glavni-naslov {
    font-size: clamp(20px, 5.4vw, 24px);
    line-height: 1.05;
    margin-bottom: 0;
  }

  /* Oglasi: title block → filter bar → results stack */
  body[data-page="oglasi"] .page-counter {
    margin-top: 3px;
    margin-bottom: 8px;
  }

  /* Rezultati: tighten title → result count spacing */
  body[data-page="rezultati"] .page-counter {
    margin-top: 4px;
    margin-bottom: 6px;
  }

  body[data-page="oglasi"] .main > .header + .page-container > .filters-mobile-bar {
    margin-top: 12px;
    margin-bottom: 12px;
  }

  /* ---------- Oglasi mobile filter toggle (reuses #filtersForm) ---------- */
  body[data-page="oglasi"] .filters-mobile__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    margin: 0;
    border: none;
    border-radius: 14px;
    background-color: var(--color-myblue);
    color: #fff;
    font-family: "Oswald", sans-serif;
    font-size: clamp(17px, 4.6vw, 20px);
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.1;
    text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 6px 20px -10px rgba(40, 86, 121, 0.5);
    transition: background-color 0.15s ease, transform 0.08s ease;
  }

  body[data-page="oglasi"] .filters-mobile__toggle:active {
    transform: translateY(1px);
    opacity: 0.92;
  }

  body[data-page="oglasi"] .filters-mobile__toggle.is-active {
    background-color: #234a66;
  }

  body[data-page="oglasi"] .filters-mobile__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
  }

  body[data-page="oglasi"] .filters-mobile__label {
    flex: 1 1 auto;
    text-align: center;
  }

  body[data-page="oglasi"] .filters-mobile__badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background-color: var(--color-orange);
    color: #fff;
    font-family: "PT Sans", sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
  }

  body[data-page="oglasi"] .filters-mobile__badge[hidden] {
    display: none;
  }

  /* Collapsed by default on mobile; same #filtersForm as desktop */
  body[data-page="oglasi"] #filtersForm.filters {
    display: none;
    margin: 0;
    width: 100%;
    max-width: none;
    box-shadow: none;
  }

  body[data-page="oglasi"] #filtersForm.filters.is-mobile-open {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 14px 16px;
    border-radius: 14px;
    overflow: visible;
    animation: filtersMobilePanelIn 0.22s ease-out;
  }

  body[data-page="oglasi"] #filtersForm.filters.is-mobile-open .filters__field {
    overflow: visible;
  }

  body[data-page="oglasi"] #filtersForm.filters .filters__field--action {
    grid-column: 1 / -1;
  }

  body[data-page="oglasi"] #filtersForm.filters .filters__submit {
    width: 100%;
    min-height: 48px;
    height: auto;
    padding: 12px 16px;
    font-size: clamp(16px, 4.2vw, 18px);
    letter-spacing: 1.5px;
    border-radius: 10px;
    transition: transform 0.1s ease, opacity 0.12s ease, background-color 0.15s ease;
  }

  body[data-page="oglasi"] #filtersForm.filters .filters__submit:active {
    transform: translateY(1px);
    opacity: 0.92;
  }

  body[data-page="oglasi"] #filtersForm.filters .filters__select,
  body[data-page="oglasi"] #filtersForm.filters .filters__input {
    min-height: 44px;
    height: auto;
    font-size: 16px;
  }

  body[data-page="oglasi"] #filtersForm.filters .filters__select-wrap {
    overflow: visible;
  }

  /* ---------- Oglasi mobile pagination (touch-friendly, aligned with ads panel) ---------- */
  body[data-page="oglasi"] .pagination {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 12px 6px;
    width: 100%;
    max-width: 100%;
    margin: 16px 0 20px;
    padding: 14px 12px 12px;
    box-sizing: border-box;
    border-radius: 14px;
    overflow-x: clip;
    background: linear-gradient(180deg, #2f6288 0%, var(--color-myblue) 55%, #244a66 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 22px -14px rgba(20, 28, 35, 0.45);
    color: #fff;
    font-family: "PT Sans", sans-serif;
  }

  body[data-page="oglasi"] .pagination__nav {
    display: contents;
  }

  body[data-page="oglasi"] .pagination__sep {
    display: none;
  }

  body[data-page="oglasi"] #prevPage {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    max-width: 46vw;
  }

  body[data-page="oglasi"] .pagination__pages {
    grid-column: 2;
    grid-row: 1;
    justify-content: center;
    justify-self: center;
    flex-wrap: wrap;
    gap: clamp(2px, 0.9vw, 4px);
    min-width: 0;
    max-width: min(100%, 52vw);
    padding: 5px 6px;
    border-radius: 10px;
    background: rgba(12, 20, 28, 0.22);
    font-size: clamp(13px, 3.5vw, 15px);
    line-height: 1;
  }

  body[data-page="oglasi"] #nextPage {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    max-width: 46vw;
  }

  body[data-page="oglasi"] .pagination__goto {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    justify-self: stretch;
    gap: clamp(8px, 2.2vw, 10px);
    font-size: clamp(12px, 3.3vw, 13px);
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.9);
  }

  body[data-page="oglasi"] .pagination__goto label {
    opacity: 0.92;
  }

  body[data-page="oglasi"] .pagination__goto-control {
    display: inline-flex;
    align-items: center;
    gap: clamp(6px, 1.8vw, 8px);
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: 3px;
    border-radius: 10px;
    background: rgba(12, 20, 28, 0.18);
  }

  body[data-page="oglasi"] .pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 6px;
    border-radius: 0;
    border: 0;
    background: transparent;
    font-family: "PT Sans", sans-serif;
    font-size: clamp(12px, 3.2vw, 13px);
    font-weight: 600;
    letter-spacing: 0.15px;
    line-height: 1.2;
    text-transform: none;
    white-space: nowrap;
    text-align: center;
    color: #fff;
    gap: clamp(5px, 1.6vw, 7px);
    touch-action: manipulation;
    transition: color 0.15s ease, opacity 0.12s ease;
  }

  body[data-page="oglasi"] #prevPage,
  body[data-page="oglasi"] #nextPage {
    font-size: 0;
    line-height: 0;
  }

  body[data-page="oglasi"] #prevPage::before,
  body[data-page="oglasi"] #prevPage::after,
  body[data-page="oglasi"] #nextPage::before,
  body[data-page="oglasi"] #nextPage::after {
    font-size: clamp(12px, 3.2vw, 13px);
    line-height: 1.2;
    color: #fff;
  }

  body[data-page="oglasi"] #prevPage::before {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: currentColor;
  }

  body[data-page="oglasi"] #prevPage::after {
    content: "Prethodna";
  }

  body[data-page="oglasi"] #nextPage::before {
    content: "Sledeća";
  }

  body[data-page="oglasi"] #nextPage::after {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: currentColor;
  }

  body[data-page="oglasi"] #prevPage::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  body[data-page="oglasi"] #nextPage::after {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  body[data-page="oglasi"] .pagination__link:active,
  body[data-page="oglasi"] #prevPage:active,
  body[data-page="oglasi"] #nextPage:active {
    background: transparent;
    border-color: transparent;
    transform: none;
    opacity: 0.78;
  }

  body[data-page="oglasi"] #prevPage:focus-visible,
  body[data-page="oglasi"] #nextPage:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
    border-radius: 6px;
  }

  body[data-page="oglasi"] .pagination__pages li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(32px, 8.2vw, 36px);
    min-height: 36px;
    padding: 2px 4px;
    border-radius: 8px;
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
    touch-action: manipulation;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  }

  body[data-page="oglasi"] .pagination__pages li:not(.pagination__ellipsis):not(.is-active):active {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
  }

  body[data-page="oglasi"] .pagination__pages li.is-active {
    background-color: var(--color-orange);
    color: #fff;
    box-shadow: 0 2px 10px rgba(232, 114, 58, 0.42);
    font-weight: 700;
  }

  body[data-page="oglasi"] .pagination__pages li.pagination__ellipsis {
    min-width: 0;
    min-height: 0;
    padding: 0 clamp(1px, 0.5vw, 3px);
    font-size: clamp(11px, 3vw, 13px);
    color: rgba(255, 255, 255, 0.42);
    font-weight: 500;
  }

  body[data-page="oglasi"] .pagination__goto input {
    width: clamp(52px, 14vw, 64px);
    min-height: 44px;
    height: 44px;
    padding: 0 clamp(8px, 2.2vw, 10px);
    font-size: clamp(15px, 4vw, 16px);
    font-weight: 700;
    border: 0;
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: inset 0 1px 2px rgba(31, 42, 68, 0.1);
  }

  body[data-page="oglasi"] .pagination__goto-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: var(--color-orange);
    color: #fff;
    flex-shrink: 0;
    touch-action: manipulation;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(232, 114, 58, 0.35);
    transition: background-color 0.15s ease, transform 0.08s ease;
  }

  body[data-page="oglasi"] .pagination__goto-submit svg {
    width: 18px;
    height: 18px;
  }

  body[data-page="oglasi"] .pagination__goto-submit:active {
    background: var(--color-orange-hover);
    transform: translateY(1px);
  }

  body[data-page="oglasi"] .pagination__goto-submit:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }

  @keyframes filtersMobilePanelIn {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* ---------- Ad card mobile layout (mockup) ---------- */
  .ad {
    display: grid;
    grid-template-columns: minmax(0, clamp(76px, calc(18vw + 2px), 98px)) minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: clamp(10px, 3vw, 12px);
    row-gap: clamp(8px, 2.5vw, 10px);
    align-items: start;
    padding: 5px 0;
    border-bottom: 1px solid rgba(31, 42, 68, 0.1);
  }

  .ad:last-child {
    border-bottom: none;
  }

  .ad__body {
    display: contents;
  }

  .ad__title {
    grid-column: 1 / -1;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    font-family: "PT Sans", sans-serif;
    font-size: clamp(15px, calc(3.7vw + 2px), 17px);
    font-weight: 600;
    line-height: 1.28;
    margin-bottom: 0;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  a.ad__title {
    transition: opacity 0.12s ease, color 0.15s ease;
  }

  a.ad__title:active {
    opacity: 0.72;
  }

  .ad__avatar {
    grid-row: 2;
    grid-column: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(232, 114, 58, 0.18);
  }

  .ad__tags {
    grid-row: 2;
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(3px, 1vw, 5px);
    min-width: 0;
  }

  .ad__meta--left,
  .ad__meta--right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(3px, 1vw, 5px);
    width: 100%;
  }

  .ad__meta--right {
    grid-template-columns: none;
    margin-right: 0;
    justify-content: flex-start;
  }

  .ad__col {
    width: 100%;
  }

  .ad__col--instrument {
    transform: none;
  }

  .ad__action {
    display: none;
  }

  .ad__chip {
    font-size: clamp(13px, calc(3.1vw + 2px), 14px);
    line-height: 1.2;
    max-width: 100%;
  }

  .ad__chip-plus .ad__tooltip {
    max-width: min(260px, calc(100vw - (var(--mobile-page-gutter) * 2) - 24px));
  }

  .ad__chip-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .ad__chip-plus {
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    font-size: 10px;
    margin-left: 4px;
    touch-action: manipulation;
    background-color: var(--color-badge);
    transition: transform 0.1s ease, background-color 0.12s ease, opacity 0.12s ease;
  }

  .ad__chip-plus:active {
    transform: scale(0.94);
    opacity: 0.9;
  }

  .ad__chip-plus:hover:not(.is-open),
  .ad__chip-plus:focus:not(.is-open) {
    background-color: var(--color-badge);
  }

  .ad__chip-plus:hover .ad__tooltip,
  .ad__chip-plus:focus:not(.is-open) .ad__tooltip {
    opacity: 0;
    transform: translate(-50%, 4px);
  }

  .ad__chip-plus.is-open,
  .ad__chip-plus.is-open:focus {
    background-color: var(--color-orange);
  }

  .ad__chip-plus.is-open .ad__tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  /* ---------- Footer mobile ---------- */
  .footer {
    padding: 10px 0 9px;
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }

  .footer.footer--scroll-hidden {
    transform: translate3d(0, 100%, 0);
  }

  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 6px;
    padding-left: var(--mobile-page-gutter);
    padding-right: var(--mobile-page-gutter);
  }

  .footer__version,
  .footer__social {
    display: none;
  }

  .footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    row-gap: 2px;
    max-width: 340px;
    margin: 0 auto;
    font-size: clamp(11px, 3.1vw, 13px);
    line-height: 1.45;
  }

  .footer__links li {
    display: inline;
  }

  .footer__links a {
    transition: opacity 0.12s ease;
  }

  .footer__links a:active {
    opacity: 0.68;
  }

  .footer__sep {
    display: inline;
    opacity: 0.45;
    margin: 0 clamp(5px, 1.6vw, 7px);
  }

  .footer__copy {
    margin-top: 5px;
    font-size: clamp(10px, 2.8vw, 11px);
    opacity: 0.72;
  }

  /* ---------- Mobile tap highlight (remove default blue touch flash) ---------- */
  a,
  button,
  .btn,
  .header__cta,
  .glavno-dugme,
  .mobile-header__toggle,
  .mobile-drawer__link,
  .mobile-drawer__cta,
  .mobile-drawer__search-submit,
  .mobile-drawer__secondary-link,
  .mobile-drawer__social,
  .filters-mobile__toggle,
  .filters__submit,
  .pagination__link,
  body[data-page="oglasi"] .pagination__pages li,
  body[data-page="oglasi"] .pagination__goto-submit,
  .ad__chip-plus,
  .ads-panel__show-all,
  .footer__links a {
    -webkit-tap-highlight-color: transparent;
  }

  /* ---------- Mobile tap pressed feedback (site-wide buttons) ---------- */
  .btn:active {
    opacity: 0.92;
  }

  /* ---------- Touch targets ---------- */
  .btn,
  .topnav__link,
  .pagination__link,
  body[data-page="oglasi"] .pagination__pages li,
  body[data-page="oglasi"] .pagination__goto-submit,
  .filters__submit,
  body[data-page="oglasi"] .filters-mobile__toggle {
    touch-action: manipulation;
  }

  .header {
    background-color: transparent;
  }
}

@media (max-width: 360px) {
  :root {
    --mobile-page-gutter: 12px;
  }

  body[data-page="landing"] .ads-panel__title {
    letter-spacing: 0.35px;
  }
}

@media (min-width: 721px) {
  .mobile-header,
  .mobile-drawer,
  .kabl-ambient {
    display: none !important;
  }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .mobile-drawer__panel,
  .mobile-drawer__backdrop {
    transition: none;
  }

  .mobile-drawer__panel.is-dragging {
    transition: none;
  }

  .mobile-drawer__backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(20, 28, 35, 0.45);
  }

  .footer {
    transition: none;
  }

  .kabl-ambient {
    transition: none;
  }

  .kabl-ambient__edge {
    animation: none !important;
  }

  body[data-page="oglasi"] #filtersForm.filters.is-mobile-open {
    animation: none;
  }

  .mobile-header__toggle:active,
  .mobile-drawer__search-submit:active,
  .mobile-drawer__cta:active,
  .ad__chip-plus:active,
  body[data-page="landing"] .ads-panel__show-all:active,
  body[data-page="oglasi"] #filtersForm.filters .filters__submit:active,
  body[data-page="oglasi"] .filters-mobile__toggle:active,
  .header__cta:active,
  .header .glavno-dugme:active,
  .header__inner--oglasi .header__cta:active,
  .header__inner--oglasi .glavno-dugme:active {
    transform: none;
  }

  .header__cta:active,
  .header .glavno-dugme:active,
  .header__inner--oglasi .header__cta:active,
  .header__inner--oglasi .glavno-dugme:active {
    transform: none !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ambient-neon-warm: 255, 118, 38;
    --ambient-neon-brand: 255, 128, 48;
    --ambient-neon-hot: 0.96;
    --ambient-neon-mid: 0.78;
    --ambient-neon-soft: 0.46;
    --ambient-neon-spill: 0.2;
  }
}

[data-theme="dark"] {
  --ambient-neon-warm: 255, 118, 38;
  --ambient-neon-brand: 255, 128, 48;
  --ambient-neon-hot: 0.96;
  --ambient-neon-mid: 0.78;
  --ambient-neon-soft: 0.46;
  --ambient-neon-spill: 0.2;
}

/* Desktop: hide mobile filter toggle; keep inline #filtersForm visible */
@media (min-width: 721px) {
  .filters-mobile-bar {
    display: none !important;
  }

  body[data-page="oglasi"] #filtersForm.filters {
    display: grid !important;
  }
}
