/*
 * Wyszukiwarka produktów w nagłówku.
 * Wygląd odtworzony z produkcji: zaokrąglone pole z lupą po prawej,
 * lista podpowiedzi rozwijana pod polem.
 */

.mv-search {
    position: relative;
    display: flex;
    align-items: center;
}

.mv-search__box {
    position: relative;
    display: flex;
    align-items: center;
}

.mv-search__input {
    width: 146px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 7px 34px 7px 12px;
    border: 1.3px solid rgba(48, 48, 48, 0.35);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: #303030;
    line-height: 1.2;
    /* iOS dorysowuje własny styl polom type=search */
    -webkit-appearance: none;
    appearance: none;
}

.mv-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.mv-search__input:focus {
    outline: none;
    border-color: rgba(48, 48, 48, 0.8);
}

.mv-search__icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: rgba(48, 48, 48, 0.7);
    pointer-events: none;
}

.mv-search__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.mv-search__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Podpowiedzi ---------- */
.mv-search__results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100;
    min-width: 280px;
    max-width: 380px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1.3px solid rgba(48, 48, 48, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.mv-search__results[hidden] {
    display: none;
}

.mv-search__result {
    margin: 0;
    border-bottom: 1px solid #f3f4f6;
}

.mv-search__result:last-child {
    border-bottom: 0;
}

.mv-search__link {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.35;
    color: #111827;
    text-decoration: none;
}

.mv-search__result--active,
.mv-search__result:hover {
    background: #f9fafb;
}

.mv-search__empty {
    padding: 10px 14px;
    font-size: 14px;
    color: #6b7280;
}

/* Na wąskich ekranach menu układa się pionowo - pole ma wtedy pełną
   szerokość, a podpowiedzi nie mogą wychodzić poza ekran. */
@media (max-width: 600px) {
    .mv-search,
    .mv-search__box {
        width: 100%;
    }

    .mv-search__input {
        width: 100%;
    }

    .mv-search__results {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}
