/*
  mobile.css — Loaded after each page's inline <style> block so it wins the
  CSS cascade for same-specificity rules. Uses !important on every property
  that needs to override page-level style declarations.
*/

/* ── Base state: sidebar off-screen left, hamburger & close hidden ── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 299;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sidebar-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  border-radius: var(--radius);
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.hamburger:hover { background: var(--surface2); color: var(--text); }

.sidebar-close {
  display: none;
  position: absolute;
  top: 18px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7290;
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.sidebar-close:hover { color: #a8aec0; background: rgba(255,255,255,0.06); }

/* ── Mobile: hide sidebar, show when open ── */
@media (max-width: 768px) {
  /* Hidden by default — completely out of layout */
  .sidebar {
    display: none !important;
  }

  /* Visible as fixed overlay when .open is set by JS */
  .sidebar.open {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 220px !important;
    min-width: 220px !important;
    height: 100vh !important;
    z-index: 300 !important;
  }

  /* Logo needs relative so the absolute close button positions correctly */
  .logo {
    position: relative !important;
  }

  /* Show hamburger and close button */
  .hamburger {
    display: flex !important;
  }
  .sidebar-close {
    display: block !important;
  }
}

/* ── Desktop: normal layout, hide mobile-only controls ── */
@media (min-width: 769px) {
  .sidebar {
    display: flex !important;
    position: static !important;
    height: auto !important;
  }
  .hamburger,
  .sidebar-overlay,
  .sidebar-close {
    display: none !important;
  }
  #deal-mobile-topbar {
    display: none !important;
  }
}

/* ── Mobile: show deal-detail mobile topbar ── */
@media (max-width: 768px) {
  #deal-mobile-topbar {
    display: flex !important;
    min-height: 48px;
  }
}
