@font-face {
    font-family: 'mono';
    src: url('../fonts/monoandfriendsdo-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
  }
  
  :root {
    --white: #fff;
    --black: #000;
    --gray: #737373;
    --light-gray: #f3f5f7;
    --dark-gray: #555;
    --orange: #EA7830;
    --dark-orange: #C65525;
    --light-orange: #FFCD62;
    --purple: #9747FF;
    --blue: #2830A8;
    --red: #b93b3b;
    --dark-red: #af5454;
    --pink: #D8129D;
    --green: #54AF69;
    --light-green: #4CAF6A;
    --yellow: #eec15f;
  }
  
  /* ===== Card ===== */
  .popup {
    background: var(--white);
    border-radius: 20px;
    width: min(92vw, 360px);
    overflow: visible;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 999999;
  }
  
  /* ===== Header ===== */
  .popup .header-img {
    width: 100%;
    height: clamp(140px, 32vw, 180px);
    min-height: 180px;
    object-fit: cover;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-sizing: border-box;
    padding: 2em;
  }
  
  /* Leaflet container tweaks */
  .custom-leaflet-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 20px;
    position: relative;
  }
  .custom-leaflet-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
  }
  .custom-leaflet-popup .leaflet-popup-close-button {
    position: absolute;
    top: 12px !important;
    right: 12px !important;
    margin: 0 !important;
    transform: none !important;
  }
  
  /* ===== Centraal icoon ===== */
  .icon {
    background: var(--orange);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    clip-path: circle(50% at 50% 50%);
    z-index: 3;
  }
  .icon img { width: 40px; height: 40px; }
  
  /* ===== Koptekst ===== */
  .wrapper-text{ margin-top: 30px; position: relative; }
  .backgroundPopup{
    background-color: rgba(0,0,0,0.3);
    width: 100%;
    height: 100%;
    position: absolute;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
  }
  .header-img h2{
    font-size: 32px;
    padding: 0;
    margin: 0;
    color: var(--white);
    text-align: center;
    font-family: mono, sans-serif;
  }
  .header-img p {
    color: var(--white);
    margin: 0;
    margin-top: 0.5em;
    font-size: 16px;
    text-align: center;
  }
  
  /* ===== Content ===== */
  .popup-content {
    padding: 20px;
    text-align: start;
    max-height: calc(70vh - 160px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    column-gap: 16px;
    row-gap: 12px;
  }
  
  /* Geen extra top-padding als er geen route-info is (optioneel, mag blijven) */
  .popup-content:not(:has(.route-info)) { padding-top: 20px; }
  
  /* ===== Route-info – volle breedte bovenaan ===== */
  .route-info {
    order: 0;
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: start;
    color: var(--orange);
    font-weight: bold;
    margin-top: 0;          /* geen extra marge in flex */
    font-size: 14px;
  }
  .route-info img {
    width: 20px;
    margin-right: 8px;
  }

  #live-route-info img {
    height: 1.3em;
  }
  
  /* ===== Linkerkolom: illustratie ===== */
    .poi-illustration {
        order: 1;
        flex: 0 0 100px;       /* vaste breedte voor illustratie */
        display: flex;
        justify-content: center;
        align-items: center;
    }

  .poi-illustration img {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    display: block;
    margin-top: 15px;
  }
  
  /* ===== Rechterkolom: tekst + knoppen ===== */
  .popup-footer {
    /* order: 1;
    flex: 1 1 0;       */
    display: flex;
    flex-direction: column;
    /* justify-content: space-between; */
    align-items: center;
    /* margin-top: 40px; */
    gap: 12px;
  }
  
  /* Wanneer de footer direct volgt op de illustratie (onze 2-koloms rij),
     stapelen we de inhoud in de rechterkolom: eerst tekst (.info-block/.note), dan knoppen */
  .poi-illustration + .popup-footer {
    margin-top: 0;
    /* align-items: stretch; */
    flex-direction: column;
    gap: 10px;
  }
  
  /* ===== CTA & info (branding behouden) ===== */
  .popup-footer a {
    background: var(--dark-orange);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    flex: 1;
    max-width: 100%;
  }
  
  /* Leaflet anchor button reset */
  .custom-leaflet-popup .leaflet-popup-content .popup-footer a.btnDetail {
    display: block;
    background: var(--dark-orange) !important;
    color: #fff !important;
    text-decoration: none !important;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    box-sizing: border-box;
    flex: 1 1 auto;
    max-width: 100%;
  }
  .custom-leaflet-popup .leaflet-popup-content .popup-footer a.btnDetail:hover {
    filter: brightness(0.95);
  }
  
  .popup-footer .btn-start-route {
    background: lightblue;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
  }
  .popup-footer .btn-start-route:hover { filter: brightness(0.95); }
  #stop { background: var(--dark-orange); }
  
  .popup-footer .startRoute{
    width: 40px;
    height: 40px;
    image-resolution: 1/1;
    cursor: pointer;
    border-radius: 50%;
  }
  
  /* Info-blok/Note (korte, neutrale boodschap zonder link) */
  .info-block,
  .footerflex {
    margin: 0;                   /* in rechterkolom direct boven knoppen */
    padding: 12px 16px;
    color: #555;
    font-size: 15px;
    line-height: 1.4;
    text-align: left;
  }
  
  /* ===== Kleuren per type ===== */
  #events { background-color: #FFCD62; }
  #cultuurSport { background-color: #9747FF; }
  #activiteiten { background-color: #EA7830; }
  #geschiedenis { background-color: #2830A8; }
  #horeca { background-color: #DC592B; }
  #Douche { background-color: #D8129D; }
  #EHBO { background-color: #D8129D; }
  #parking { background-color: #737373; }
  #ingang { background-color: #b93b3b; }
  #route { background-color: #54AF69; }
  
  #eventsColor { color: #FFCD62; }
  #cultuurSportColor { color: #9747FF; }
  #activiteitenColor { color: #EA7830; }
  #geschiedenisColor { color: #2830A8; }
  #horecaColor { color: #DC592B; }
  #doucheColor { color: #D8129D; }
  #EHBOColor { color: #D8129D; }
  #routeColor { color: #54AF69; }
  
  /* Buffer verbergen */
  .buffer{ width: 100%; height: 20px; opacity: 1; animation: buffer 1s infinite; }
  .popup-content .buffer { display: none; }
  @keyframes buffer { 0%{opacity:.7} 50%{opacity:.25} 100%{opacity:.7} }
  
  /* ===== Mobile: illustratie blijft naast tekst ===== */
  @media screen and (max-width: 475px) {
    .popup { width: min(94vw, 360px); }
    .popup .header-img { height: clamp(120px, 28vw, 150px); padding: 1rem; }
    .header-img h2 { font-size: 1.05rem; }
    .header-img p  { font-size: 0.9rem; }
  
    .icon { width: 58px; height: 58px; top: -29px; border-width: 3px; }
    .icon img { width: 26px; height: 26px; }
  
    .popup-content {
      padding: 14px;
      max-height: calc(65vh - 140px);
      overflow: auto;
      -webkit-overflow-scrolling: touch;
  
      /* blijft FLEX; twee kolommen blijven naast elkaar */
      column-gap: 12px;
      row-gap: 10px;
    }
  
    .poi-illustration { flex-basis: 100px; }
    .poi-illustration img { max-width: 100px; max-height: 100px; }
  
    .route-info { font-size: 0.85rem; }
    .route-info img { width: 16px; margin-right: 8px; }
  
    .custom-leaflet-popup .leaflet-popup-content .popup-footer a.btnDetail { width: 100%; }
  }
  
  @media screen and (max-width: 360px) {
    .popup { width: 96vw; }
    .header-img h2 { font-size: 1.2rem; }
    .header-img p  { font-size: 0.85rem; }
  
    .poi-illustration { flex-basis: 88px; }
    .poi-illustration img { max-width: 88px; max-height: 88px; }
  }
  
  /* 2 kolommen naast elkaar met flex */
