/* WMG-Such-Layer — Design-Tokens identisch zur bisherigen Doofinder-Custom-CSS */
.wmg-search-layer {
    --wmg-surface: #f8f7f5;
    --wmg-surface-variant: #efedea;
    --wmg-high: #1a1a1a;
    --wmg-medium: #6f6e6a;
    --wmg-low: #9a9893;
    --wmg-outline: #e4e1db;

    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: var(--wmg-surface);
    color: var(--wmg-high);
    display: none;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 16px;
}
.wmg-search-layer.wmg-open { display: flex; }
body.wmg-search-lock { overflow: hidden; }

/* Login-Hinweis (nur anonym) */
.wmg-search-hint {
    background: #1a1a1a;
    color: #fff;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    flex: 0 0 auto;
}
.wmg-search-hint a { color: #fff; text-decoration: underline; font-weight: bold; }

/* Suchzeile */
.wmg-search-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 28px 10px;
    flex: 0 0 auto;
}
.wmg-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--wmg-outline);
    border-radius: 4px;
    padding: 14px 18px;
}
.wmg-search-box svg { flex: 0 0 auto; opacity: .75; }
.wmg-search-box input {
    flex: 1;
    border: 0;
    outline: 0;
    font-size: 17px;
    background: transparent;
    color: var(--wmg-high);
}
.wmg-search-box input::placeholder { color: var(--wmg-low); }
.wmg-search-close {
    flex: 0 0 auto;
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
    color: var(--wmg-medium);
    padding: 6px 14px;
}
.wmg-search-close:hover { color: var(--wmg-high); }

/* Meta-Zeile + Meldungen */
.wmg-search-meta {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 16px 32px 12px;
}
.wmg-search-meta h2 { font-size: 16px; font-weight: 700; margin: 0; }
.wmg-search-meta span { font-size: 13px; color: var(--wmg-medium); }
.wmg-search-noresult {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 24px 32px 4px;
}
.wmg-search-section {
    font-size: 16px;
    font-weight: 700;
    padding: 26px 32px 12px;
}

/* Ergebnis-Grid */
.wmg-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    padding: 0 32px 32px;
}
.wmg-search-card {
    background: #fff;
    border: 1px solid var(--wmg-outline);
    border-radius: 4px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--wmg-high);
}
.wmg-search-card:hover { border-color: var(--wmg-medium); color: var(--wmg-high); text-decoration: none; }
/* Nur das Haupt-Kartenbild (direktes Kind) — NICHT die Varianten-Thumbs! */
.wmg-search-card > img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    margin-bottom: 12px;
    background: #fff;
}
.wmg-search-card h3 { font-size: 15px; font-weight: 500; margin: 0 0 4px; }
.wmg-search-card .wmg-nr { font-size: 12.5px; color: var(--wmg-medium); margin-bottom: 8px; }
.wmg-search-card .wmg-price { font-size: 14px; font-weight: 600; margin-top: auto; }

