/* WhereTooEat GUI fix round 4 (2026-10-27) — loaded LAST. Small, scoped overrides. */

/* ---------- 1. Tablet 769-1023: collapsible drawers, map stays visible ---------- */
@media (min-width: 769px) and (max-width: 1023px) {
  :root { --r4-bot: 80px; }

  .left-panel, .right-panel {
    position: fixed !important;
    top: var(--r4-top, 140px) !important;
    bottom: auto !important;
    max-height: calc(100dvh - var(--r4-top, 140px) - var(--r4-bot, 80px)) !important;
    height: calc(100dvh - var(--r4-top, 140px) - var(--r4-bot, 80px)) !important;
    width: min(320px, 44vw) !important;
    z-index: 60 !important;
    display: flex !important; flex-direction: column !important;
    overflow: hidden !important;
    transition: transform .25s ease, visibility .25s !important;
    visibility: hidden;
  }
  .left-panel { left: 0 !important; right: auto !important; transform: translateX(-105%); border-radius: 0 18px 18px 0 !important; }
  .right-panel { right: 0 !important; left: auto !important; transform: translateX(105%); border-radius: 18px 0 0 18px !important; height: auto !important; }
  .left-panel.open, .right-panel.open { transform: none; visibility: visible; }
  /* Atlas: list scrolls inside, Quick Filters pinned below it */
  #filterList { display: flex !important; flex-direction: column !important; flex: 1 1 auto !important; min-height: 0 !important; overflow: hidden !important; }
  #filterList .atlas-content { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; }
  #filterList .atlas-quick { flex: 0 0 auto !important; position: relative; z-index: 1; background: rgba(10,8,5,.96); border-top: 1px solid rgba(212,175,55,.25); }
  /* Directory: no forced empty area */
  .right-panel { overflow-y: auto !important; }
  .right-panel #feed:empty, .right-panel .mini-section:has(.dishes:empty) { display: none !important; }
  .r4-drawer-tab { display: grid !important; }
}
.r4-drawer-tab { display: none; position: fixed; z-index: 59; top: calc(var(--r4-top, 140px) + 12px); width: 30px; height: 96px; place-items: center;
  background: rgba(12,10,7,.88); color: #d4af37; border: 1px solid rgba(212,175,55,.55); font: 700 11px/1 Inter, sans-serif; letter-spacing: .08em;
  writing-mode: vertical-rl; cursor: pointer; padding: 0; }
.r4-drawer-tab--left { left: 0; border-left: 0; border-radius: 0 12px 12px 0; }
.r4-drawer-tab--right { right: 0; border-right: 0; border-radius: 12px 0 0 12px; }
.r4-drawer-tab:focus-visible { outline: 2px solid #d4af37; outline-offset: 2px; }
.r4-drawer-tab[aria-expanded="true"] { background: #d4af37; color: #0c0a07; }

@media (min-width: 901px) and (max-width: 1023px) { :root { --r4-bot: 16px !important; } }

/* ---------- 2/3. More (···) menu: portal to <body>, fixed under its button, above every strip ---------- */
#headerMoreMenu.r4-portal {
  position: fixed !important; z-index: 2000 !important; left: auto !important;
  min-width: 190px; max-width: calc(100vw - 16px);
  background: rgba(12, 10, 7, .96) !important; border: 1px solid rgba(212, 175, 55, .55) !important;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .6);
}
#headerMoreMenu.r4-portal .header-more-item { color: #f6ead0; }
#headerMoreMenu.r4-portal .header-more-item:hover,
#headerMoreMenu.r4-portal .header-more-item:focus-visible { background: rgba(212, 175, 55, .16); color: #fff; outline: 2px solid rgba(212, 175, 55, .7); outline-offset: -2px; }
#headerMoreBtn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#headerMoreBtn:focus-visible,
.header-more.is-open #headerMoreBtn {
  border-color: #d4af37 !important; box-shadow: 0 0 0 2px rgba(212, 175, 55, .55), 0 0 14px rgba(212, 175, 55, .35) !important; outline: none;
}

