/* OVANIE Smart Search v1 */
.ovanie-search[data-smart-search] {
    position: relative !important;
    overflow: visible !important;
    isolation: isolate;
}

.ovanie-search[data-smart-search] .ovanie-search__field {
    position: relative;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    background: #fff;
}

.ovanie-search[data-smart-search] .ovanie-search__field-icon {
    width: 18px;
    height: 18px;
    margin-left: 15px;
    flex: 0 0 auto;
    color: #8b98aa;
    stroke-width: 2.2;
}

.ovanie-search[data-smart-search] .ovanie-search__field input {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 0 42px 0 10px !important;
    font-size: 13px;
}

.ovanie-search[data-smart-search] .ovanie-search__clear {
    position: absolute;
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    background: #eef2f7 !important;
    color: #536174 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
}

.ovanie-search[data-smart-search] .ovanie-search__clear[hidden] {
    display: none !important;
}

.ovanie-search[data-smart-search] .ovanie-search__clear svg {
    width: 15px !important;
    height: 15px !important;
}

.ovanie-search[data-smart-search] .ovanie-search__submit {
    position: static !important;
    width: auto !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    border-radius: 0 7px 7px 0 !important;
}

.ovanie-search[data-smart-search].is-open,
.ovanie-search[data-smart-search]:focus-within {
    z-index: 5005;
}

.ovanie-search-panel {
    position: absolute;
    z-index: 5006;
    top: calc(100% + 9px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: min(620px, calc(100vh - 150px));
    overflow: auto;
    background: #fff;
    color: #101828;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(2, 11, 28, .28), 0 6px 18px rgba(2, 11, 28, .10);
    overscroll-behavior: contain;
}

.ovanie-search-panel[hidden] {
    display: none !important;
}

.ovanie-search-panel::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 46%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #e3e8ef;
    border-top: 1px solid #e3e8ef;
    transform: rotate(45deg);
}

.ovanie-search-panel__loading,
.ovanie-search-panel__empty {
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: #667085;
    font-size: 13px;
}

.ovanie-search-panel__loading[hidden],
.ovanie-search-panel__empty[hidden] {
    display: none !important;
}

.ovanie-search-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #ff5a00;
    border-radius: 50%;
    animation: ovSearchSpin .7s linear infinite;
}

@keyframes ovSearchSpin {
    to { transform: rotate(360deg); }
}

.ovanie-search-panel__empty-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #f2f6ff;
    color: #0b3b91;
}

.ovanie-search-panel__empty-icon svg {
    width: 22px;
    height: 22px;
}

.ovanie-search-panel__empty strong,
.ovanie-search-panel__empty span {
    display: block;
}

.ovanie-search-panel__empty strong {
    color: #101828;
    margin-bottom: 3px;
}

.ovanie-search-group {
    padding: 14px 14px 8px;
}

.ovanie-search-group + .ovanie-search-group {
    border-top: 1px solid #edf0f4;
}

.ovanie-search-group__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 9px;
    padding: 0 4px;
    color: #667085;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ovanie-search-products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.ovanie-search-result {
    min-width: 0;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #101828;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.ovanie-search-result:hover,
.ovanie-search-result.is-active {
    background: #f7f9fc;
    border-color: #e3e8ef;
    transform: translateY(-1px);
}

.ovanie-search-result__image {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #edf0f4;
    border-radius: 9px;
    background: #f8fafc;
}

.ovanie-search-result__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ovanie-search-result__copy {
    min-width: 0;
}

.ovanie-search-result__category {
    display: block;
    margin-bottom: 3px;
    color: #155eef;
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ovanie-search-result__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #101828;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}

.ovanie-search-result__meta {
    margin-top: 5px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.ovanie-search-result__price {
    color: #ff5a00;
    font-size: 12px;
    font-weight: 950;
}

.ovanie-search-result__unit {
    color: #7a8699;
    font-size: 9px;
}

.ovanie-search-result__arrow {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #667085;
    background: #f2f4f7;
}

.ovanie-search-result__arrow svg {
    width: 14px;
    height: 14px;
}

.ovanie-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.ovanie-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #344054;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    transition: all .15s ease;
}

.ovanie-search-chip:hover,
.ovanie-search-chip.is-active {
    border-color: #ffb27e;
    background: #fff6f0;
    color: #c74300;
}

.ovanie-search-chip svg {
    width: 14px;
    height: 14px;
}

.ovanie-search-category-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.ovanie-search-category {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 9px;
    color: #24324a;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #edf0f4;
}

.ovanie-search-category:hover,
.ovanie-search-category.is-active {
    border-color: #bfd3ff;
    background: #f2f6ff;
    color: #0b3b91;
}

.ovanie-search-category__icon {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #155eef;
    background: #eaf1ff;
}

.ovanie-search-category__icon svg {
    width: 16px;
    height: 16px;
}

.ovanie-search-category strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.ovanie-search-panel__footer {
    position: sticky;
    bottom: 0;
    padding: 9px 14px 12px;
    background: linear-gradient(180deg, rgba(255,255,255,.82), #fff 35%);
}

.ovanie-search-panel__footer[hidden] {
    display: none !important;
}

.ovanie-search-panel__all {
    width: 100% !important;
    min-height: 39px !important;
    border-radius: 9px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: #061b43 !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 850 !important;
}

.ovanie-search-panel__all svg {
    width: 16px !important;
    height: 16px !important;
}

@media (max-width: 1120px) {
    .ovanie-search-products {
        grid-template-columns: 1fr;
    }

    .ovanie-search-panel {
        max-height: min(560px, calc(100vh - 130px));
    }
}

@media (max-width: 980px) {
    .ovanie-search-panel {
        position: fixed;
        top: 118px;
        left: 12px;
        right: 12px;
        width: auto;
        max-height: calc(100vh - 136px);
        border-radius: 14px;
    }

    .ovanie-search-panel::before {
        display: none;
    }
}

@media (max-width: 640px) {
    .ovanie-search[data-smart-search] .ovanie-search__field-icon {
        margin-left: 11px;
    }

    .ovanie-search-panel {
        top: 106px;
        left: 8px;
        right: 8px;
        max-height: calc(100vh - 114px);
    }

    .ovanie-search-products,
    .ovanie-search-category-list {
        grid-template-columns: 1fr;
    }

    .ovanie-search-result {
        grid-template-columns: 54px minmax(0, 1fr) auto;
    }

    .ovanie-search-result__image {
        width: 54px;
        height: 54px;
    }
}


/* V2 — une seule icône de recherche : uniquement le bouton orange */
.ovanie-search[data-smart-search] .ovanie-search__field-icon {
    display: none !important;
}

.ovanie-search[data-smart-search] .ovanie-search__field input {
    padding-left: 18px !important;
}

/* =========================================================
   OVANIE — SMART SEARCH MOBILE RESPONSIVE V6
   Search results stay attached to the search form and no longer
   cover the navigation links because mobile links live in drawer.
========================================================= */
@media (max-width: 980px) {
    .ovanie-search[data-smart-search] {
        position: relative !important;
        isolation: isolate;
    }

    .ovanie-search-panel {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: min(62vh, 520px) !important;
        border-radius: 12px !important;
    }

    .ovanie-search-panel::before {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .ovanie-search-panel {
        top: calc(100% + 7px) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: min(64vh, 480px) !important;
    }

    .ovanie-search[data-smart-search] .ovanie-search__field input {
        padding-left: 11px !important;
        padding-right: 38px !important;
    }
}
