/**
 * SigmaSearch
 *
 * @author    Sigmanortec SRL
 * @copyright 2026 Sigmanortec SRL
 * @license   https://opensource.org/licenses/MIT MIT License
 */

.sigma-search {
    position: relative;
    width: 100%;
    max-width: 560px;
}

.sigma-search__form {
    display: flex;
    align-items: center;
    position: relative;
    border: 1px solid rgba(0, 0, 0, .18);
    border-radius: 6px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.sigma-search__form:focus-within {
    border-color: rgba(0, 0, 0, .45);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .06);
}

.sigma-search__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.3;
    color: inherit;
}

.sigma-search__submit,
.sigma-search__clear {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: inherit;
    padding: 0 12px;
    height: 40px;
    display: flex;
    align-items: center;
    opacity: .65;
}

.sigma-search__submit:hover,
.sigma-search__clear:hover { opacity: 1; }

.sigma-search__clear { font-size: 22px; line-height: 1; padding: 0 8px; }

/* --- lista de sugestii --- */

.sigma-dd {
    position: fixed;
    z-index: 100000;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
    overflow-y: auto;
    overscroll-behavior: contain;
    color: #1a1a1a;
}

.sigma-dd[hidden] { display: none; }

.sigma-dd__section {
    padding: 9px 14px 5px;
    font-size: 11px;
    letter-spacing: .07em;
    text-transform: uppercase;
    opacity: .5;
    font-weight: 600;
}

.sigma-dd__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    color: inherit;
    text-decoration: none;
    border-top: 1px solid rgba(0, 0, 0, .05);
}

.sigma-dd__item:first-of-type { border-top: 0; }

.sigma-dd__item:hover,
.sigma-dd__item.is-active,
.sigma-dd__cat:hover,
.sigma-dd__cat.is-active,
.sigma-dd__all.is-active {
    background: rgba(0, 0, 0, .04);
    text-decoration: none;
}

.sigma-dd__img {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(0, 0, 0, .03);
}

.sigma-dd--small .sigma-dd__img {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
}

.sigma-dd--large .sigma-dd__img {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
}

.sigma-dd--small .sigma-dd__name { font-size: 13px; -webkit-line-clamp: 1; }
.sigma-dd--large .sigma-dd__name { font-size: 15px; }

.sigma-dd--small .sigma-dd__item { padding-top: 6px; padding-bottom: 6px; }
.sigma-dd--large .sigma-dd__item { padding-top: 12px; padding-bottom: 12px; }

.sigma-dd__body { flex: 1 1 auto; min-width: 0; }

.sigma-dd__name {
    display: block;
    font-size: 14px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sigma-dd__name mark {
    background: rgba(255, 213, 0, .38);
    color: inherit;
    padding: 0;
    border-radius: 2px;
}

.sigma-dd__ref {
    display: block;
    font-size: 11px;
    opacity: .55;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.sigma-dd__meta {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sigma-dd__price { font-weight: 600; font-size: 14px; white-space: nowrap; }

.sigma-dd__stock {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Verde = pe stoc, rosu = epuizat. Culorile sunt opace intentionat: fondul
   listei vine de la tema si poate fi deschis sau inchis, iar o culoare
   transparenta se pierde exact pe fondul inchis — asa a si aratat varianta
   dinainte, in care produsul epuizat nu avea, practic, nicio bulina. */
.sigma-dd__stock.is-in { background: #2e9e4f; }
.sigma-dd__stock.is-out { background: #d0021b; }

.sigma-dd__cat {
    display: flex;
    justify-content: space-between;
    padding: 7px 14px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
}

.sigma-dd__cat span { opacity: .5; }

.sigma-dd__all {
    display: block;
    padding: 11px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border-top: 1px solid rgba(0, 0, 0, .08);
    color: inherit;
    text-decoration: none;
}

.sigma-dd__empty { padding: 18px 14px; text-align: center; opacity: .6; font-size: 14px; }

.sigma-dd__suggestion {
    padding: 9px 14px;
    font-size: 13px;
    background: rgba(255, 213, 0, .12);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

/* --- pagina de rezultate --- */

.sigma-results__suggestion,
.sigma-results__note { font-size: 14px; margin-bottom: 10px; }

.sigma-results__note { opacity: .7; font-style: italic; }

.sigma-results__facets {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin: 10px 0 18px;
}

.sigma-results__facets-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    opacity: .5;
    margin-right: 4px;
}

.sigma-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 4px 11px;
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 999px;
    font-size: 13px;
    color: inherit;
    text-decoration: none;
}

.sigma-chip:hover { background: rgba(0, 0, 0, .04); text-decoration: none; }
.sigma-chip span { opacity: .5; font-size: 11px; }

.sigma-empty { padding: 26px 0; }
.sigma-empty h2 { font-size: 19px; margin-bottom: 12px; }
.sigma-empty ul { padding-left: 20px; opacity: .75; line-height: 1.8; }

@media (max-width: 767px) {
    .sigma-search { max-width: none; }
    .sigma-dd { left: 8px !important; right: 8px; width: auto !important; }
}

@media (prefers-color-scheme: dark) {
    .sigma-search__form,
    .sigma-dd { background: #1c1c1e; border-color: rgba(255, 255, 255, .16); color: #f2f2f2; }
    .sigma-dd__item { border-top-color: rgba(255, 255, 255, .07); }
    .sigma-dd__item:hover,
    .sigma-dd__item.is-active { background: rgba(255, 255, 255, .07); }
    .sigma-dd__img { background: rgba(255, 255, 255, .06); }
}

/*
 * In modul de preluare, lista de sugestii a temei nu mai are voie sa apara.
 * Scriptul o si distruge, dar unele teme o reconstruiesc; regula asta o
 * tine ascunsa in orice caz.
 */
body.sigma-takeover ul.ui-autocomplete,
body.sigma-takeover .ui-autocomplete.ui-front {
    display: none !important;
}