.popup-footer.footer-row {
    display: flex;
    flex-direction: row;
    align-items: left;
    /* justify-content: space-between; */
    gap: 12px;
    /* flex-wrap: nowrap;    */
  }
  
  /* Linkerkolom: vaste breedte voor illustratie */
  .footerflex1 {
    /* flex: 0 0 120px;       */
    /* margin-left: 10px; */
    display: flex;
    justify-content: center;
  }
  
  /* Rechterkolom: tekst boven, knoppen eronder */
  .footerflex {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;      
    /* align-items: stretch; */
    gap: 10px;
  }
  
  /* Illustratie zelf */
  .footerflex1 .poi-illustration img,
  .poi-illustration img {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    display: block;
  }
  
  /* Info-blok (je bestaande styling kan blijven) */
  .info-block, .footerflex {
    margin: 0;
    padding: 12px 16px;
    color: #555;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
  }
  
  /* Knoppen (branding behouden) vullen de kolom mooi */
  .footerflex a.btnDetail,
  .footerflex .btn-start-route {
    width: auto;
    /* margin:0 auto; */
  }
  
  /* Kleinere schermen: hou ze nog steeds naast elkaar maar compacter */
  @media (max-width: 475px) {
    .popup-footer.footer-row { gap: 10px; }
    .footerflex1 { flex-basis: 100px; }
    .footerflex1 .poi-illustration img,
    .poi-illustration img { max-width: 100px; max-height: 100px; }   
    .route-info {
      font-size: 13px;
    }
    .info-block, .footerflex {
      font-size: 13px;
   }
   .popup-footer button.btn-start-route {
     padding: 10px 13px;
     font-size: 14px;
   }
   .custom-leaflet-popup .leaflet-popup-content .popup-footer a.btnDetail {
    padding: 10px 13px;
    font-size: 14px;
  }
  }
  @media (max-width: 360px) {
    /* .footerflex1 { flex-basis: 88px; } */
    .footerflex1 .poi-illustration img,
    .poi-illustration img { max-width: 88px; max-height: 88px; }
  }
  
  /* Zorg dat de rij echt een rij is in alle browsers */