/* ---------- 4. Off-palette accents -> black & gold ---------- */
.nav-fav-btn .nav-fav-emoji, .nav-fav-btn .nav-fav-p { color: transparent !important; text-shadow: 0 0 0 #d4af37 !important; }
.nav-fav-btn .nav-fav-glow {
  background: radial-gradient(circle, rgba(212,175,55,.38) 0%, rgba(212,175,55,.10) 45%, transparent 70%) !important;
  box-shadow: 0 0 10px 2px rgba(212,175,55,.35) !important;
}
.nav-fav-btn { border-color: rgba(212,175,55,.55) !important; }
.nav-fav-count, .dock-fav-count, #liveNotifBadge, .live-notif-badge {
  background: #d4af37 !important; background-image: none !important; color: #0c0a07 !important;
  box-shadow: 0 0 0 1px rgba(12,10,7,.85), 0 0 8px rgba(212,175,55,.45) !important; font-weight: 800 !important;
}
/* LIVE badge on pins: styling only, marker shape untouched */
.pin .pin-stream.is-live { background: #d4af37 !important; color: #0c0a07 !important; border-color: rgba(12,10,7,.85) !important; box-shadow: 0 0 8px rgba(212,175,55,.5) !important; }
/* Cuisine Atlas toggles: gold when on, dark when off; cuisine colour kept as the small dot */
.filter-row .toggle { background: rgba(255,255,255,.08) !important; border: 1px solid rgba(212,175,55,.45) !important; box-shadow: none !important; }
.filter-row .toggle[aria-pressed="true"], .filter-row .toggle.on { background: linear-gradient(180deg, #e2c25a, #d4af37) !important; border-color: #d4af37 !important; }

/* ---------- 5. Desktop header (>=1024 only): rich black glass, fine gold edge, labelled actions ---------- */
.r4-hdr-extra, .r4-lbl { display: none; }
@media (min-width: 1024px) {
  .app > .header {
    position: relative;
    background: rgba(12, 10, 7, .88) !important;
    -webkit-backdrop-filter: blur(16px) saturate(120%); backdrop-filter: blur(16px) saturate(120%);
    border-bottom: 1px solid rgba(212, 175, 55, .38) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 236, 190, .05) !important;
    gap: 10px; padding: 0 14px; flex-wrap: nowrap;
  }
  .app > .header::after {
    content: ""; position: absolute; left: 0; right: 0; top: auto; bottom: -1px; height: 1px; inset: auto 0 -1px 0; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, .9) 18%, rgba(240, 214, 130, .95) 50%, rgba(212, 175, 55, .9) 82%, transparent) !important;
  }
  .header .brand.brand--hero .brand-logo, .header .brand.brand--hero img { height: 52px !important; max-width: 230px !important; }
  .header .search { flex: 0 1 clamp(180px, 18vw, 280px) !important; width: clamp(180px, 18vw, 280px); min-width: 140px !important; max-width: 280px !important; }
  .header .nav { flex: 0 0 auto !important; white-space: nowrap; gap: 12px !important; overflow: visible !important; }
  .header .nav a { flex: 0 0 auto; white-space: nowrap; }
  .header .actions { flex: 1 1 auto !important; min-width: 0; justify-content: flex-end; overflow: visible !important; gap: 6px !important; padding: 0 !important; }
  /* labelled actions (overrides auditfix .action--compact clipping) */
  .header .actions > * { flex: 0 0 auto !important; }
  .header .actions .action--compact, .header .actions #listRestBtn, .header .actions #liveNotifBtn, .header .actions .r4-hdr-extra { width: auto !important; min-width: 38px; padding: 0 11px !important; gap: 6px; justify-content: center; }
  .header .actions .action-label, .header .actions .r4-lbl {
    position: static !important; width: auto !important; height: auto !important; margin: 0 !important; overflow: visible !important; clip: auto !important;
    display: inline !important; white-space: nowrap; font-size: 11px; font-weight: 750; letter-spacing: .04em;
  }
  .header .actions #headerMoreBtn { width: 38px !important; padding: 0 !important; }
  .header .actions #headerMoreBtn .action-label { display: none !important; }
  .header .actions #navFavoritesBtn { width: auto !important; min-width: 42px; height: 38px; padding: 0 11px 0 6px; display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; border: 1px solid rgba(212,175,55,.55); background: rgba(12,10,7,.55); color: #f3e3b5; position: relative; }
  .header .actions #navFavoritesBtn .nav-fav-glow { display: none; }
  /* declutter: outline gold for List Restaurant + Food Trucks; Log in is the single solid gold CTA */
  .header .actions #listRestBtn, .header .actions #truckBtn {
    background: rgba(12, 10, 7, .55) !important; background-image: none !important; color: #e8c766 !important;
    border: 1px solid rgba(212, 175, 55, .75) !important; box-shadow: none !important;
  }
  .header .actions #truckBtn[aria-pressed="true"] { background: rgba(212,175,55,.18) !important; }
  .header .actions #loginBtn {
    background: linear-gradient(180deg, #e6c65e, #d4af37) !important; color: #0c0a07 !important;
    border: 1px solid #d4af37 !important; box-shadow: 0 4px 14px rgba(212, 175, 55, .28) !important;
  }
  .header .actions #loginBtn .action-ico { color: #0c0a07 !important; }
  .header .actions .r4-hdr-extra {
    height: 38px; display: inline-flex; align-items: center; border-radius: 999px; cursor: pointer;
    background: rgba(12,10,7,.55); color: #f3e3b5; border: 1px solid rgba(212,175,55,.4); font: inherit;
  }
  .header .actions .r4-hdr-extra:hover, .header .actions .r4-hdr-extra:focus-visible { border-color: #d4af37; outline: none; box-shadow: 0 0 0 2px rgba(212,175,55,.35); }
  /* progressive collapse when the row would clip (set by gui-fix-r4.js) */
  .header.r4-c1 .r4-hdr-extra .r4-lbl { display: none !important; }
  .header.r4-c1 .r4-hdr-extra { padding: 0 !important; width: 38px !important; }
  .header.r4-c2 #nearBtn .action-ico, .header.r4-c2 #truckBtn .action-ico, .header.r4-c2 #loginBtn .action-ico, .header.r4-c2 #navFavoritesBtn .nav-fav-emoji { display: none !important; }
  .header.r4-c2 #navFavoritesBtn { padding: 0 11px !important; }
  .header.r4-c3 #listRestBtn .action-label { display: none !important; }
  .header.r4-c4 #liveNotifBtn .r4-lbl, .header.r4-c4 #navFavoritesBtn .r4-lbl { display: none !important; }
  .header.r4-c4 #navFavoritesBtn .nav-fav-emoji { display: inline !important; }
  .header.r4-c5 .r4-hdr-extra { display: none !important; }
  .header.r4-c6 #nearBtn .action-label, .header.r4-c6 #truckBtn .action-label { display: none !important; }
  .header.r4-c6 #nearBtn .action-ico, .header.r4-c6 #truckBtn .action-ico { display: inline !important; }
  .header.r4-c7 #loginBtn .action-label { display: none !important; }
  .header.r4-c7 #loginBtn .action-ico { display: inline !important; }
}
@media (min-width: 1280px) { .header .actions .r4-hdr-extra { display: inline-flex; } }
@media (max-width: 1279px) { .header .actions .r4-hdr-extra { display: none !important; } }

