/* BulgariaRest — mobile pass. Loaded last; every rule is phone-only (<=768px),
   so desktop stays exactly as app.css + signboard.css draw it. */

@media (max-width: 768px) {
  :root { --bn-h: calc(64px + env(safe-area-inset-bottom)); }

  html { scroll-padding-top: 72px; }
  body { padding-bottom: calc(var(--bn-h) + 12px); overscroll-behavior-y: none; }
  .container, .container-narrow { padding-left: 16px; padding-right: 16px; }

  /* Controls: 16px stops iOS from zooming the page on focus; 48px is a real tap target. */
  input[type="number"], input[type="text"], input[type="email"], input[type="tel"],
  input[type="password"], input[type="search"], input[type="url"], input[type="date"],
  select, textarea { font-size: 16px; min-height: 48px; }
  /* Page-level <style> blocks (dashboard, claim) set 15px with equal weight and load later. */
  main input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]), main select, main textarea { font-size: 16px !important; }
  textarea { min-height: 112px; }
  .btn { min-height: 48px; }
  .btn.btn-sm { min-height: 40px; }

  /* Header: slimmer, language switch never wraps */
  .site-header .inner { height: 56px; }
  .brand { font-size: 24px; }
  .header-right { gap: 8px; }
  .lang-switch { font-size: 13px; gap: 2px; }
  .lang-switch .lang-opt { padding: 8px 5px; }
  .lang-more summary { padding: 8px 10px; }
  .lang-more-list .lang-opt { padding: 12px 10px; }
  #import-url { font-size: 16px; }
  .site-header::after { height: 8px; }

  /* Eurovision strip: one slim line */
  .ev-strip-inner { min-height: 40px; }
  .ev-strip-x { width: 44px; height: 44px; margin-right: -12px; }

  /* Bottom nav: bigger targets, active tab marked, blurred plank */
  .bottom-nav { padding: 6px 0 max(6px, env(safe-area-inset-bottom)); box-shadow: 0 -6px 18px rgba(16,41,58,.18); }
  .bottom-nav a { min-height: 52px; justify-content: center; position: relative; -webkit-tap-highlight-color: transparent; }
  .bottom-nav a.active::before { content: ""; position: absolute; top: -6px; left: 28%; right: 28%; height: 3px; background: var(--marigold); border-radius: 0 0 3px 3px; }
  .bottom-nav a:active svg { transform: scale(.9); }
  .bottom-nav a svg { transition: transform .12s ease; }

  /* Home hero: compact board, search laid out in two columns */
  .hero { padding-top: 16px; }
  .sign-board { border-width: 5px; padding: 20px 16px 20px; }
  .bolt { width: 9px; height: 9px; }
  .bolt.tl, .bolt.tr { top: 8px; } .bolt.bl, .bolt.br { bottom: 8px; }
  .bolt.tl, .bolt.bl { left: 8px; } .bolt.tr, .bolt.br { right: 8px; }
  .hero .hero-sub { margin: 16px auto 16px; font-size: 15px; }

  .search-bar { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; text-align: left; }
  .search-bar .field { padding: 0; background: none !important; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .search-bar .field:first-child { grid-column: 1 / -1; }
  .search-bar .field + .field { border: 0; }
  .search-bar .field span { font-size: 15px; }
  .search-bar select, .search-bar input { background-color: #fff; border: 1.5px solid #C9C4AE; border-radius: 3px; box-shadow: none; width: 100%; height: 48px; padding: 0 12px; }
  .search-bar select { padding-right: 34px; }
  .search-bar .submit-wrap { grid-column: 1 / -1; padding: 4px 0 0; }
  .search-bar button { height: 52px; }
  .hero-stats { font-size: 17px; margin-top: 12px; }

  /* Category chips: edge-to-edge scroller with snap */
  .categories { margin: 18px 0 6px; scroll-snap-type: x proximity; }
  .cat-strip { padding: 4px 16px; }
  .cat { scroll-snap-align: start; }

  /* Cards on lists: calmer photo ratio so two fit on a screen */
  .p-card .imgwrap { aspect-ratio: 16/10; }
  .p-card .body { padding: 12px 14px; }
  .p-card .heart { width: 44px; height: 44px; }
  .grid { gap: 22px 16px; }

  /* Stay page: photo first, edge to edge; facts as a swipeable row */
  .stay-page { display: flex; flex-direction: column; }
  .stay-page > * { order: 2; min-width: 0; max-width: 100%; }
  .stay-body { grid-template-columns: minmax(0, 1fr); }
  .stay-body > * { min-width: 0; }
  .stay-page > .gallery-wrap, .stay-page > .gallery { order: 0; margin-left: -16px; margin-right: -16px; border-radius: 0; max-width: none; width: calc(100% + 32px); }
  .stay-page > .stay-head { order: 1; padding-top: 16px; }
  .stay-page > .stay-body { order: 3; padding-top: 20px; }
  .stay-page > hr, .stay-page > section { order: 4; }
  .stay-head h1 { font-size: 30px; }
  .quick-facts { flex-wrap: nowrap !important; overflow-x: auto; margin: 14px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .quick-facts::-webkit-scrollbar { display: none; }
  .quick-facts .qf { flex: none; white-space: nowrap; scroll-snap-align: start; }
  /* Owner-claim board: the three steps are noise on a phone */
  .stay-page > div[style*="var(--enamel)"] { padding: 16px !important; }
  .stay-page > div[style*="var(--enamel)"] > div[style*="flex-wrap:wrap"] { display: none !important; }
  .stay-page > div[style*="var(--enamel)"] > div:first-child { font-size: 26px !important; }
  .stay-page > div[style*="var(--enamel)"] > a { display: flex !important; justify-content: center; width: 100%; }

  /* Sticky contact bar above the bottom nav */
  .stay-cta { position: fixed; left: 0; right: 0; bottom: var(--bn-h); z-index: 90; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--chalk); border-top: 2px solid var(--enamel); box-shadow: 0 -8px 20px rgba(16,41,58,.15); }
  .stay-cta .price { flex: none; line-height: 1.1; font-size: 13px; color: var(--ink-soft); }
  .stay-cta .price b { display: block; font-family: var(--f-sign); font-size: 24px; color: var(--ink); letter-spacing: .02em; }
  .stay-cta .btn { flex: 1; padding: 10px 12px; font-size: 19px; white-space: nowrap; }
  .stay-cta .btn.btn-ghost { flex: 1; background: #fff; }
  body.has-stay-cta { padding-bottom: calc(var(--bn-h) + 84px); }

  /* Forms and dashboards */
  .form-grid { gap: 14px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .booking-panel { padding: 18px; }
  .policy table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .policy { overflow-wrap: anywhere; }
}

@media (min-width: 769px) { .stay-cta { display: none; } }

@media (max-width: 360px) {
  .brand { font-size: 21px; }
  .site-header .inner { gap: 8px; }
  .brand-map { width: 20px; margin-right: 4px; }
  .lang-switch .lang-opt { padding: 8px 3px; }
  .lang-switch .lang-sep { display: none; }
  .search-bar { grid-template-columns: 1fr; }
  .stay-cta .price { display: none; }
}

@media (max-width: 768px) {
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; flex: none; accent-color: var(--enamel); }
  label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { min-height: 44px; display: flex; align-items: center; gap: 10px; }
}

/* Admin: the side menu becomes a swipeable tab row; wide tables scroll inside their box. */
@media (max-width: 799px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px; }
  .admin-shell > * { min-width: 0; }
  .admin-side { display: flex; gap: 6px; overflow-x: auto; padding: 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; position: sticky; top: 56px; z-index: 40; }
  .admin-side::-webkit-scrollbar { display: none; }
  .admin-side a { flex: none; white-space: nowrap; padding: 12px 14px; padding-left: 14px !important; }
  .admin-side .pill { position: static; transform: none; margin-left: 6px; display: inline-block; }
  .admin-side form { flex: none; margin: 0 !important; }
  .admin-side form .btn { width: auto !important; min-height: 44px; }
  .filter-bar select, .filter-bar input { flex: 1 1 140px; }
  .admin-actions { justify-content: flex-start; }
}

/* Leaflet panes and controls use z-index up to 1000; keep them inside the map so they never paint over the sticky bars. */
.leaflet-container { isolation: isolate; z-index: 0; }
