/* ============================================================
   EFKV – Hafen-Lageplan (Originalplan als Basis + Marker-Ebene)
   ============================================================ */
.plan {
  padding: clamp(6.5rem, 10vw, 8.5rem) 0 clamp(4rem, 8vw, 6rem);
  background: var(--cream);
}
.plan__head { margin-bottom: clamp(1.2rem, 2.5vw, 2rem); max-width: 62ch; }
.plan__head .h2 { margin-bottom: .6rem; }
.plan__head p { color: var(--ink-soft); }

.plan__note {
  display: flex; gap: .7rem; align-items: flex-start;
  background: var(--cream-2); border-left: 3px solid var(--green);
  border-radius: 0 var(--r) var(--r) 0; padding: .85rem 1.1rem;
  font-size: .9rem; color: var(--ink); margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
}
.plan__note svg { flex: 0 0 auto; color: var(--green-700); margin-top: .1rem; }

/* --- Plan (Bild + Marker-Overlay) --- */
/* Eingebettete Übersicht (z. B. auf der Liegeplatz-Seite) */
.lp-plan { margin: clamp(2.2rem, 5vw, 3.5rem) 0; }
.lp-plan > h2 { margin-bottom: .3rem; }
.lp-plan > .join__hint { margin-bottom: 1.1rem; }

.plan__figure {
  position: relative; margin: 0; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); background: #fff;
}
.plan__figure img { display: block; width: 100%; height: auto; }
.plan__overlay { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Liegeplatz-Hotspots – unsichtbar über den schon gezeichneten Boxen;
   Hover/Fokus hebt hervor. Koordinaten in Bildpixeln via viewBox. */
.berth { cursor: pointer; }
.berth__box {
  fill: rgba(255, 255, 255, .01); stroke: transparent; stroke-width: 3;
  transition: fill .15s var(--ease), stroke .15s;
}
/* Belegungs-Status – immer sichtbar auf dem Plan */
.berth.is-free .berth__box { fill: rgba(123, 160, 91, .50); stroke: var(--green-700); }
.berth.is-occ  .berth__box { fill: rgba(192, 57, 43, .28);  stroke: rgba(192, 57, 43, .65); }
.berth.is-neutral .berth__box { fill: rgba(255, 255, 255, .01); stroke: transparent; }
/* Hover / Fokus / Auswahl heben den Platz hervor */
.berth:hover .berth__box, .berth.is-hot .berth__box { stroke: var(--deep); stroke-width: 4; }
.berth:focus-visible { outline: none; }
.berth:focus-visible .berth__box { stroke: var(--deep); stroke-width: 4; }
.berth.is-selected .berth__box { stroke: var(--deep); stroke-width: 5; }
/* Liegeplatz-Nummern (per JS ab Zoomstufe eingeblendet) */
.berth__num {
  font: 700 20px/1 'Hanken Grotesk', system-ui, sans-serif;
  fill: var(--deep); text-anchor: middle; dominant-baseline: central;
  paint-order: stroke; stroke: #fff; stroke-width: 4px;
  pointer-events: none; opacity: 0; transition: opacity .15s var(--ease);
}

/* Tooltip am Cursor */
.plan__tip {
  position: absolute; z-index: 5; pointer-events: none; text-align: center;
  background: var(--deep); color: #fff; padding: .5rem .7rem; border-radius: 9px;
  font-size: .82rem; line-height: 1.4; white-space: nowrap;
  box-shadow: var(--shadow-sm); transform: translate(-50%, -118%);
}
.plan__tip b { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .15rem; }
.plan__tip span { display: block; font-weight: 500; opacity: .9; font-size: .78rem; }
.plan__tip .tip-status {
  display: inline-block; margin-top: .3rem; padding: .08rem .5rem; border-radius: 6px;
  font-weight: 700; font-size: .76rem; opacity: 1;
}
.plan__tip .tip-status.is-free { background: var(--green); color: #fff; }
.plan__tip .tip-status.is-occ { background: #c0392b; color: #fff; }

.plan__toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-top: .9rem; flex-wrap: wrap;
}
.plan__hint { font-size: .85rem; color: var(--ink-soft); }

/* --- Lightbox (Großansicht mit Zoom) --- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(8, 33, 38, .93); padding: clamp(.5rem, 2vw, 1.5rem);
}
.lightbox.is-open { display: block; }
.lightbox__scroll { position: relative; width: 100%; height: 100%; overflow: hidden; touch-action: none; }
.lightbox__canvas {
  position: absolute; top: 0; left: 0; width: 100%; max-width: 1040px;
  transform-origin: 0 0; will-change: transform; cursor: grab;
}
.lightbox__canvas img { display: block; width: 100%; height: auto; pointer-events: none; }
.lightbox__canvas .plan__overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Liegeplatz-Nummern: erst ab Zoomstufe (Klasse show-nums) sichtbar */
.lightbox__canvas.show-nums .berth__num { opacity: 1; }
.lightbox__close {
  position: absolute; top: .7rem; right: .9rem; z-index: 2;
  width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--deep); font-size: 1.6rem; line-height: 1;
  box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), background .25s;
}
.lightbox__close:hover { transform: scale(1.08); background: #fff; }

/* --- Legende (frei / belegt / Arbeitssteg) --- */
.plan__legend {
  display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap;
  margin: .6rem 0 .2rem; font-size: .82rem; color: var(--ink-soft);
}
.plan__legend span { display: inline-flex; align-items: center; }
.plan__legend i { width: .85rem; height: .85rem; border-radius: 3px; margin-right: .4rem; border: 1px solid rgba(0,0,0,.12); }
.plan__legend .leg-free { background: rgba(123, 160, 91, .85); }
.plan__legend .leg-occ  { background: rgba(192, 57, 43, .55); }
.plan__legend .leg-neutral { background: #e7eae5; }

/* --- Werkzeugleiste im Vollbild (Reset + Hilfe) --- */
.lightbox__tools {
  position: absolute; top: .8rem; left: 1rem; z-index: 3;
  display: flex; gap: .6rem; align-items: center; max-width: calc(100% - 5rem);
}
.lightbox__help { color: #fff; font-size: .78rem; opacity: .85; line-height: 1.3; }
@media (max-width: 560px) { .lightbox__help { display: none; } }

/* --- Info-Leiste (Bottom-Sheet) im Vollbild --- */
.plan__sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  background: #fff; color: var(--ink);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -8px 30px rgba(8, 33, 38, .25);
  padding: 1rem 1.2rem calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(110%); transition: transform .28s var(--ease);
}
.plan__sheet.is-open { transform: translateY(0); }
.plan__sheet b { display: block; font-size: 1.05rem; font-weight: 700; margin-bottom: .35rem; }
.plan__sheet span { display: inline-block; margin-right: .9rem; font-size: .9rem; color: var(--ink-soft); }
.plan__sheet .tip-status {
  display: inline-block; margin-top: .5rem; padding: .12rem .6rem; border-radius: 6px;
  font-weight: 700; font-size: .82rem; color: #fff;
}
.plan__sheet .tip-status.is-free { background: var(--green); }
.plan__sheet .tip-status.is-occ  { background: #c0392b; }
.plan__sheet__close {
  position: absolute; top: .5rem; right: .7rem; width: 2rem; height: 2rem;
  border: 0; background: none; color: var(--ink-soft); font-size: 1.5rem; line-height: 1; cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .plan__sheet { transition: none; }
  .lightbox__canvas { will-change: auto; }
}
