/* Weihnachtsmarktkarte – Cyberforge GmbH */

.wmk-app {
  --wmk-primary: #012a55;
  --wmk-primary-2: #0b3a6e;
  --wmk-white: #fff;
  --wmk-text: #8c8e9a;
  --wmk-accent: #d2232a;
  --wmk-ink: #0d1b2e;
  --wmk-radius: 1rem;
  --wmk-scale: 1;
  --wmk-safe-top: env(safe-area-inset-top, 0px);
  --wmk-safe-bottom: env(safe-area-inset-bottom, 0px);

  position: relative;
  width: 100%;
  height: var(--wmk-height, 70vh);
  min-height: 320px;
  margin: 0;
  padding: 0;
  border-radius: var(--wmk-radius);
  overflow: hidden;
  isolation: isolate;
  background: var(--wmk-primary);
  color: var(--wmk-ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.wmk-app *, .wmk-app *::before, .wmk-app *::after { box-sizing: border-box; }
.wmk-app[data-mode="page"], .wmk-app.wmk-is-fs, .wmk-app:fullscreen {
  height: 100vh; height: 100dvh; min-height: 0; border-radius: 0;
}
.wmk-app:-webkit-full-screen { height: 100vh; border-radius: 0; }

.wmk-map { position: absolute; inset: 0; background: var(--wmk-primary); }
.wmk-app .leaflet-container { font: inherit; background: var(--wmk-primary); }

/* Kacheln sanft in unsere Farben einfärben */
.wmk-theme-dark .wmk-tiles { filter: grayscale(1) invert(1) contrast(.9) sepia(1) hue-rotate(175deg) saturate(2.4) brightness(.62); }
.wmk-app.wmk-notint .wmk-tiles { filter: none; }
.wmk-theme-light .wmk-tiles { filter: grayscale(1) sepia(.35) hue-rotate(175deg) saturate(1.8) brightness(1.03); }

.wmk-app .leaflet-control-attribution {
  background: rgba(1, 42, 85, .55); color: rgba(255,255,255,.7);
  font-size: 10px; border-top-left-radius: 6px; padding: 1px 6px;
  margin-bottom: var(--wmk-safe-bottom);
}
.wmk-app .leaflet-control-attribution a { color: #fff; }

/* ---------- Icons & Buttons ---------- */
.wmk-i { width: 20px; height: 20px; display: block; flex: none; }

.wmk-btn {
  appearance: none; border: 0; margin: 0; padding: 0; cursor: pointer;
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--wmk-white); color: var(--wmk-primary);
  box-shadow: 0 2px 10px rgba(0, 15, 35, .28);
  transition: transform .12s, background .15s, color .15s;
}
.wmk-btn:hover { background: #f1f4f8; }
.wmk-btn:active { transform: scale(.94); }
.wmk-btn:focus-visible, .wmk-chip:focus-visible, .wmk-cta:focus-visible { outline: 3px solid var(--wmk-accent); outline-offset: 2px; }
.wmk-btn.wmk-on { background: var(--wmk-accent); color: #fff; }
.wmk-btn.wmk-busy .wmk-i { animation: wmk-pulse 1s infinite; }
@keyframes wmk-pulse { 50% { opacity: .35; } }

.wmk-top {
  position: absolute; z-index: 500; left: 0; right: 0; top: 0;
  padding: calc(10px + var(--wmk-safe-top)) 10px 0;
  display: flex; gap: 8px; align-items: center; pointer-events: none;
}
.wmk-top > * { pointer-events: auto; }
.wmk-chips {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 2px 64px 6px 2px; margin-right: -10px; min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
          mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.wmk-chips::-webkit-scrollbar { display: none; }
.wmk-chip {
  appearance: none; border: 0; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px 0 10px; border-radius: 999px;
  background: rgba(255,255,255,.95); color: var(--wmk-primary);
  font: 600 13px/1 inherit; font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,15,35,.22);
}
.wmk-chip .wmk-i { width: 17px; height: 17px; }
.wmk-chip[aria-pressed="true"] { background: var(--wmk-accent); color: #fff; }

.wmk-controls {
  position: absolute; z-index: 500; right: 10px;
  bottom: calc(26px + var(--wmk-safe-bottom));
  display: flex; flex-direction: column; gap: 8px;
}
.wmk-zoom { display: flex; flex-direction: column; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,15,35,.28); }
.wmk-zoom .wmk-btn { box-shadow: none; border-radius: 0; }
.wmk-zoom .wmk-btn:first-child { border-radius: 12px 12px 0 0; border-bottom: 1px solid #e3e7ee; }
.wmk-zoom .wmk-btn:last-child { border-radius: 0 0 12px 12px; }
@media (pointer: coarse) { .wmk-zoom { display: none; } }

.wmk-hint {
  position: absolute; z-index: 450; inset: 0; display: grid; place-items: center;
  background: rgba(1,42,85,.45); color: #fff; font-weight: 600; font-size: 16px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.wmk-show-hint .wmk-hint { opacity: 1; }

/* ---------- Marker ---------- */
.wmk-marker { background: none; border: 0; }
.wmk-pin {
  /* Ankerpunkt = Mitte der Grafik; Beschriftung hängt darunter und skaliert nicht mit */
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.wmk-pin-ico {
  --wmk-px: calc(var(--wmk-geo, 1) * var(--wmk-size, 1));
  width: calc(34px * var(--wmk-px)); height: calc(34px * var(--wmk-px)); border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wmk-white); color: var(--wmk-primary);
  border: 2px solid var(--wmk-white);
  box-shadow: 0 2px 8px rgba(0,10,25,.45);
  transition: transform .15s ease;
}
.wmk-pin-ico .wmk-i { width: 55%; height: 55%; }
.wmk-has-img .wmk-pin-ico { display: block; width: auto; height: auto; border-radius: 0; background: transparent; border: 0; box-shadow: none; }
.wmk-has-img .wmk-pin-ico img {
  display: block; width: auto !important;
  height: calc(44px * var(--wmk-px)) !important; max-height: none !important;
  max-width: calc(70px * var(--wmk-px)) !important;
  object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5));
}
.wmk-pin-label {
  position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%);
  width: max-content; max-width: 130px; padding: 2px 7px; border-radius: 6px;
  background: rgba(1,42,85,.88); color: #fff;
  font-size: 11.5px; font-weight: 600; line-height: 1.25; text-align: center;
  white-space: normal; text-wrap: balance;
  transition: opacity .2s; pointer-events: none;
}
.wmk-label-off .wmk-pin-label { opacity: 0; }
/* Nur bei Hover/Klick größer */
.wmk-marker:hover .wmk-pin-ico { transform: scale(1.2); }
.wmk-active .wmk-pin-ico { transform: scale(1.3); }
.wmk-marker:hover .wmk-pin-label, .wmk-active .wmk-pin-label { opacity: 1; }
.wmk-active .wmk-pin-ico { background: var(--wmk-accent); color: #fff; border-color: #fff; }
.wmk-active.wmk-marker .wmk-has-img .wmk-pin-ico { background: transparent; outline: 0; }
.wmk-active.wmk-marker .wmk-has-img .wmk-pin-ico img { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 5px var(--wmk-accent)) drop-shadow(0 3px 4px rgba(0,0,0,.5)); }
.wmk-active .wmk-pin-label { background: var(--wmk-accent); }
.wmk-marker:focus-visible { outline: none; }
.wmk-marker:focus-visible .wmk-pin-ico { outline: 3px solid var(--wmk-accent); outline-offset: 2px; }

.wmk-me { background: #3d8bff; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 6px rgba(61,139,255,.3); }
.wmk-me-acc { fill: #3d8bff; fill-opacity: .12; stroke: #3d8bff; stroke-opacity: .4; stroke-width: 1; }

/* ---------- Panels (Pop-up + Liste) ---------- */
.wmk-panel {
  position: absolute; z-index: 600; background: #fff; color: var(--wmk-ink);
  box-shadow: 0 10px 40px rgba(0,15,35,.4);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .25s;
}
.wmk-panel[hidden] { display: none; }

@media (min-width: 640px) {
  .wmk-listpanel { bottom: 12px; }
  .wmk-panel { top: 58px; left: 12px; max-height: calc(100% - 70px); width: min(380px, calc(100% - 90px)); border-radius: 14px; transform: translateX(-20px); opacity: 0; }
  .wmk-app[data-mode="page"] .wmk-panel { top: calc(62px + var(--wmk-safe-top)); }
}
@media (max-width: 639.98px) {
  .wmk-panel { left: 0; right: 0; bottom: 0; max-height: 78%; border-radius: 18px 18px 0 0; transform: translateY(100%); padding-bottom: var(--wmk-safe-bottom); }
}
.wmk-panel.wmk-open { transform: none; opacity: 1; }

.wmk-grip { display: none; }
@media (max-width: 639.98px) {
  .wmk-grip { display: block; position: absolute; z-index: 2; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
}

.wmk-sheet-close { position: absolute; z-index: 3; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; }
.wmk-sheet-scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1; -webkit-overflow-scrolling: touch; }

.wmk-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--wmk-primary); aspect-ratio: 16 / 10; }
.wmk-gallery::-webkit-scrollbar { display: none; }
.wmk-gallery img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; display: block; }
.wmk-dots { display: flex; justify-content: center; gap: 5px; margin-top: -18px; position: relative; height: 18px; }
.wmk-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); }
.wmk-dots span.on { background: #fff; }

.wmk-sheet-body { padding: 18px 18px 8px; }
.wmk-sheet:not(:has(.wmk-gallery)) .wmk-sheet-body { padding-top: 22px; padding-right: 56px; }
.wmk-sheet-head { display: flex; gap: 12px; align-items: flex-start; }
.wmk-sheet-ico { flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--wmk-primary); color: #fff; }
.wmk-sheet-ico img { width: 42px; height: 42px; object-fit: contain; }
.wmk-sheet-ico .wmk-i { width: 24px; height: 24px; }
.wmk-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wmk-accent); }
.wmk-sheet h3 { margin: 1px 0 0; font-size: 19px; line-height: 1.25; color: var(--wmk-primary); font-weight: 700; }
.wmk-sub { margin: 2px 0 0; color: var(--wmk-text); font-size: 14px; }

