/* ── GruzPotok Mobile Shell ─────────────────────────────────────────────────
   All selectors scoped to body.gp-mobile — desktop never affected.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Bottom nav ─────────────────────────────────────────────────────────── */

#gp-mobile-nav {
  display: none;
}

body.gp-mobile #gp-mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}

body.gp-mobile .gp-mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  min-height: 62px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  transition: color 0.2s ease, transform 0.12s ease;
}

body.gp-mobile .gp-mobile-nav-btn::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 52px;
  height: 30px;
  border-radius: 15px;
  background: #eff6ff;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
}

body.gp-mobile .gp-mobile-nav-btn.active::before {
  transform: translateX(-50%) scaleX(1);
}

body.gp-mobile .gp-mobile-nav-btn:active {
  transform: scale(0.9);
}

body.gp-mobile .gp-mobile-nav-btn.active {
  color: #2563eb;
}

body.gp-mobile .gp-mobile-nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

body.gp-mobile .gp-mobile-nav-icon svg {
  width: 22px;
  height: 22px;
}

body.gp-mobile .gp-mobile-nav-btn.active .gp-mobile-nav-icon svg {
  stroke: #2563eb;
}

body.gp-mobile .gp-mobile-nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  position: relative;
  z-index: 1;
}

body.gp-mobile .gp-mobile-nav-btn.active .gp-mobile-nav-label {
  font-weight: 600;
}

/* ── Mobile topbar ───────────────────────────────────────────────────────── */

#gp-mobile-topbar {
  display: none;
}

body.gp-mobile #gp-mobile-topbar {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8500;
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

body.gp-mobile #gp-mobile-topbar-title {
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  flex: 1;
}

body.gp-mobile #gp-mobile-topbar-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
}

body.gp-mobile #gp-mobile-topbar-logo svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

body.gp-mobile #gp-mobile-topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

body.gp-mobile .gp-topbar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: #6b7280;
  cursor: pointer;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

body.gp-mobile .gp-topbar-action:active {
  background: #f3f4f6;
}

body.gp-mobile .gp-topbar-action svg {
  width: 20px;
  height: 20px;
}

/* ── Hide desktop elements ──────────────────────────────────────────────── */

body.gp-mobile header.site-header {
  display: none !important;
}

body.gp-mobile #mobileQuickActions {
  display: none !important;
}

body.gp-mobile #global-guest-bar {
  display: none !important;
}

body.gp-mobile #hamburgerBtn {
  display: none !important;
}

body.gp-mobile #mobileDrawer,
body.gp-mobile #mobileDrawerOverlay {
  display: none !important;
}

/* ── Page content: spacing for topbar + bottom nav ───────────────────────── */

body.gp-mobile .page-content {
  padding-top: calc(52px + env(safe-area-inset-top, 0px)) !important;
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ── Loads: show mobile card layout above 767px too ─────────────────────── */

body.gp-mobile #loadsTableViewport {
  display: none !important;
}

body.gp-mobile #loadsMobileViewport {
  display: block !important;
}

/* ── Load cards: premium white card ─────────────────────────────────────── */

body.gp-mobile .loads-mobile-card {
  background: #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.04) !important;
  margin-bottom: 10px !important;
  border: 1px solid rgba(15,23,42,0.05) !important;
  transition: transform 0.12s ease !important;
  overflow: hidden !important;
}

body.gp-mobile .loads-mobile-card:active {
  transform: scale(0.985) !important;
}

/* ── Vehicle/truck cards: same premium style ─────────────────────────────── */

body.gp-mobile .gp-vehicle-card,
body.gp-mobile .vehicle-card,
body.gp-mobile .truck-card {
  background: #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.04) !important;
  border: 1px solid rgba(15,23,42,0.05) !important;
  margin-bottom: 10px !important;
  overflow: hidden !important;
}

/* ── Map page: fill exactly between topbar and bottom nav ───────────────── */

body.gp-mobile #page-map:not(.hidden) {
  position: fixed !important;
  top: 52px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 62px !important;
  height: auto !important;
  min-height: unset !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* AI search bar: hide on mobile */
body.gp-mobile .gp-map-ai-bar {
  display: none !important;
}

/* Filter chips: float above map */
body.gp-mobile .gp-map-chips {
  position: absolute !important;
  top: 8px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 20 !important;
  background: transparent !important;
  border: none !important;
  flex-shrink: 0;
  overflow-x: auto !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  flex-wrap: nowrap !important;
  padding: 0 12px !important;
  gap: 8px !important;
  display: flex !important;
}

body.gp-mobile .gp-map-chips::-webkit-scrollbar {
  display: none !important;
}

body.gp-mobile .gp-chip {
  flex-shrink: 0 !important;
  background: rgba(255,255,255,0.92) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1.5px solid rgba(255,255,255,0.4) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
  border-radius: 20px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 6px 14px !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  -webkit-tap-highlight-color: transparent !important;
  cursor: pointer !important;
}

