/* Live Suche (rh_livesuche) */
.rhls-root {
    --rhls-accent: #009FE3;
    --rhls-bg: #ffffff;
    --rhls-fg: #1d2530;
    --rhls-muted: #6b7684;
    --rhls-line: #e6e9ed;
    --rhls-hover: #f3f6f9;
    --rhls-price: var(--rhls-fg);
    --rhls-sale: #d6293e;
    --rhls-radius: 8px;
    --rhls-img: 56px;
    --rhls-font: 14px;
    --rhls-width: 520px;
    --rhls-mega: 1100px;
    --rhls-dim: .5;
    --rhls-shadow: 0 12px 40px rgba(16, 24, 40, .18);
}
.rhls-t-dunkel {
    --rhls-bg: #171b21;
    --rhls-fg: #f2f4f7;
    --rhls-muted: #9aa4b2;
    --rhls-line: #2b323c;
    --rhls-hover: #222932;
    --rhls-sale: #ff6b7a;
    --rhls-shadow: 0 12px 40px rgba(0, 0, 0, .55);
}
.rhls-t-eckig { --rhls-radius: 0px; }
.rhls-t-rund { --rhls-radius: 18px; --rhls-hover: #f1f7fb; }
.rhls-t-minimal { --rhls-radius: 2px; --rhls-shadow: 0 2px 10px rgba(16, 24, 40, .1); --rhls-hover: #f6f6f6; }
.rhls-noshadow { --rhls-shadow: none; }

/* Template-eigene Vorschlaege ausblenden (NOVA typeahead) */
.rhls-on .twitter-typeahead .tt-menu { display: none !important; }
.rhls-lock, .rhls-lock body { overflow: hidden; }

.rhls-root, .rhls-root * { box-sizing: border-box; }
.rhls-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.rhls-backdrop {
    position: fixed; inset: 0; z-index: 2147483000;
    background: rgba(10, 14, 20, var(--rhls-dim));
}
.rhls-panel {
    position: absolute; z-index: 2147483001;
    display: flex; flex-direction: column;
    background: var(--rhls-bg); color: var(--rhls-fg);
    font-size: var(--rhls-font); line-height: 1.4; text-align: left;
    border: 1px solid var(--rhls-line); border-radius: var(--rhls-radius);
    box-shadow: var(--rhls-shadow); overflow: hidden;
}
.rhls-panel[hidden], .rhls-backdrop[hidden] { display: none !important; }
.rhls-panel.rhls-blank.rhls--dropdown { display: none; }
.rhls-panel a { color: inherit; text-decoration: none; }
.rhls-panel button { font: inherit; color: inherit; cursor: pointer; }

/* Kopf mit eigenem Suchfeld (Overlay-Layouts und mobil) */
.rhls-head { display: none; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rhls-line); }
.rhls--modal .rhls-head { display: flex; }
.rhls-logo { max-height: 36px; max-width: 160px; flex: none; }
.rhls-inputwrap { position: relative; flex: 1; min-width: 0; }
.rhls-input, .rhls-ghost {
    width: 100%; height: 46px; padding: 0 14px; margin: 0;
    font: inherit; font-size: 16px; line-height: 44px; letter-spacing: normal;
    border: 1px solid var(--rhls-line); border-radius: var(--rhls-radius);
}
.rhls-input { position: relative; background: transparent; color: var(--rhls-fg); outline: none; appearance: none; }
.rhls-input:focus { border-color: var(--rhls-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rhls-accent) 22%, transparent); }
.rhls-input::placeholder { color: var(--rhls-muted); opacity: 1; }
.rhls-ghost {
    position: absolute; inset: 0; border-color: transparent; background: var(--rhls-bg);
    color: var(--rhls-muted); white-space: pre; overflow: hidden; pointer-events: none;
}
.rhls-ghost-typed { visibility: hidden; }
.rhls-close {
    flex: none; width: 42px; height: 42px; padding: 0; border: 0; background: transparent;
    font-size: 28px !important; line-height: 1; border-radius: var(--rhls-radius);
}
.rhls-close:hover { background: var(--rhls-hover); }