.wmk-offer { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wmk-offer li { padding: 5px 10px; border-radius: 999px; background: #eef2f7; color: var(--wmk-primary); font-size: 13px; font-weight: 600; }

.wmk-rich { margin-top: 14px; font-size: 14.5px; color: #2b3445; }
.wmk-rich h1, .wmk-rich h2, .wmk-rich h3, .wmk-rich h4 { font-size: 15px; margin: 14px 0 6px; color: var(--wmk-primary); }
.wmk-rich p { margin: 0 0 8px; }
.wmk-rich a { color: var(--wmk-accent); }
.wmk-rich img { max-width: 100%; height: auto; border-radius: 8px; }

.wmk-actions { display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid #edf0f4; background: #fff; }
.wmk-cta {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; border-radius: 12px; background: var(--wmk-accent); color: #fff !important;
  font-weight: 700; text-decoration: none !important; font-size: 15px;
}
.wmk-cta:hover { filter: brightness(1.07); }
.wmk-actions .wmk-btn { width: 46px; height: 46px; background: #eef2f7; box-shadow: none; }

/* Liste */
.wmk-panel-head { display: flex; gap: 8px; align-items: center; padding: 14px 12px 10px 14px; border-bottom: 1px solid #edf0f4; }
@media (max-width: 639.98px) { .wmk-panel-head { padding-top: 20px; } .wmk-listpanel .wmk-grip { background: #d5dbe3; } }
.wmk-panel-head .wmk-btn { width: 38px; height: 38px; box-shadow: none; background: #eef2f7; border-radius: 50%; }
.wmk-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; background: #eef2f7; color: var(--wmk-text); }
.wmk-search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important; padding: 0 !important; margin: 0; height: auto; font: inherit; font-size: 16px; color: var(--wmk-ink); }
.wmk-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.wmk-list li { margin: 0; }
.wmk-list button { appearance: none; border: 0; background: none; width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.wmk-list button:hover, .wmk-list button:focus-visible { background: #f1f4f8; outline: none; }
.wmk-li-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--wmk-primary); color: #fff; }
.wmk-li-ico img { width: 32px; height: 32px; object-fit: contain; }
.wmk-li-txt { display: flex; flex-direction: column; min-width: 0; }
.wmk-li-txt strong { color: var(--wmk-primary); font-size: 14.5px; line-height: 1.3; }
.wmk-li-txt small { color: var(--wmk-text); font-size: 12.5px; }
.wmk-empty { padding: 20px; text-align: center; color: var(--wmk-text); }

.wmk-toast {
  position: absolute; z-index: 700; left: 50%; bottom: calc(24px + var(--wmk-safe-bottom)); transform: translateX(-50%);
  background: var(--wmk-ink); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 14px;
  animation: wmk-toast 1.8s forwards;
}
@keyframes wmk-toast { 0% { opacity: 0; transform: translate(-50%, 8px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .wmk-panel, .wmk-pin, .wmk-btn { transition: none; }
}