/* Preis: Aktions-/Staffelpreis rot, Streichpreis durchgestrichen */
.wmg-search-card .wmg-price .wmg-sale { color: #e03131; }
.wmg-search-card .wmg-price .wmg-list {
    text-decoration: line-through;
    color: var(--wmg-medium);
    font-weight: 400;
    font-size: 12.5px;
    margin-left: 4px;
}

/* Stimmungsbild auf Teaser-Slots: gleiche quadratische Kachel wie im Listing,
   Foto fuellt die Flaeche */
.wmg-search-card > img.wmg-mood { object-fit: cover; }

/* Beliebte Suchbegriffe (Chips) */
.wmg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 32px 24px;
}
.wmg-chip {
    border: 1px solid var(--wmg-outline);
    background: #fff;
    color: var(--wmg-high);
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 14px;
    cursor: pointer;
}
.wmg-chip:hover { border-color: var(--wmg-high); }
.wmg-chip.wmg-chip-special { border-color: #e03131; color: #e03131; }
.wmg-chip.wmg-chip-special:hover { background: #e03131; color: #fff; }
.wmg-chip.wmg-active { background: var(--wmg-high); color: #fff; border-color: var(--wmg-high); }
.wmg-chip.wmg-chip-special.wmg-active { background: #e03131; color: #fff; border-color: #e03131; }

/* Service-Karten (anonym) — Karussell */
.wmg-search-carousel { display: flex; align-items: center; gap: 8px; padding: 0 20px 24px; }
.wmg-search-arrow {
    flex: 0 0 auto;
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 26px;
    color: var(--wmg-high);
    padding: 8px;
    user-select: none;
}
.wmg-search-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px;
    scrollbar-width: none;
}
.wmg-search-track::-webkit-scrollbar { display: none; }
.wmg-service-card {
    flex: 0 0 232px;
    background: #fff;
    border: 1px solid var(--wmg-outline);
    border-radius: 4px;
    padding: 22px 22px 18px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--wmg-high);
}
.wmg-service-card:hover { border-color: var(--wmg-medium); color: var(--wmg-high); text-decoration: none; }
.wmg-service-card img {
    width: 186px;
    height: 186px;
    object-fit: cover;
    align-self: center;
    margin-bottom: 18px;
}
.wmg-service-card h3 { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
.wmg-service-card p {
    font-size: 13px;
    line-height: 1.45;
    color: var(--wmg-medium);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wmg-service-card span {
    margin-top: auto;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.wmg-service-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 32px 24px;
}
.wmg-service-grid .wmg-service-card { flex: 0 0 232px; }

/* ---------- Inline-Varianten-Liste (klappt IN der Karte auf, Kartenbreite) ---------- */
.wmg-search-card { cursor: pointer; }
.wmg-search-card.wmg-open-card { border-color: var(--wmg-high); }
.wmg-expand {
    margin-top: 10px;
    border-top: 1px solid var(--wmg-outline);
    padding-top: 4px;
    animation: wmg-expand-in .15s ease-out;
    cursor: default;
}
@keyframes wmg-expand-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.wmg-expand-loading { padding: 14px 0; text-align: center; color: var(--wmg-medium); }

/* Details-Absprung ganz oben im aufgeklappten Bereich */
.wmg-expand-head {
    display: flex;
    justify-content: flex-end;
    padding: 6px 0 7px;
    border-bottom: 1px solid var(--wmg-outline);
}

/* Je Variante ein Block: kleines Varianten-Thumbnail links, Infos rechts */
.wmg-vitem {
    display: flex;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--wmg-outline);
}
.wmg-vitem:last-of-type { border-bottom: 0; }
.wmg-vthumb {
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--wmg-outline);
    border-radius: 4px;
}
.wmg-vbody { flex: 1; min-width: 0; }
.wmg-vhead { display: flex; align-items: center; gap: 7px; }
.wmg-vnr { font-weight: 600; font-size: 13.5px; }
.wmg-vlabel {
    color: var(--wmg-medium);
    font-size: 12.5px;
    line-height: 1.35;
    margin: 2px 0 0 16px;
    word-break: break-word;
}
.wmg-vtiers { margin: 4px 0 6px 16px; }
.wmg-tier { line-height: 1.5; font-size: 13.5px; }
.wmg-tier .wmg-sale { color: #e03131; font-weight: 600; }
.wmg-tier .wmg-list { text-decoration: line-through; color: var(--wmg-medium); font-size: 12px; margin-left: 4px; }
.wmg-tier-from { color: var(--wmg-medium); font-size: 12px; }
.wmg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.wmg-dot.wmg-ok { background: #2f9e44; }
.wmg-dot.wmg-out { background: var(--wmg-low); }
.wmg-vbuy { display: flex; align-items: center; gap: 8px; margin-left: 16px; }
.wmg-qty {
    width: 58px;
    padding: 6px 6px;
    border: 1px solid var(--wmg-outline);
    border-radius: 4px;
    font-size: 13.5px;
    text-align: center;
}
.wmg-add {
    border: 1px solid var(--wmg-high);
    background: var(--wmg-high);
    color: #fff;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background .12s;
}
.wmg-add:hover { background: #333; }
.wmg-add.wmg-added { background: #2f9e44; border-color: #2f9e44; }
.wmg-add:disabled { opacity: .6; cursor: wait; }
.wmg-expand-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 9px 0 0;
}
.wmg-details {
    font-size: 13.5px;
    color: var(--wmg-high);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Quickview-Modal MUSS ueber dem Such-Layer liegen (Layer z-index 2147483000) */
body.wmg-search-lock .modal { z-index: 2147483200; }
body.wmg-search-lock .modal-backdrop { z-index: 2147483100; }

/* Offcanvas-Warenkorb ("in den Warenkorb gelegt"-Hinweis) ueber Layer UND Quickview */
body.wmg-search-lock .offcanvas { z-index: 2147483400; }
body.wmg-search-lock .offcanvas-backdrop { z-index: 2147483350; }

.wmg-search-brand {
    margin-top: auto;
    padding: 14px 24px;
    text-align: right;
    font-size: 11px;
    letter-spacing: .2em;
    color: var(--wmg-low);
}

@media (max-width: 767px) {
    .wmg-search-layer { height: 100dvh; }
    .wmg-search-head { padding: 14px 14px 8px; }
    .wmg-search-meta, .wmg-search-noresult, .wmg-search-section { padding-left: 16px; padding-right: 16px; }
    .wmg-search-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 16px 24px; }
    .wmg-service-grid { padding: 0 16px 24px; }
    .wmg-search-carousel { padding: 0 8px 20px; }

    /* Chips mobil: EINE horizontal scrollbare Zeile, Ueberschrift weg —
       spart die Hoehe fuer die Ergebnisse */
    .wmg-chips-title { display: none; }
    .wmg-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 10px 16px 12px;
        -webkit-overflow-scrolling: touch;
    }
    .wmg-chips::-webkit-scrollbar { display: none; }
    .wmg-chip { flex: 0 0 auto; padding: 7px 14px; font-size: 13px; }
}

/* Quickview: Zurueck-Leiste oben links */
.wmg-qv-topbar {
    padding: 10px 14px 0;
}
.wmg-qv-back {
    border: 0;
    background: none;
    color: var(--wmg-high, #1a1a1a);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
