/* Marktplatz – ergänzt Bootstrap 5 (Helix Ultimate) */

.com-marktplatz .mp-karte {
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}

.com-marktplatz .mp-karte:hover {
    box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .08);
    transform: translateY(-2px);
}

.com-marktplatz .mp-bild {
    background: #f1f3f5;
    display: block;
}

.com-marktplatz .mp-bild img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.com-marktplatz .mp-kein-bild {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #868e96;
    font-size: .9rem;
}

/* Kategorie-Etikett – Farbe kommt aus den Kategorie-Optionen */
.com-marktplatz .mp-kat { font-weight: 500; }

/* Galerie */
.com-marktplatz .mp-hauptbild img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #f1f3f5;
}

.com-marktplatz .mp-thumb {
    border: 2px solid transparent;
    border-radius: .375rem;
    padding: 0;
    background: none;
    width: 88px;
    height: 66px;
    overflow: hidden;
    cursor: pointer;
}

.com-marktplatz .mp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.com-marktplatz .mp-thumb.active,
.com-marktplatz .mp-thumb:focus-visible {
    border-color: var(--bs-primary, #0d6efd);
}

.com-marktplatz .mp-beschreibung {
    white-space: normal;
    overflow-wrap: anywhere;
}

.com-marktplatz .mp-daten dt {
    font-weight: 600;
    font-size: .85rem;
    color: #6c757d;
}

.com-marktplatz .mp-daten dd {
    margin-bottom: .75rem;
}

.com-marktplatz .mp-daten dd:last-child {
    margin-bottom: 0;
}

/* Foto-Verwaltung (Frontend und Backend) */
.mp-fotos {
    border: 2px dashed transparent;
    border-radius: .5rem;
    transition: border-color .15s ease, background .15s ease;
}

.mp-fotos.mp-drag {
    border-color: var(--bs-primary, #0d6efd);
    background: rgba(13, 110, 253, .05);
}

.mp-foto-liste {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.mp-foto,
.mp-foto-plus {
    position: relative;
    width: 140px;
    height: 105px;
    border-radius: .5rem;
    overflow: hidden;
    flex: 0 0 auto;
}

.mp-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #f1f3f5;
}

/* Ohne JavaScript: Checkbox unter dem Bild */
.mp-fotos:not(.mp-js) .mp-foto {
    height: auto;
    overflow: visible;
}

.mp-fotos:not(.mp-js) .mp-foto img {
    height: 105px;
}

.mp-fotos.mp-js .mp-foto-fallback {
    display: none !important;
}

.mp-foto-x {
    position: absolute;
    top: .35rem;
    right: .35rem;
    width: 1.9rem;
    height: 1.9rem;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.mp-foto-x:hover,
.mp-foto-x:focus-visible {
    background: #c92a2a;
}

.mp-foto-entfernt img {
    opacity: .3;
    filter: grayscale(1);
}

.mp-foto-entfernt .mp-foto-x {
    background: var(--bs-primary, #0d6efd);
}

.mp-foto-neu::after {
    content: "neu";
    position: absolute;
    left: .35rem;
    bottom: .35rem;
    padding: 0 .4rem;
    border-radius: .25rem;
    background: rgba(47, 158, 68, .9);
    color: #fff;
    font-size: .75rem;
}

.mp-foto-plus {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    border: 2px dashed #adb5bd;
    background: transparent;
    color: #495057;
    font-size: .85rem;
    cursor: pointer;
}

.mp-foto-plus:hover:not(:disabled),
.mp-foto-plus:focus-visible {
    border-color: var(--bs-primary, #0d6efd);
    color: var(--bs-primary, #0d6efd);
}

.mp-foto-plus:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.mp-foto-plus-icon {
    font-size: 1.8rem;
    line-height: 1;
}

/* Lightbox (grosses Foto im Modal-Fenster) */
.com-marktplatz .mp-hauptbild {
    cursor: zoom-in;
}

html.mp-lb-offen {
    overflow: hidden;
}

.mp-lightbox {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, .92);
    color: #fff;
}

.mp-lightbox[open] {
    display: flex;
    flex-direction: column;
}

.mp-lightbox::backdrop {
    background: rgba(0, 0, 0, .92);
}

.mp-lb-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .75rem;
    flex: 0 0 auto;
}

.mp-lb-zaehler {
    font-size: .95rem;
    opacity: .85;
}

.mp-lb-buehne {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 3.5rem 1rem;
}

.mp-lb-bild {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    touch-action: pan-y;
}

.mp-lb-btn {
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
}

.mp-lb-btn:hover,
.mp-lb-btn:focus-visible {
    background: rgba(255, 255, 255, .3);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.mp-lb-zurueck,
.mp-lb-weiter {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.mp-lb-zurueck { left: .5rem; }
.mp-lb-weiter  { right: .5rem; }

@media (max-width: 575.98px) {
    .mp-lb-buehne { padding: 0 0 1rem; }
    .mp-lb-zurueck,
    .mp-lb-weiter { background: rgba(0, 0, 0, .45); }
}

/* Kleiner Editor für die Beschreibung (Frontend und Backend) */
.mp-ed-quelle {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
}

.mp-ed-leiste {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    padding: .35rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-bottom: 0;
    border-radius: .375rem .375rem 0 0;
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.mp-ed-knopf {
    min-width: 2.4rem;
    height: 2.1rem;
    padding: 0 .55rem;
    border: 1px solid transparent;
    border-radius: .3rem;
    background: transparent;
    color: inherit;
    font-size: .95rem;
    line-height: 1;
    cursor: pointer;
}

.mp-ed-knopf:hover,
.mp-ed-knopf:focus-visible {
    border-color: var(--bs-border-color, #ced4da);
    background: var(--bs-body-bg, #fff);
}

.mp-ed-knopf.active {
    border-color: var(--bs-primary, #0d6efd);
    background: rgba(13, 110, 253, .1);
    color: var(--bs-primary, #0d6efd);
}

.mp-ed-flaeche.form-control {
    min-height: 12rem;
    max-height: 32rem;
    overflow-y: auto;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mp-ed-flaeche p,
.mp-beschreibung p {
    margin: 0 0 .75rem;
}

.mp-ed-flaeche ul,
.mp-ed-flaeche ol,
.mp-beschreibung ul,
.mp-beschreibung ol {
    margin: 0 0 .75rem;
    padding-left: 1.5rem;
}

.mp-ed-flaeche > :last-child,
.mp-beschreibung > :last-child {
    margin-bottom: 0;
}

/* Kompakte Kacheln (ab 4 pro Zeile) */
.com-marktplatz .mp-kompakt .card-body {
    padding: .65rem .75rem;
}

.com-marktplatz .mp-kompakt .card-title {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: .35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.com-marktplatz .mp-kompakt .mp-kat {
    font-size: .7rem;
}

.com-marktplatz .mp-kompakt .card-body ul {
    font-size: .8rem;
}

.com-marktplatz .mp-kompakt .card-footer {
    padding: .35rem .75rem;
    font-size: .75rem;
}

.com-marktplatz .mp-kompakt .mp-kein-bild {
    font-size: .8rem;
}

/* Auf dem Handy (2 pro Zeile) noch etwas knapper */
@media (max-width: 575.98px) {
    .com-marktplatz .mp-kompakt .card-body {
        padding: .5rem .55rem;
    }

    .com-marktplatz .mp-kompakt .card-title {
        font-size: .9rem;
    }

    .com-marktplatz .mp-kompakt .card-body ul li:nth-child(n+2) {
        display: none; /* nur die erste Angabe zeigen */
    }
}

/* Fotos sortieren (Version 1.3.0) */
.mp-fotos.mp-js .mp-foto {
    cursor: grab;
}

.mp-fotos.mp-js .mp-foto:active {
    cursor: grabbing;
}

.mp-foto-zieht {
    opacity: .4;
}

.mp-foto-ziel {
    outline: 3px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

.mp-foto-titelbild {
    position: absolute;
    top: .35rem;
    left: .35rem;
    padding: .05rem .4rem;
    border-radius: .25rem;
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    display: none;
}

.mp-foto-erstes .mp-foto-titelbild {
    display: inline-block;
}

.mp-foto-erstes {
    box-shadow: 0 0 0 3px var(--bs-primary, #0d6efd);
}

.mp-foto-steuer {
    position: absolute;
    right: .35rem;
    bottom: .35rem;
    display: flex;
    gap: .25rem;
}

.mp-foto-pfeil {
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.mp-foto-pfeil:hover:not(:disabled),
.mp-foto-pfeil:focus-visible {
    background: var(--bs-primary, #0d6efd);
}

.mp-foto-pfeil:disabled {
    opacity: .3;
    cursor: default;
}

/* «neu»-Marke nach links unten, damit sie die Pfeile nicht verdeckt */
.mp-foto-neu::after {
    right: auto;
}
