/* =========================================================
   meelo Gewerbe – Verzeichnis & Cards (v2)
   ========================================================= */
.mg-wrap { font-family: 'DM Sans', system-ui, sans-serif; }

/* ── Filter Bar ────────────────────────────────────────── */
.mg-filter-bar {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
    margin-bottom: 24px; padding: 16px 20px;
    background: #fff; border: 1.5px solid #e5e3de; border-radius: 14px;
}
.mg-search-wrap { position: relative; flex: 1; min-width: 200px; }
.mg-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 16px; pointer-events: none; }
.mg-search-input {
    width: 100%; padding: 10px 12px 10px 38px;
    border: 1.5px solid #e5e3de; border-radius: 9px;
    font-size: 14px; font-family: inherit; outline: none;
    transition: border-color .15s; background: #fff; color: #1a1916;
}
.mg-search-input:focus { border-color: var(--meelo-primary,#2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,.06); }
.mg-branch-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.mg-branch-btn {
    padding: 7px 16px; border: 1.5px solid #e5e3de; border-radius: 20px;
    background: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
    color: #4b4a45; font-family: inherit; transition: all .15s;
}
.mg-branch-btn:hover { border-color: var(--meelo-primary,#2563eb); color: var(--meelo-primary,#2563eb); }
.mg-branch-btn.active { background: var(--meelo-primary,#2563eb); border-color: var(--meelo-primary,#2563eb); color: #fff; }
.mg-view-toggle { display: flex; gap: 4px; }
.mg-view-btn {
    width: 36px; height: 36px; border: 1.5px solid #e5e3de; border-radius: 8px;
    background: #fff; cursor: pointer; font-size: 15px;
    display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.mg-view-btn.active { background: var(--meelo-primary,#2563eb); border-color: var(--meelo-primary,#2563eb); color: #fff; }

/* ── Map View ──────────────────────────────────────────── */
#mg-map-view { margin-bottom: 24px; }
#mg-leaflet-map { height: 420px; border-radius: 14px; border: 1.5px solid #e5e3de; overflow: hidden; }

/* ── Grid ──────────────────────────────────────────────── */
.mg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px,1fr)); gap: 18px; }

/* ── Card ──────────────────────────────────────────────── */
.mg-card {
    background: #fff; border: 1px solid #e5e3de; border-radius: 16px;
    overflow: hidden; transition: all .2s; display: flex; flex-direction: column;
    position: relative;
}
.mg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,.09);
    border-color: var(--card-color, var(--meelo-primary,#2563eb));
}

/* Card Header / Bild */
.mg-card-header {
    position: relative; height: 148px;
    background-size: cover; background-position: center;
    background-color: #f3f2ef; overflow: hidden;
}
.mg-card-header::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.3) 100%);
}
.mg-card-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; font-size: 44px; opacity: .5;
}

/* Logo */
.mg-card-logo {
    position: absolute; bottom: -16px; left: 14px; z-index: 2;
    width: 52px; height: 52px; border-radius: 12px;
    background: #fff; border: 2px solid #e5e3de;
    padding: 5px; box-shadow: 0 2px 8px rgba(0,0,0,.1);
    display: flex; align-items: center; justify-content: center;
}
.mg-card-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Öffnungs-Badge */
.mg-open-badge {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    font-size: 11px; font-weight: 800; padding: 3px 10px;
    border-radius: 20px; backdrop-filter: blur(4px);
}
.mg-open-badge.open   { background: rgba(22,163,74,.85);  color: #fff; }
.mg-open-badge.closed { background: rgba(0,0,0,.4);       color: rgba(255,255,255,.8); }

/* Card Body */
.mg-card-body { padding: 24px 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.mg-card-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.mg-card-branch {
    font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .08em; color: var(--card-color, var(--meelo-primary,#2563eb));
}
.mg-card-ort { font-size: 12px; color: #9ca3af; }
.mg-card-title { font-size: 16px; font-weight: 700; color: #1a1916; margin: 4px 0 0; line-height: 1.25; }
.mg-card-title a { text-decoration: none; color: inherit; transition: color .12s; }
.mg-card-title a:hover { color: var(--meelo-primary,#2563eb); }
.mg-card-excerpt { font-size: 13.5px; color: #6b7280; line-height: 1.55; margin: 4px 0; flex: 1; }

/* Card Footer */
.mg-card-footer {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px 14px; border-top: 1px solid #f3f2ef; margin-top: 4px;
}
.mg-btn-primary {
    flex: 1; text-align: center; padding: 9px 12px;
    background: var(--meelo-primary,#2563eb); color: #fff;
    border-radius: 9px; font-size: 13px; font-weight: 700;
    text-decoration: none; transition: all .12s; font-family: inherit;
}
.mg-btn-primary:hover { filter: brightness(.9); transform: translateY(-1px); }
.mg-btn-icon {
    width: 36px; height: 36px; border: 1.5px solid #e5e3de; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; text-decoration: none; transition: all .12s;
    background: #fff; flex-shrink: 0;
}
.mg-btn-icon:hover { border-color: var(--meelo-primary,#2563eb); background: #eff6ff; }

/* ── Leer-State ────────────────────────────────────────── */
.mg-empty {
    text-align: center; padding: 64px 24px;
    background: #fff; border-radius: 14px; border: 1px solid #e5e3de;
}
.mg-empty::before { content: '🏪'; display: block; font-size: 56px; opacity: .35; margin-bottom: 14px; }

/* ── No Results ────────────────────────────────────────── */
#mg-no-results { padding: 48px 24px; background: #fff; border-radius: 14px; border: 1px solid #e5e3de; color: #9ca3af; text-align: center; }

/* ── Load More ─────────────────────────────────────────── */
.mg-load-more-wrap { text-align: center; margin-top: 28px; }
.mg-load-more-btn {
    padding: 12px 32px; border: 1.5px solid #e5e3de; border-radius: 10px;
    background: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
    color: #4b4a45; font-family: inherit; transition: all .15s;
}
.mg-load-more-btn:hover { border-color: var(--meelo-primary,#2563eb); color: var(--meelo-primary,#2563eb); }

@media (max-width: 600px) {
    .mg-grid { grid-template-columns: 1fr; }
    .mg-filter-bar { flex-direction: column; align-items: stretch; }
    .mg-branch-filter { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
}