body.gp-mobile .gp-chip.active {
  background: #2563eb !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(37,99,235,0.35) !important;
}

body.gp-mobile .gp-chip:active {
  transform: scale(0.94) !important;
}

/* Map wrap fills all space */
body.gp-mobile .gp-map-wrap {
  flex: 1 1 auto !important;
  position: relative !important;
  overflow: hidden !important;
  min-height: 0 !important;
}

/* Map canvas fills wrap */
body.gp-mobile #mapContainer,
body.gp-mobile #map,
body.gp-mobile #gpMap,
body.gp-mobile .gp-map-container {
  position: absolute !important;
  inset: 0 !important;
  height: 100% !important;
  width: 100% !important;
}

/* Route planner form: hidden on mobile */
body.gp-mobile #gpRoutePlannerForm {
  display: none !important;
}

/* Map toolbar: glass style */
body.gp-mobile .gp-map-toolbar {
  bottom: 8px !important;
  z-index: 910 !important;
  background: rgba(255,255,255,0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-radius: 28px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
  border: none !important;
}

/* Map online badge */
body.gp-mobile .gp-map-online {
  bottom: 52px !important;
  left: 10px !important;
}

/* Loads panel pill */
body.gp-mobile .gp-map-loads-panel {
  bottom: 8px !important;
}

/* ── Map FABs (injected by JS) ───────────────────────────────────────────── */

body.gp-mobile .gp-map-fabs {
  position: absolute !important;
  right: 12px !important;
  bottom: 16px !important;
  z-index: 200 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

body.gp-mobile .gp-map-fab {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,0.96) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: none !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.14) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  color: #374151 !important;
  -webkit-tap-highlight-color: transparent !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease !important;
}

body.gp-mobile .gp-map-fab:active {
  transform: scale(0.9) !important;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1) !important;
}

body.gp-mobile .gp-map-fab svg {
  width: 20px !important;
  height: 20px !important;
}

/* ── Bottom sheet: drag handle ───────────────────────────────────────────── */

body.gp-mobile #loadCardPanel {
  border-radius: 24px 24px 0 0 !important;
  box-shadow: 0 -8px 32px rgba(15,23,42,0.1) !important;
}

body.gp-mobile #gp-bs-handle {
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  margin: 10px auto 0;
  flex-shrink: 0;
}

/* ── Context tips: hide on mobile ────────────────────────────────────────── */

body.gp-mobile .gp-ctx-tip {
  display: none !important;
}

/* ── Deals table: horizontal scroll ─────────────────────────────────────── */

body.gp-mobile #dealsTableViewport {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

body.gp-mobile #dealsTableViewport table {
  min-width: 560px;
}

/* ── Cards: touch-friendly ───────────────────────────────────────────────── */

body.gp-mobile .load-row,
body.gp-mobile .truck-row,
body.gp-mobile tr.load-row td,
body.gp-mobile tr.truck-row td {
  min-height: 48px;
}

/* ── Scrollable tables: allow horizontal scroll on mobile ────────────────── */

body.gp-mobile .table-container,
body.gp-mobile .gp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Guest landing + public marketing sections: hide on mobile ───────────── */

body.gp-mobile #gtp-guest-banner,
body.gp-mobile .gpl-landing,
body.gp-mobile .gp-stats-grid,
body.gp-mobile .gp-hiw-section,
body.gp-mobile #gtp-stats-banner {
  display: none !important;
}

/* ── Trucks pagination: hide on mobile ───────────────────────────────────── */

body.gp-mobile #vehiclesPagination {
  display: none !important;
}

/* ── Footer: hide on mobile ──────────────────────────────────────────────── */

body.gp-mobile footer.px-4.pb-6.text-center {
  display: none !important;
}

/* ── Deals: empty state — collapse table, show card full-width ───────────── */

body.gp-mobile #dealsTableViewport:has(.minimal-empty-card) {
  overflow-x: hidden !important;
}

body.gp-mobile #dealsTableViewport:has(.minimal-empty-card) table {
  min-width: 0 !important;
  width: 100% !important;
}

body.gp-mobile #dealsTableViewport:has(.minimal-empty-card) thead {
  display: none !important;
}

body.gp-mobile #dealsTableViewport:has(.minimal-empty-card) td {
  display: block !important;
  width: 100% !important;
  padding: 16px !important;
}

/* ── Empty state cards: light theme ─────────────────────────────────────── */

body.gp-mobile .minimal-empty-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
}

body.gp-mobile .minimal-empty-icon {
  color: #6b7280 !important;
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

body.gp-mobile .minimal-empty-title {
  color: #0f172a !important;
}

body.gp-mobile .minimal-empty-text {
  color: #64748b !important;
}

body.gp-mobile .minimal-empty-button--secondary {
  color: #374151 !important;
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

/* ── Light theme ─────────────────────────────────────────────────────────── */

body.gp-mobile {
  background: #f1f5f9 !important;
}
