/* Fahrzeugbörse, Override gegen site_package.css form-select-Reset (background:red).
   Höhere Spezifität, damit Tailwind-Klassen greifen. */
.fahrzeugboerse-filter select,
.fahrzeugboerse-detail select {
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23111315' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.75rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.25em 1.25em !important;
    padding-right: 2.5rem !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.fahrzeugboerse-filter input,
.fahrzeugboerse-filter textarea,
.fahrzeugboerse-detail input,
.fahrzeugboerse-detail textarea {
    background-color: #fff !important;
}

/* Disabled-Options im Filter visuell deutlich ausgrauen */
.fahrzeugboerse-filter select option:disabled {
    color: #c9c9cb !important;
    background-color: #f4f4f4 !important;
    font-style: italic;
}

/* Komplett deaktivierter Select (keine wählbaren Optionen mehr) */
.fahrzeugboerse-filter .fb-field--exhausted select,
.fahrzeugboerse-filter select[aria-disabled="true"] {
    background-color: #f4f4f4 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    border-color: #e5e7eb !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
}
.fahrzeugboerse-filter .fb-field--exhausted label {
    color: #9ca3af;
}
.fahrzeugboerse-filter .fb-field--exhausted::after {
    content: "Keine Auswahl möglich, anderen Filter lösen.";
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
    font-style: italic;
}

/* Active-Field (Filter gesetzt), deutlicher visueller Akzent */
.fahrzeugboerse-filter .fb-field--active label {
    color: #111315;
}
.fahrzeugboerse-filter .fb-field--active .fb-control {
    border-color: #05866e !important;
    border-width: 2px !important;
    background-color: #f0faf6 !important;
    color: #111315 !important;
    font-weight: 600 !important;
    box-shadow: 0 0 0 3px rgba(5, 134, 110, 0.10);
}
.fahrzeugboerse-filter .fb-field--active label::after {
    content: "AKTIV";
    display: inline-block;
    margin-left: 6px;
    background: #05866e;
    color: #fff;
    font-size: 9px;
    letter-spacing: 0.08em;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
}

/* Neutrale Selects: dezent grau, klar inactive */
.fahrzeugboerse-filter .fb-control {
    border-color: #d1d5db;
    background-color: #fafafa;
    color: #5d5d5d;
    font-weight: 400;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.fahrzeugboerse-filter .fb-control:hover:not([disabled]) {
    border-color: #5d5d5d;
    background-color: #fff;
    color: #111315;
}
.fahrzeugboerse-filter .fb-control:focus {
    border-color: #05866e !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(5, 134, 110, 0.20);
}

/* Aktive-Dot Marker, kleines pulsierendes Detail */
.fahrzeugboerse-filter .fb-active-dot {
    box-shadow: 0 0 0 3px rgba(5, 134, 110, 0.25);
    animation: fb-pulse 1.6s ease-out infinite;
}
@keyframes fb-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(5, 134, 110, 0.25); }
    50%      { box-shadow: 0 0 0 5px rgba(5, 134, 110, 0.10); }
}

/* Modal + Lightbox Basis */
.fb-modal[hidden], .fb-lightbox[hidden] { display: none !important; }
.fb-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.fb-lightbox { position: fixed; inset: 0; z-index: 9999; display: flex !important; align-items: center; justify-content: center; }
.fb-lightbox[hidden] { display: none !important; }
.fb-modal__backdrop, .fb-lightbox__backdrop {
    position: absolute; inset: 0;
    background: rgba(17, 19, 21, 0.7);
}
.fb-modal__dialog {
    position: relative; z-index: 1;
    background: #fff; border-radius: 0.5rem;
    max-width: 640px; width: 100%;
    max-height: calc(100vh - 2rem); overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.fb-modal[aria-hidden="false"], .fb-lightbox[aria-hidden="false"] { animation: fb-fade 0.2s ease-out; }
@keyframes fb-fade { from { opacity: 0; } to { opacity: 1; } }
body.fb-modal-open { overflow: hidden; }

/* Lightbox-Layout */
.fb-lightbox__backdrop { background: rgba(0, 0, 0, 0.92); }
.fb-lightbox__stage {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    padding: 4rem 1rem 1rem;
}
.fb-lightbox__image-wrap {
    flex: 1; display: flex; align-items: center; justify-content: center;
    min-height: 0;
}
.fb-lightbox__image {
    max-width: 100%; max-height: 100%; object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.fb-lightbox__thumbs {
    margin-top: 1rem;
    display: flex; gap: 0.5rem; overflow-x: auto;
    justify-content: center; padding: 0.25rem;
}
.fb-lightbox__thumbs button {
    flex: 0 0 auto; width: 72px; height: 72px;
    border: 2px solid transparent; border-radius: 0.25rem;
    overflow: hidden; padding: 0; cursor: pointer; background: #222;
}
.fb-lightbox__thumbs button.is-active { border-color: #fff; }
.fb-lightbox__thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Pfeil-Buttons (Slider + Lightbox) */
.fb-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.9); color: #111315;
    border: none; border-radius: 9999px; cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    transition: background .15s ease, transform .15s ease;
    z-index: 5;
}
.fb-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.fb-arrow--prev { left: 0.75rem; }
.fb-arrow--next { right: 0.75rem; }
.fb-lightbox .fb-arrow { background: rgba(255,255,255,0.15); color: #fff; }
.fb-lightbox .fb-arrow:hover { background: rgba(255,255,255,0.3); }

/* Zoom-Lupe-Button auf Hauptbild */
.fb-zoom {
    position: absolute; right: 0.75rem; top: 0.75rem;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.9); color: #111315;
    border: none; border-radius: 9999px; cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    z-index: 5;
}
.fb-zoom:hover { background: #fff; }

/* Lightbox-Close */
.fb-lightbox__close {
    position: absolute; right: 1rem; top: 1rem;
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.15); color: #fff;
    border: none; border-radius: 9999px; cursor: pointer;
    z-index: 10;
}
.fb-lightbox__close:hover { background: rgba(255,255,255,0.3); }

/* Counter im Stage */
.fb-lightbox__counter {
    position: absolute; left: 1rem; top: 1rem;
    color: #fff; font: 13px / 1 system-ui, sans-serif;
    background: rgba(255,255,255,0.1); padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
}

/* Aktive-Filter-Chips */
.fb-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.fb-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: #111315; color: #fff; border: 0; cursor: pointer;
    border-radius: 0.375rem; padding: 0.4rem 0.6rem;
    font: 600 11px / 1 ui-monospace, monospace; letter-spacing: 0.02em;
}
.fb-chip .lbl { opacity: 0.78; text-transform: uppercase; font-size: 9.5px; }
.fb-chip .x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; background: rgba(255,255,255,0.18);
    border-radius: 0.25rem; font-size: 13px; line-height: 1;
}
.fb-chip:hover .x { background: #05866e; }
.fb-chip-clear {
    background: transparent; color: #05866e; border: 0; cursor: pointer;
    text-decoration: underline; font: 11.5px / 1 ui-monospace, monospace;
    padding: 0.4rem 0.25rem;
}

/* Redaktionstext: Listen und Absätze nach dem Tailwind-Reset wieder lesbar */
.fahrzeugboerse-detail ul { list-style: disc; padding-left: 1.25rem; margin-top: .5rem; }
.fahrzeugboerse-detail p + p { margin-top: .5rem; }
