/**
 * Phone board = Next.js /app/dispo/utovari look.
 * WP functions stay (filteri, live lista, chat, BU, nalog).
 */

@media (max-width: 899px) {
  body.bu-app-page {
    background: linear-gradient(180deg, #dcefe4 0%, #eef6f1 28%, #f7faf8 55%) !important;
  }
  body.bu-app-page.bu-app-driver,
  body.bu-app-page .bu-appshell--driver {
    background: linear-gradient(180deg, #e8f4fc 0%, #f7fafc 40%) !important;
  }

  /* Next: no top chrome on phone — bottom nav + results bar */
  body.bu-app-page .bu-appshell-top {
    display: none !important;
  }
  body.bu-app-page .bu-appshell {
    padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px));
  }
  body.bu-app-page .bu-appshell-main,
  body.bu-app-page .bu-board-in-app {
    max-width: none;
    height: 100%;
    min-height: 0;
  }
  body.bu-app-page .bu-board-in-app {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 3.75rem - env(safe-area-inset-bottom, 0px));
  }

  /* Results bar */
  .bu-mobile-results {
    display: block !important;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 12;
    padding: 12px 12px 10px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e2e8f0;
    backdrop-filter: blur(12px);
  }
  .bu-mobile-results-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }
  .bu-mobile-results-count {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #0f172a;
  }
  .bu-mobile-results-sum {
    margin: 2px 0 0;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 52vw;
  }
  .bu-mobile-results-acts {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  body.bu-app-page .bu-filters-box,
  body.bu-board-page .bu-filters-box {
    order: 2;
  }
  body.bu-app-page .bu-board-bar,
  body.bu-board-page .bu-board-bar {
    display: flex;
    flex-direction: column;
  }
  body.bu-app-page #bu-filter-fold.open,
  body.bu-board-page #bu-filter-fold.open {
    margin: 0 12px 10px;
    padding: 12px !important;
    max-height: min(62vh, 520px) !important;
    overflow: auto !important;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }
  .bu-c-arrow {
    font-style: normal;
    font-weight: 400;
    color: #cbd5e1 !important;
    font-size: 18px;
    line-height: 1;
  }
  .bu-c-chev {
    position: absolute;
    top: 18px;
    right: 12px;
    font-size: 22px;
    font-weight: 300;
    color: #cbd5e1;
    line-height: 1;
  }
  .bu-mobile-detail-price {
    margin: 6px 0 0;
    font-size: 18px;
    font-weight: 900;
    color: #1d6fd8;
  }
  .bu-mobile-detail-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }
  .bu-mobile-detail-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0f172a !important;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none !important;
  }
  body.bu-app-page #bu-mobile-detail-sheet,
  body.bu-board-page #bu-mobile-detail-sheet {
    bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 24px 24px 0 0;
  }
  .bu-mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: #f59e0b;
    color: #451a03;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.28);
  }
  .bu-mobile-filter-btn:active { filter: brightness(0.95); }
  .bu-mobile-fleet-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 44px;
    min-width: 44px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid #bae6fd;
    background: #f0f9ff;
    color: #0c4a6e;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.01em;
  }
  body.bu-board-page .bu-feed .bu-c-route b,
  body.bu-app-page .bu-feed .bu-c-route b {
    max-width: min(38vw, 9.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    color: #166534;
  }
  body.bu-board-page .bu-feed .bu-c-route b.to,
  body.bu-app-page .bu-feed .bu-c-route b.to {
    color: #9b1c1c;
  }
  .bu-mobile-fleet-n {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #0284c7;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    line-height: 16px;
    text-align: center;
  }
  .bu-mobile-sorts {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .bu-mobile-sorts::-webkit-scrollbar { display: none; }
  .bu-mobile-sorts [data-sort] {
    flex-shrink: 0;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
  }
  .bu-mobile-sorts [data-sort].is-on {
    background: #0f172a;
    color: #fff;
  }
  .bu-mobile-reset {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    flex-shrink: 0;
  }

  /* Hide bulky desktop filter chrome; orange Filteri opens the fold */
  body.bu-board-page .bu-alert-bar,
  body.bu-app-page .bu-alert-bar,
  body.bu-board-page .bu-filter-bar,
  body.bu-app-page .bu-filter-bar,
  body.bu-board-page .bu-tabs-chrome,
  body.bu-app-page .bu-list-head,
  body.bu-app-page .bu-cols-head,
  body.bu-board-page .bu-cols-head {
    display: none !important;
  }
  body.bu-board-page .bu-guestbar { margin: 0 12px 8px; }

  /* Floating Lista / Mapa */
  body.bu-board-page .bu-switch,
  body.bu-app-page .bu-switch {
    position: fixed !important;
    left: 50%;
    bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 45;
    display: flex !important;
    grid-template-columns: none;
    width: auto;
    margin: 0;
    padding: 4px;
    gap: 4px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  }
  body.bu-board-page .bu-switch [data-view="dispo"],
  body.bu-app-page .bu-switch [data-view="dispo"] {
    display: none !important;
  }
  body.bu-board-page .bu-switch button,
  body.bu-app-page .bu-switch button {
    min-height: 36px;
    min-width: 76px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    background: transparent;
    color: #64748b;
  }
  body.bu-board-page .bu-switch button.is-on,
  body.bu-app-page .bu-switch button.is-on {
    background: #0f172a;
    color: #fff;
  }

  /* Cards like Next MobileListingCard */
  body.bu-board-page .bu-feed,
  body.bu-app-page .bu-feed {
    padding: 10px 0 calc(7.5rem + env(safe-area-inset-bottom, 0px)) !important;
    background: transparent !important;
  }
  body.bu-board-page .bu-feed .bu-item.bu-row.compact,
  body.bu-app-page .bu-feed .bu-item.bu-row.compact {
    display: block !important;
    width: calc(100% - 1.5rem) !important;
    margin: 0 12px 12px !important;
    padding: 16px !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
    grid-template-columns: none !important;
  }
  body.bu-board-page .bu-feed .bu-item.is-new:not(.is-seen),
  body.bu-app-page .bu-feed .bu-item.is-new:not(.is-seen) {
    box-shadow: inset 3px 0 0 0 #f59e0b, 0 4px 16px rgba(15, 23, 42, 0.06) !important;
  }
  body.bu-board-page .bu-feed .bu-c-route,
  body.bu-app-page .bu-feed .bu-c-route {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.3;
    color: #0f172a;
  }
  body.bu-board-page .bu-feed .bu-c-route,
  body.bu-app-page .bu-feed .bu-c-route {
    max-width: calc(100% - 88px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px !important;
    font-weight: 800;
    letter-spacing: -0.02em;
  }
  body.bu-board-page .bu-feed .bu-c-route b,
  body.bu-app-page .bu-feed .bu-c-route b { color: #166534; }
  body.bu-board-page .bu-feed .bu-fav-btn,
  body.bu-app-page .bu-feed .bu-fav-btn {
    display: none !important;
  }
  body.bu-board-page .bu-feed .bu-c-from,
  body.bu-board-page .bu-feed .bu-c-to,
  body.bu-app-page .bu-feed .bu-c-from,
  body.bu-app-page .bu-feed .bu-c-to {
    display: none !important;
  }
  body.bu-board-page .bu-feed .bu-c-veh,
  body.bu-board-page .bu-feed .bu-c-w,
  body.bu-app-page .bu-feed .bu-c-veh,
  body.bu-app-page .bu-feed .bu-c-w {
    display: inline-flex !important;
    margin: 10px 6px 0 0;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    font-size: 12px !important;
    font-weight: 800;
    color: #334155 !important;
    grid-column: auto !important;
  }
  body.bu-board-page .bu-feed .bu-c-date,
  body.bu-app-page .bu-feed .bu-c-date {
    display: block !important;
    margin-top: 8px;
    font-size: 11px !important;
    font-weight: 700;
    color: #64748b !important;
    grid-column: auto !important;
  }
  body.bu-board-page .bu-feed .bu-c-price,
  body.bu-app-page .bu-feed .bu-c-price {
    position: absolute;
    top: 16px;
    right: 36px;
    text-align: right !important;
    align-items: flex-end !important;
    grid-column: auto !important;
  }
  body.bu-board-page .bu-feed .bu-item,
  body.bu-app-page .bu-feed .bu-item { position: relative; }
  body.bu-board-page .bu-feed .bu-c-price strong,
  body.bu-app-page .bu-feed .bu-c-price strong {
    font-size: 17px !important;
    color: #1d6fd8 !important;
  }
  body.bu-board-page .bu-feed .bu-c-price::after,
  body.bu-app-page .bu-feed .bu-c-price::after {
    content: "cijena";
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
  }
  body.bu-board-page .bu-feed .bu-c-eurkm,
  body.bu-app-page .bu-feed .bu-c-eurkm,
  body.bu-board-page .bu-driver-card-cta,
  body.bu-app-page .bu-driver-card-cta {
    display: none !important;
  }
  .bu-tag-new {
    display: inline-flex;
    margin: 8px 6px 0 0;
    padding: 3px 8px;
    border-radius: 8px;
    background: #fef3c7;
    color: #78350f;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .bu-tag-ok {
    display: inline-flex;
    margin: 8px 0 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  /* FAB = green sparkle */
  body.bu-board-page .bu-mobile-fab-stack,
  body.bu-app-page .bu-mobile-fab-stack {
    right: 12px !important;
    bottom: calc(8.25rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.bu-app-page .bu-mobile-fab-chat { display: none !important; }
  .bu-mobile-fab-ai {
    width: 48px !important;
    height: 48px !important;
    border-radius: 999px !important;
    background: #16a34a !important;
    color: #fff !important;
    border: 0 !important;
    font-size: 20px !important;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.35) !important;
  }
  .bu-mobile-fab-pub { display: none !important; }

  /* Bottom nav with icons */
  body.bu-app-page .bu-appshell-nav {
    height: calc(3.75rem + env(safe-area-inset-bottom, 0px));
    padding: 4px 2px env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.98) !important;
  }
  body.bu-app-page .bu-appshell-nav-a,
  body.bu-app-page .bu-app-inbox-btn {
    flex-direction: column !important;
    gap: 2px;
    margin: 4px 2px !important;
    min-height: 0;
    padding: 4px 0;
    font-size: 10px !important;
    letter-spacing: 0.02em;
    background: transparent;
    border: 0;
    color: #64748b !important;
  }
  body.bu-app-page .bu-appshell-nav-a svg,
  body.bu-app-page .bu-app-inbox-btn svg {
    width: 21px;
    height: 21px;
    stroke: currentColor;
  }
  body.bu-app-page .bu-appshell-nav-a.is-on,
  body.bu-app-page .bu-appshell--dispo .bu-appshell-nav-a.is-on {
    background: #d1fae5 !important;
    color: #065f46 !important;
  }
  body.bu-app-page .bu-appshell--driver .bu-appshell-nav-a.is-on {
    background: #e0f2fe !important;
    color: #075985 !important;
  }
}

@media (min-width: 900px) {
  .bu-mobile-results { display: none !important; }
}
