/* ============================================================
   Liefergebietskarte im Info-Popup der Speisekarte
   (custom.deliverygate, zonenkarte.js + delivery-areas.blade.php)
   ============================================================ */

/* Erst sichtbar, wenn das Skript die Box übernommen hat. Ohne JS bleibt nur
   die Liste, statt einer grauen Fläche, die nie etwas zeigt. */
.eb-zk { display: none; margin: 0 0 12px; }
.eb-zk.is-an { display: block; }

.eb-zk__rahmen {
    position: relative;
    height: 210px;
    border-radius: var(--eb-radius-sm, 14px);
    overflow: hidden;
    background: #e9eef2;
    isolation: isolate;
}
@media (min-width: 576px) {
    .eb-zk__rahmen { height: 240px; }
}

.eb-zk__karte {
    position: absolute;
    inset: 0;
    background: #e9eef2;
}
.eb-zk__karte.leaflet-container,
.eb-zk-gross .leaflet-container {
    font: inherit;
    background: #e9eef2;
}

/* Alle Zonen deckend in einer Ebene, erst die Ebene ist durchscheinend
   (siehe Kopf von zonenkarte.js: keine Mischfarben bei Überlappung). */
.leaflet-ebZonen-pane { opacity: 0.42; }

.eb-zk__hinweis {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: none;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 16px;
    text-align: center;
    font-size: 13px;
    line-height: 1.45;
    color: var(--eb-text-soft, #5a6b75);
    pointer-events: none;
}
.eb-zk.is-laedt .eb-zk__hinweis--laedt,
.eb-zk.is-fehler .eb-zk__hinweis--fehler { display: flex; }

.eb-zk__gross {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1000; /* über Leaflets Ebenen (400 bis 800) */
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: var(--eb-text, #1b2b36);
    box-shadow: 0 1px 4px rgba(15, 30, 45, 0.25);
    font-size: 15px;
    cursor: pointer;
}
.eb-zk__gross:focus-visible { outline: 2px solid var(--eb-blue, #299fd1); outline-offset: 2px; }
.eb-zk.is-fehler .eb-zk__gross,
.eb-zk.is-laedt .eb-zk__gross { display: none; }

/* Am Handy ist die kleine Karte nur Vorschau, Zoomknöpfe dort verwirren. */
.eb-zk.is-beruehrung .eb-zk__rahmen .leaflet-control-zoom { display: none; }
.eb-zk.is-beruehrung .eb-zk__rahmen .leaflet-container { cursor: pointer; }

.eb-zk__tipp {
    margin: 6px 2px 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--eb-text-soft, #5a6b75);
}
.eb-zk.is-fehler .eb-zk__tipp { display: none; }
.eb-zk__tipp--touch { display: none; }
@media (hover: none) and (pointer: coarse) {
    .eb-zk__tipp--touch { display: inline; }
    .eb-zk__tipp--maus { display: none; }
}

/* Farbpunkt einer Zone, in Liste, Popup und Legende gleich. */
.eb-zk-punkt {
    display: inline-block;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--eb-zone, #5a6b75);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.eb-area__head .eb-zk-punkt { margin-right: -2px; }

/* Restaurant auf der Karte */
.eb-zk-haus { background: none; border: 0; }
.eb-zk-haus span {
    display: flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #1b2b36;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Popup beim Antippen einer Zone */
.eb-zk-popup .leaflet-popup-content-wrapper { border-radius: 12px; }
.eb-zk-popup .leaflet-popup-content {
    margin: 12px 14px;
    min-width: 190px;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--eb-text, #1b2b36);
}
.eb-zk-pop__kopf {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14.5px;
}
.eb-zk-pop__zeile {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 5px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}
.eb-zk-pop__zeile span { color: var(--eb-text-soft, #5a6b75); }
.eb-zk-pop__zeile b { font-weight: 600; white-space: nowrap; }

/* ----- Großansicht ----- */
.eb-zk-gross {
    position: fixed;
    inset: 0;
    z-index: 1070; /* über dem Bootstrap-Modal (1055) */
    display: flex;
    flex-direction: column;
    background: #fff;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
@media (min-width: 768px) {
    .eb-zk-gross {
        inset: 24px;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 24px 60px rgba(15, 30, 45, 0.3);
    }
}

.eb-zk-gross__kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px 8px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}
.eb-zk-gross__titel { font-size: 16px; color: var(--eb-text, #1b2b36); }
.eb-zk-gross__zu {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--eb-bg-soft, #f5f7fa);
    color: var(--eb-text, #1b2b36);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.eb-zk-gross__zu:focus-visible { outline: 2px solid var(--eb-blue, #299fd1); outline-offset: 2px; }

.eb-zk-gross__karte {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}

.eb-zk-gross__legende {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.eb-zk-chip {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    background: #fff;
    color: var(--eb-text, #1b2b36);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.eb-zk-chip small {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--eb-text-soft, #5a6b75);
}
.eb-zk-chip:focus-visible { outline: 2px solid var(--eb-blue, #299fd1); outline-offset: 2px; }
