/**
 * Copyright © 2026 Creative Punkx Studio – Denis Duchow. All rights reserved.
 *
 * Theme-agnostisches Styling für das SmartSearch-Header-Formular. Bewusst als eigenständige CSS
 * (per Modul-Layout geladen) statt theme-kompiliertem LESS -> greift auf JEDEM Theme, unabhängig
 * davon ob es Modul-LESS importiert. Akzentfarbe über CSS-Variable pro Shop überschreibbar.
 */
.cps-smartsearch { --cps-ss-accent: #0ABAB5; --cps-ss-border: #d9d9d9; --cps-ss-muted: #7d7d7d; }

/* Header-Suchblock: rechts neben dem Logo, Breite = Inhalt (nicht die ganze Headerbreite,
   sonst überlappt es das links gefloatete Logo). */
.cps-smartsearch.block-search { float: right; width: auto; margin: 0; padding: 0; }
.cps-smartsearch .block-content { margin: 0; }
.cps-smartsearch .cps-smartsearch__form { position: relative; margin: 0; }
.cps-smartsearch .cps-smartsearch__inner { width: 100%; }

/* Zeile: Kategorie LINKS | Suchfeld | Button */
.cps-smartsearch .cps-smartsearch__inner {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--cps-ss-border);
    border-radius: 6px;
    background: #fff;
    overflow: visible;
    min-width: 460px;
    max-width: 100%;
}

/* Kategorie-Vorfilter (natives Select) */
.cps-smartsearch .cps-smartsearch__cat {
    position: relative;
    flex: 0 0 auto;
    border-right: 1px solid var(--cps-ss-border);
}
.cps-smartsearch .cps-smartsearch__cat select {
    appearance: none; -webkit-appearance: none;
    border: 0; background: transparent;
    height: 44px; min-width: 150px; max-width: 210px;
    padding: 0 32px 0 14px;
    font-size: 14px; color: #1a1a1a; cursor: pointer;
    text-overflow: ellipsis;
}
.cps-smartsearch .cps-smartsearch__cat select:focus,
.cps-smartsearch .cps-smartsearch__cat select:focus-visible {
    outline: none;
    box-shadow: none;
    border: 0;
}
.cps-smartsearch .cps-smartsearch__cat::after {
    content: ''; position: absolute; right: 13px; top: 50%;
    width: 8px; height: 8px;
    border-right: 2px solid var(--cps-ss-muted);
    border-bottom: 2px solid var(--cps-ss-muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

/* Suchfeld */
.cps-smartsearch .cps-smartsearch__field { flex: 1 1 auto; margin: 0; }
.cps-smartsearch .cps-smartsearch__field .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cps-smartsearch .cps-smartsearch__field .control { position: static; border: 0; }
.cps-smartsearch .cps-smartsearch__field input#search {
    width: 100%; height: 44px;
    border: 0; background: transparent; box-shadow: none;
    padding: 0 14px; font-size: 15px; color: #1a1a1a;
}
.cps-smartsearch .cps-smartsearch__field input#search::placeholder { color: var(--cps-ss-muted); opacity: 1; }
.cps-smartsearch .cps-smartsearch__field input#search:focus { box-shadow: none; outline: none; }

/* Button — rechts am Feld im Flex-Fluss (Lumas position:absolute überschreiben, sonst
   liegt der Button über dem Eingabetext). */
.cps-smartsearch .cps-smartsearch__actions { flex: 0 0 auto; display: flex; }
.cps-smartsearch .cps-smartsearch__actions .action.search {
    position: static !important;
    display: flex; align-items: center; justify-content: center;
    height: 44px; width: auto; padding: 0 18px; margin: 0; top: auto; right: auto;
    background: var(--cps-ss-accent); border: 0; border-radius: 0 6px 6px 0;
    color: #fff; cursor: pointer; opacity: 1;
}
.cps-smartsearch .cps-smartsearch__actions .action.search:hover { background: #09918c; }
.cps-smartsearch .cps-smartsearch__actions .action.search:before { color: #fff; margin: 0; }

/* Autocomplete-Dropdown */
.cps-smartsearch .cps-smartsearch__results {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 120;
    background: #fff; border: 1px solid var(--cps-ss-border); border-radius: 6px;
    box-shadow: 0 18px 40px -18px rgba(0,0,0,.3); max-height: 72vh; overflow-y: auto; text-align: left;
}
.cps-smartsearch .cps-smartsearch__results.active { display: block; }
.cps-smartsearch .cps-ss-heading { display: block; padding: 10px 16px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--cps-ss-muted); }
.cps-smartsearch .cps-ss-cats { padding-bottom: 6px; border-bottom: 1px solid var(--cps-ss-border); }
.cps-smartsearch .cps-ss-cat { display: inline-block; margin: 0 8px 6px 16px; padding: 4px 12px; border: 1px solid var(--cps-ss-border); border-radius: 40px; font-size: 13px; color: #1a1a1a; }
.cps-smartsearch .cps-ss-cat:hover { border-color: var(--cps-ss-accent); color: var(--cps-ss-accent); }
.cps-smartsearch .cps-ss-products ul { margin: 0; padding: 0; list-style: none; }
.cps-smartsearch .cps-ss-product { display: flex; align-items: center; gap: 12px; padding: 9px 16px; color: #1a1a1a; }
.cps-smartsearch .cps-ss-product:hover { background: rgba(10,186,181,.08); }
.cps-smartsearch .cps-ss-img { flex: 0 0 48px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.cps-smartsearch .cps-ss-img img { max-width: 48px; max-height: 48px; width: auto; height: auto; }
.cps-smartsearch .cps-ss-text { display: flex; flex-direction: column; min-width: 0; }
.cps-smartsearch .cps-ss-name { font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cps-smartsearch .cps-ss-price { font-size: 13px; font-weight: 700; color: var(--cps-ss-accent); margin-top: 2px; }
.cps-smartsearch .cps-ss-empty { padding: 18px 16px; color: var(--cps-ss-muted); font-size: 14px; }
.cps-smartsearch .cps-ss-viewall { display: block; padding: 12px 16px; border-top: 1px solid var(--cps-ss-border); text-align: center; font-weight: 600; font-size: 14px; color: var(--cps-ss-accent); }
.cps-smartsearch .cps-ss-viewall:hover { background: rgba(10,186,181,.08); }

/* Responsive: Kategorie-Filter ausblenden (wenn zu eng), aber die SUCHE bleibt sichtbar
   (Luma versteckt auf Mobile das Feld hinter einer Toggle-Lupe -> hier erzwungen sichtbar,
   Suchfeld + Button volle Breite, analog zyklop-fashion / aesthetics-dreiland). */
@media (max-width: 768px) {
    .cps-smartsearch.block-search { float: none; width: 100%; clear: both; margin: 8px 0 0; }
    .cps-smartsearch .cps-smartsearch__cat { display: none; }
    .cps-smartsearch .cps-smartsearch__inner { min-width: 0; }
    .cps-smartsearch .block-content,
    .cps-smartsearch .cps-smartsearch__form,
    .cps-smartsearch .cps-smartsearch__field,
    .cps-smartsearch .cps-smartsearch__field .control,
    .cps-smartsearch #search { display: block !important; }
    .cps-smartsearch .cps-smartsearch__actions { display: flex !important; }
}