/* ---------- 6. Desktop profile popup: hide the selected pin's name label while its card is open;
   right panel opaque enough that basemap labels never read through its edge (panel only, markers untouched) ---------- */
@media (min-width: 901px) {
  .map-shell.has-selected .pin.selected .pin-city { visibility: hidden !important; }
  #filters, #social { z-index: 40 !important; }
  #social { background-color: rgba(10, 8, 5, .9) !important; }
}

/* ---------- 7. Phone: compact control stack in the top-right gutter above the pin field; readable attribution ---------- */
@media (max-width: 768px) {
  #mapShell > .controls { top: 44px !important; right: 6px !important; bottom: auto !important; width: 36px !important; height: auto !important; }
  #mapShell > .controls > button { width: 36px !important; height: 36px !important; min-height: 36px !important; font-size: 15px !important; }
  #mapShell .maplibregl-ctrl-attrib { background: rgba(0, 0, 0, .8) !important; border: 1px solid rgba(212, 175, 55, .25); border-radius: 8px; }
  #mapShell .maplibregl-ctrl-attrib-inner, #mapShell .maplibregl-ctrl-attrib-inner a { color: #eadfc4 !important; font-size: 11px !important; line-height: 1.4 !important; }
}

/* ---------- 8. Navy band between hero map and fire-video section: black/transparent, no section overlays ---------- */
#promoHero { background-color: #000 !important; }
#promoHero .promo-hero-fade { background: none !important; }
#discoveryStack::before { background: none !important; }
#discoveryStack > .disc-section { background: none !important; }
#discoveryStack > .disc-section::before { background: none !important; }
html, body { background-color: #000 !important; }

/* ---------- 9. Cuisine Atlas tabs fit the panel (no 'Mor' clip); chip wrap never clipped ---------- */
#filters .atlas-tabs { overflow: visible !important; gap: 2px !important; }
#filters .atlas-tabs > .atlas-tab { flex: 1 1 auto !important; min-width: 0 !important; padding-left: 6px !important; padding-right: 6px !important; font-size: 11px !important; letter-spacing: .02em !important; white-space: nowrap !important; }
#filters .chips-wrap { flex-wrap: wrap !important; overflow: visible !important; max-height: none !important; }
