/* Quadix Händlersuche: neutrale Optik, fügt sich in gängige Themes ein */

.qhs {
    margin: 0 auto;
    max-width: 1100px;
    /* Akzentfarbe je Einsatzort; Standard: Quadix-Gelb (quadix.de) */
    --qhs-accent: #eab308;
    --qhs-accent-text: #1c1917;
}

/* Marken-Themes für die Shortcode-Varianten (marke="…") */
.qhs-theme-4trac {
    --qhs-accent: #ff4001; /* 4trac.de */
    --qhs-accent-text: #ffffff;
    color: #f4f4f5; /* 4trac.de ist dunkel → Widget im Darkmode */
}

.qhs-theme-4trac .qhs-search {
    background: #18181b;
    border-color: #3f3f46;
    color: #f4f4f5;
}

.qhs-theme-4trac .qhs-search::placeholder {
    color: #71717a;
}

.qhs-theme-4trac .qhs-chip:not(.is-active):not(.qhs-chip-logo-only) {
    background: #18181b;
    border-color: #3f3f46;
    color: #e4e4e7;
}

.qhs-theme-4trac .qhs-switch-track {
    background: #3f3f46;
}

.qhs-theme-4trac .qhs-legend,
.qhs-theme-4trac .qhs-count,
.qhs-theme-4trac .qhs-nopin {
    color: #a1a1aa;
}

.qhs-theme-4trac .qhs-card {
    background: #1f1f23;
}

.qhs-theme-4trac .qhs-card-name,
.qhs-theme-4trac .qhs-popup-name {
    color: #ffffff;
}

.qhs-theme-4trac .qhs-card-address,
.qhs-theme-4trac .qhs-popup-address {
    color: #c9c9d1;
}

.qhs-theme-4trac .qhs-row-muted,
.qhs-theme-4trac .qhs-popup-brands {
    color: #9d9da6;
}

/* Leaflet-Popups im Darkmode */
.qhs-theme-4trac .leaflet-popup-content-wrapper,
.qhs-theme-4trac .leaflet-popup-tip {
    background: #1f1f23;
    color: #f4f4f5;
}

.qhs-theme-4trac .leaflet-popup-close-button {
    color: #a1a1aa;
}

.qhs-theme-odes {
    --qhs-accent: #ed3333; /* odesindustry.de */
    --qhs-accent-text: #ffffff;
}

.qhs-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
}

.qhs-search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid #d4d4d8;
    border-radius: 8px;
    font-size: 15px;
}

.qhs-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Marken links, Premium-Switch und Zurücksetzen rechts */
.qhs-filter-row .qhs-chips + .qhs-chips {
    margin-left: auto;
}

.qhs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qhs-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #d4d4d8;
    border-radius: 999px;
    background: #fff;
    color: #27272a;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.qhs-chip:hover {
    border-color: #a1a1aa;
}

.qhs-chip.is-active {
    background: var(--qhs-accent);
    border-color: var(--qhs-accent);
    color: var(--qhs-accent-text);
    font-weight: 600;
}

.qhs-search:focus {
    border-color: var(--qhs-accent);
    outline: none;
}

.qhs-chip-logo {
    height: 30px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    display: block;
}

/* Logo-Chips: nur das Logo, ganz ohne Rahmen, Ring oder Unterstrich */
.qhs-chip-logo-only,
.qhs-chip-logo-only:hover,
.qhs-chip-logo-only:focus,
.qhs-chip-logo-only:focus-visible,
.qhs-chip-logo-only.is-active {
    background: transparent;
    border: none;
    box-shadow: none;
    outline: none;
}

.qhs-chip-logo-only {
    padding: 4px 6px;
    transition: filter 0.15s, opacity 0.15s;
}

/* Ist eine Marke gewählt, treten die übrigen Logos zurück */
.qhs-chips.has-selection .qhs-chip-logo-only:not(.is-active) {
    filter: grayscale(1);
    opacity: 0.45;
}

.qhs-chips.has-selection .qhs-chip-logo-only:hover {
    filter: none;
    opacity: 1;
}

/* Filter zurücksetzen */
.qhs-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: transparent;
    border: none;
    color: #71717a;
    font-size: 14px;
    cursor: pointer;
}

.qhs-reset:hover {
    color: var(--qhs-accent);
}

.qhs-reset .qhs-icon {
    color: currentColor;
    width: 13px;
    height: 13px;
}

.qhs-theme-4trac .qhs-reset {
    color: #a1a1aa;
}

.qhs-theme-4trac .qhs-reset:hover {
    color: var(--qhs-accent);
}

/* Premium-Filter als Toggle-Switch */
.qhs-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.qhs-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.qhs-switch-track {
    flex: none;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d4d4d8;
    position: relative;
    transition: background 0.15s;
}

.qhs-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: left 0.15s;
}

.qhs-switch input:checked + .qhs-switch-track {
    background: var(--qhs-accent);
}

.qhs-switch input:checked + .qhs-switch-track::after {
    left: 21px;
}

.qhs-map-wrap {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.qhs-map {
    height: 480px;
    width: 100%;
    z-index: 0;
}

.qhs-marker {
    background: transparent;
    border: none;
}

.qhs-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 10px 2px 0;
    font-size: 13px;
    color: #52525b;
}

.qhs-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qhs-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid #1f2937;
    display: inline-block;
}

.qhs-count {
    margin: 14px 2px 8px;
    font-size: 14px;
    color: #52525b;
}

.qhs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    grid-auto-rows: 1fr; /* alle Kästen gleich hoch */
    gap: 14px;
}

/* Ergebnisse als gleich große Kästen ohne Rahmen; Schrift kommt vom Theme */
.qhs-card {
    background: #f4f4f5;
    border: none;
    padding: 18px 20px;
    font: inherit;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qhs-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.qhs-card-name {
    font-weight: 650;
    font-size: 1.05em;
    letter-spacing: 0.01em;
}

.qhs-card-address {
    color: #52525b;
}

/* Kontakt-Zeilen mit Icons (Karte + Popup) */
.qhs-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: auto; /* Kontakt bündig nach unten, Kästen wirken aufgeräumt */
}

.qhs-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: inherit;
    text-decoration: none;
}

a.qhs-row:hover {
    color: var(--qhs-accent);
    text-decoration: none;
}

.qhs-row-muted {
    color: #71717a;
    font-size: 0.9em;
}

.qhs-icon {
    width: 15px;
    height: 15px;
    flex: none;
    color: var(--qhs-accent);
}

.qhs-distance {
    margin-top: -2px;
}

.qhs-card-clickable {
    cursor: pointer;
}

.qhs-card-clickable:hover {
    opacity: 0.7;
}

.qhs-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 600;
    vertical-align: 1px;
}

.qhs-badge-premium { background: #ffedd5; color: #9a3412; }
.qhs-badge-exclusive { background: #fef9c3; color: #854d0e; }

.qhs-nopin {
    color: #a1a1aa;
    font-size: 0.85em;
}

.qhs-distance {
    color: #52525b;
    font-size: 0.85em;
}

.qhs-popup {
    font-size: 13.5px;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.qhs-popup-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.qhs-popup-name {
    font-size: 15px;
    font-weight: 650;
}

.qhs-popup-address {
    color: #52525b;
}

.qhs-popup-brands {
    color: #71717a;
    font-size: 0.92em;
}

@media (max-width: 640px) {
    .qhs-map { height: 360px; }
}