.rhls-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.rhls-loading .rhls-body { opacity: .6; transition: opacity .15s .1s; }
.rhls-section { padding: 10px 12px 6px; }
.rhls-title {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px; padding: 0 4px;
    font-size: .78em; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--rhls-muted);
}
.rhls-clear { border: 0; background: none; padding: 0; font-size: 1em; text-transform: none; letter-spacing: 0; color: var(--rhls-accent) !important; }
.rhls-item { outline: none; }

/* Chips */
.rhls-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rhls-chips .rhls-title { flex: 0 0 100%; margin-bottom: 0; }
.rhls-chip {
    padding: 5px 12px; background: var(--rhls-hover); border: 1px solid transparent;
    border-radius: calc(var(--rhls-radius) * 2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rhls-chip:hover, .rhls-chip.rhls-active { border-color: var(--rhls-accent); color: var(--rhls-accent); }

/* Artikel */
.rhls-product {
    display: flex; align-items: center; gap: 12px; padding: 8px;
    border-radius: var(--rhls-radius);
}
.rhls-product:hover, .rhls-product.rhls-active, .rhls-link:hover, .rhls-link.rhls-active { background: var(--rhls-hover); }
.rhls-p-img {
    flex: none; width: var(--rhls-img); height: var(--rhls-img);
    display: flex; align-items: center; justify-content: center;
    background: #fff; border-radius: calc(var(--rhls-radius) / 2); overflow: hidden;
}
.rhls-p-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rhls-p-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rhls-p-name { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rhls-p-meta { font-size: .85em; color: var(--rhls-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rhls-p-price { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-weight: 600; color: var(--rhls-price); white-space: nowrap; }
.rhls-p-sale .rhls-p-now { color: var(--rhls-sale); }
.rhls-p-old { font-size: .85em; font-weight: 400; color: var(--rhls-muted); }
.rhls-badge {
    padding: 1px 6px; font-size: .75em; font-weight: 700; color: #fff; background: var(--rhls-sale);
    border-radius: calc(var(--rhls-radius) / 2);
}
.rhls-hl mark { padding: 0; background: none; color: var(--rhls-accent); font-weight: 700; }

/* Kategorien, Marken, Seiten, Blog */
.rhls-link { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--rhls-radius); }
.rhls-link-img { width: 28px; height: 28px; object-fit: contain; background: #fff; border-radius: 4px; flex: none; }
.rhls-link-sub { margin-left: auto; padding-left: 8px; font-size: .85em; color: var(--rhls-muted); white-space: nowrap; }

/* Hinweise, Weiterleitung, Banner, Fusszeile */
.rhls-note, .rhls-none { padding: 12px 16px 4px; color: var(--rhls-muted); }
.rhls-none { padding-bottom: 12px; font-size: 1.05em; color: var(--rhls-fg); }
.rhls-redirect {
    display: flex; align-items: center; gap: 8px; margin: 10px 12px 0; padding: 10px 12px;
    border: 1px solid var(--rhls-accent); border-radius: var(--rhls-radius);
}
.rhls-redirect.rhls-active, .rhls-redirect:hover { background: var(--rhls-hover); }
.rhls-redirect-label { color: var(--rhls-muted); }
.rhls-redirect::after { content: "\2192"; margin-left: auto; color: var(--rhls-accent); }
.rhls-banner { display: block; margin: 10px 12px 0; border-radius: var(--rhls-radius); overflow: hidden; position: relative; }
.rhls-banner img { display: block; width: 100%; height: auto; }
.rhls-banner-text { display: block; padding: 8px 12px; background: var(--rhls-hover); font-weight: 600; }
.rhls-banner.rhls-active { outline: 2px solid var(--rhls-accent); }
.rhls-all {
    display: block; padding: 12px 16px; text-align: center; font-weight: 600;
    color: var(--rhls-accent) !important; border-top: 1px solid var(--rhls-line);
    position: sticky; bottom: 0; background: var(--rhls-bg);
}
.rhls-all:hover, .rhls-all.rhls-active { background: var(--rhls-hover); }

/* Layout: Dropdown – eine Spalte, Vorschlaege oben, Artikel, dann der Rest */
.rhls--dropdown .rhls-body { display: flex; flex-direction: column; }
.rhls--dropdown .rhls-side { display: contents; }
.rhls--dropdown .rhls-section.rhls-chips { order: 1; }
.rhls--dropdown .rhls-main { order: 2; }
.rhls--dropdown .rhls-side > .rhls-section:not(.rhls-chips) { order: 3; }
.rhls--dropdown .rhls-all { order: 9; margin-top: 6px; }

/* Layout: Overlays */
.rhls--modal { position: fixed; top: 0; left: 0; right: 0; max-height: 100vh; max-height: 100dvh; }
.rhls--wide { border-width: 0 0 1px; border-radius: 0 0 var(--rhls-radius) var(--rhls-radius); max-height: 88vh; }
.rhls--wide .rhls-head, .rhls--wide .rhls-body { padding-left: max(16px, calc((100vw - 1280px) / 2)); padding-right: max(16px, calc((100vw - 1280px) / 2)); }
.rhls--mega { top: 5vh; left: 50%; right: auto; transform: translateX(-50%); width: min(var(--rhls-mega), calc(100vw - 32px)); max-height: 88vh; }
.rhls--wide .rhls-body.rhls-has-results, .rhls--mega .rhls-body.rhls-has-results,
.rhls--wide .rhls-body.rhls-empty, .rhls--mega .rhls-body.rhls-empty {
    display: grid; grid-template-columns: minmax(220px, 280px) 1fr; align-content: start;
}
.rhls--wide .rhls-body.rhls-noside, .rhls--mega .rhls-body.rhls-noside { grid-template-columns: 1fr; }
.rhls--wide .rhls-side, .rhls--mega .rhls-side { border-right: 1px solid var(--rhls-line); padding-bottom: 8px; }
.rhls--wide .rhls-all, .rhls--mega .rhls-all { grid-column: 1 / -1; }
.rhls--wide .rhls-grid, .rhls--mega .rhls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.rhls--wide .rhls-product, .rhls--mega .rhls-product {
    flex-direction: column; align-items: stretch; gap: 8px; padding: 10px;
    border: 1px solid var(--rhls-line);
}
.rhls--wide .rhls-p-img, .rhls--mega .rhls-p-img { width: 100%; height: 150px; }
.rhls--wide .rhls-p-price, .rhls--mega .rhls-p-price { flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* Mobil: immer bildschirmfuellend */
.rhls--fullscreen { bottom: 0; height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
.rhls--fullscreen .rhls-head { padding: 10px 12px; gap: 8px; }
.rhls--fullscreen .rhls-logo { display: none; }
.rhls--fullscreen .rhls-body { display: flex; flex-direction: column; }
.rhls--fullscreen .rhls-side { display: contents; }
.rhls--fullscreen .rhls-section.rhls-chips { order: 1; }
.rhls--fullscreen .rhls-main { order: 2; }
.rhls--fullscreen .rhls-side > .rhls-section:not(.rhls-chips) { order: 3; }
.rhls--fullscreen .rhls-all { order: 9; margin-top: auto; }
.rhls--fullscreen .rhls-link, .rhls--fullscreen .rhls-chip { padding-top: 9px; padding-bottom: 9px; }

@media (prefers-reduced-motion: no-preference) {
    .rhls--modal { animation: rhls-in .16s ease-out; }
    .rhls--mega { animation-name: rhls-in-mega; }
}
@keyframes rhls-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes rhls-in-mega { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