.popup-footer.footer-row{
  display:flex;
  flex-direction:row;
  align-items:flex-start;  
  gap:12px;
}

/* Linkerkolom: vaste breedte */
.footerflex1{
  flex:0 0 120px;          
  display:flex;
  justify-content:center;
  align-items:center;
}

/* Rechterkolom: mag krimpen/afbreken tekst */
.footerflex{
  flex:1 1 auto;
  min-width:0;               
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Illustratie zelf netjes binnen kolom */
.footerflex1 .poi-illustration,
.poi-illustration{
  display:flex;
  align-items:center;
  justify-content:center;
}

.footerflex1 .poi-illustration img,
.poi-illustration img{
  max-width:120px;
  max-height:120px;
  width:auto;
  height:auto;
  display:block;
}

/* Verwijder standaard witte wrapper & pijltje van Leaflet voor onze popups */
.leaflet-popup.zuiderbad-popup .leaflet-popup-content-wrapper,
.leaflet-popup.zuiderbad-popup .leaflet-popup-tip {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

.leaflet-popup.zuiderbad-popup .leaflet-popup-tip-container { display: none !important; }
.leaflet-popup.zuiderbad-popup .leaflet-popup-content { margin: 0 !important; padding: 0 !important; width: auto !important; }

/* ===== Compacte route-popup card ===== */
.leaflet-popup.route-popup .leaflet-popup-content-wrapper {
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}
.route-card { padding: 14px 16px 16px; width: 100%; max-width: 360px; }
.route-card__head { display:flex; align-items:center; gap:10px; }
.route-card__icon { width:34px; height:34px; border-radius:50%; background:#4CAF6A; }
.route-card h3 { margin:0; font:700 18px/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial; }
.route-card__desc { margin:8px 0 12px; color:#444; font:14px/1.4 ui-sans-serif; }
.route-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.route-chips .chip {
  font:12px/1 ui-sans-serif; background:#f3f5f7; border:1px solid #e6e9ec;
  padding:6px 8px; border-radius:999px; color:#333; text-transform:capitalize;
}
.route-card__actions { display:flex; gap:10px; margin-top:10px; }
.route-card .btn-primary {
  flex:1; border:0; border-radius:10px; padding:10px 12px;
  background:#d24e1d; color:#fff; font-weight:700; cursor:pointer;
}
.route-card .btn-outline {
  flex:1; border-radius:10px; padding:10px 12px;
  background:#fff; border:2px solid #eec15f; color:#a2710b; font-weight:700; cursor:pointer;
}
@media (max-width: 480px){
  .route-card { max-width: 340px; }
}

/* ===== Floating Route Info (links-boven), zelfde feel als drawers ===== */
.route-info-card{
  position: fixed;
  top: 16px;
  left: 16px;
  width: min(94vw, 380px);
  max-height: 80dvh;
  background: #fff;
  border-radius: 16px;
  border-left: 3px solid #54AF69; /* routekleur */
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  z-index: 20040; /* boven leaflet popups */
  display: grid; grid-template-rows: auto 1fr;
  overflow: hidden;
  opacity: 0; transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.route-info-card.is-open{ opacity: 1; transform: translateY(0); pointer-events: auto; }

.route-info-card .ri-header{
  background: linear-gradient(180deg,#fff 0%,rgba(255,255,255,.96) 60%,rgba(255,255,255,0) 100%);
  padding: 14px 14px 10px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #eef3ee;
}
.route-info-card .ri-title{ display:flex; align-items:center; gap:10px; }
.route-info-card .ri-dot{ width:14px; height:14px; border-radius:50%; background:#54AF69; display:inline-block; }
.route-info-card .ri-h{ margin:0; font:700 18px/1.2 ui-sans-serif, system-ui; color:#2b2b2b; }
.route-info-card .ri-close{
  border:2px solid #54AF69; background:#fff; color:#54AF69; width:28px; height:28px; border-radius:8px; cursor:pointer;
}
.route-info-card .ri-close:hover{ background:#54AF69; color:#fff; }
.route-info-card .ri-content{ padding: 12px 14px 16px; overflow:auto; }

@media (max-width: 768px){
  .route-info-card{ top:12px; left:12px; width:min(96vw, 380px); max-height:70dvh; }
}

/* === Planner‑style content for the floating route card (no image) === */
.route-info-card{
  border-left-color: #4CAF6A; /* align with planner orange */
}
.route-info-card .ri-body{
  padding: 14px 16px 16px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
}
.route-info-card .ri-title-h{
  margin: 0 0 6px 0;
  font: 800 20px/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  color: var(--rp-ink, #2b2b2b);
  letter-spacing: .2px;
}
.route-info-card .ri-desc{
  margin: 0;
  color: #555;
  font: 500 14px/1.5 ui-sans-serif, system-ui;
}
.route-info-card .ri-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.route-info-card .ri-chip{
  background: #fff;
  border: 2px solid #4CAF6A;
  color: #4CAF6A;
  font: 700 12px/1 ui-sans-serif, system-ui;
  padding: 6px 10px;
  border-radius: 999px;
  text-transform: capitalize;
}
.route-info-card .ri-actions{
  display: flex;
  gap: 10px;
}
.route-info-card .ri-btn{
  flex: 1 1 0;
  border-radius: 12px;
  padding: 12px 14px;
  font: 800 15px/1 ui-sans-serif, system-ui;
  cursor: pointer;
  border: 0;
  transition: transform .04s ease, background .15s ease;
}
.route-info-card .ri-btn:active{ transform: translateY(1px); }
.route-info-card .ri-btn-primary{
  background: #4CAF6A;
  color: #fff;
}
.route-info-card .ri-btn-primary:hover{ filter: brightness(.95); }

.route-info-card .ri-btn-secondary{
  background: #fff;
  color: #4CAF6A;
  border: 2px solid #4CAF6A;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

/* === Smaller floating route card on compact screens === */
@media (max-width: 480px){
  .route-info-card{
    top: 10px;
    left: 10px;
    width: min(94vw, 320px);
    max-height: 64dvh;
    border-left-width: 2px;
  }
  .route-info-card .ri-header{
    padding: 10px 10px 8px 12px;
  }
  .route-info-card .ri-dot{
    width: 10px;
    height: 10px;
  }
  .route-info-card .ri-h,
  .route-info-card .ri-title-h{
    font: 800 16px/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  }
  .route-info-card .ri-content,
  .route-info-card .ri-body{
    padding: 10px 12px 12px;
    gap: 10px;
  }
  .route-info-card .ri-desc{
    font: 500 13px/1.45 ui-sans-serif, system-ui;
  }
  .route-info-card .ri-chip{
    padding: 5px 8px;
    font: 700 11px/1 ui-sans-serif, system-ui;
  }
  .route-info-card .ri-actions{
    gap: 8px;
  }
  .route-info-card .ri-btn{
    padding: 10px 12px;
    font: 800 14px/1 ui-sans-serif, system-ui;
    border-radius: 10px;
  }
  /* .route-info-card .ri-close{
    width: 24px;
    height: 24px;
    border-radius: 6px;
  } */
}

@media (max-width: 360px){
  .route-info-card{
    top: 8px;
    left: 8px;
    width: 96vw;
    max-height: 60dvh;
  }
  .route-info-card .ri-h,
  .route-info-card .ri-title-h{
    font-size: 15px;
  }
  .route-info-card .ri-desc{
    font-size: 12.5px;
  }
  .route-info-card .ri-btn{
    padding: 9px 10px;
    font-size: 13.5px;
  }
}

.backgroundPopup.empty , .header-img{
  border-radius: 20px;
  overflow-y: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.ri-note {
  font-size: 1em;
}

.ri-btn-danger {
  color: #54AF69;
  background-color: white;
  border: 2px solid #54AF69 !important;
  text-wrap: nowrap;
}

.ri-note {
  text-wrap: nowrap !important;
  padding-top: 5px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9em;
}

/* Disabled/laadstaat voor de button */
.is-loading {
  pointer-events: none;
  opacity: .8;
}

.ri-btn-info {
  background: #54AF69;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
  text-decoration: none;
}