/* modules/services/assets/service-map.css */
/* Tailwind drives almost all UI styling now.
   This file only contains small structural rules required for Leaflet + drawer. */

/*
  Sticky/scroll layout notes
  - The left column (results) scrolls inside the viewport (no visible scrollbar).
  - The right column (map) sticks and fills its available height.
  - When the results reach the bottom, scroll can continue to the page (footer).

  If your theme has a sticky header, you can set this CSS variable anywhere:
    --visd-sticky-top: <header height in px>;
*/

:root {
  --visd-sticky-top: 0px;
  --visd-gap-bottom: 24px;
}

.visd-layout {
  align-items: stretch;
}

.visd-scroll {
  /* viewport-height scrolling for the list */
  max-height: calc(100vh - var(--visd-sticky-top) - var(--visd-gap-bottom));
  overflow-y: auto;
  overscroll-behavior: auto; /* allow scroll chaining to the page (footer) */
  padding-right: 2px; /* avoids content shift when scrollbar is hidden */

  /* Hide scrollbar (still scrollable) */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}
.visd-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.visd-col-map {
  position: sticky;
  top: var(--visd-sticky-top);
  height: calc(100vh - var(--visd-sticky-top) - var(--visd-gap-bottom));
}

/* Leaflet needs explicit height on the map element */
#visd-map {
  height: 100%;
  min-height: 0;
}

#visd-map .leaflet-container {
  width: 100%;
  height: 100%;
}

/* Drawer (details panel) */
#visd-drawer.visd-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 9999;
}

#visd-drawer.visd-drawer.visd-drawer-open {
  opacity: 1;
  pointer-events: auto;
}

#visd-drawer .visd-drawer-inner {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(520px, 92vw);
  background: #fff;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
  transform: translateX(12px);
  transition: transform 160ms ease;
  display: flex;
  flex-direction: column;
}

#visd-drawer.visd-drawer-open .visd-drawer-inner {
  transform: translateX(0);
}

#visd-drawer .visd-drawer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  font-size: 22px;
  line-height: 34px;
  cursor: pointer;
}

#visd-drawer .visd-drawer-content {
  padding: 18px 18px 24px;
  overflow: auto;
  height: 100%;
  box-sizing: border-box;
}

body.visd-drawer-lock { overflow: hidden; }

