/* Główny CSS dla Divi Ajax Search */

/* Zapewnia widoczność dla widgetu wyszukiwania */
.widget_product_search.divi-ajax-search-ajs-active,
.widget_search.divi-ajax-search-ajs-active {
    overflow: visible;
}

/* Zmienne kolorów */
:root {
    --diviajs-background: #ffffff;
    --diviajs-background-hovered: #d5d5d5;
    --diviajs-border-colour: #f6f6f6;
    --diviajs-view-all-colour: #ff8057;
    --diviajs-view-all-highlight-colour: #ff5c26;
    --diviajs-view-all-button-font-color: #ffffff;
    --diviajs-view-all-button-font-color-hovered: #ffffff;
    --diviajs-text-colour: #ff8057;
}

/* Poprawka problemu z wynikami wyszukiwania, gdy menu jest pod modułem wyszukiwania */
div[class*="_tb_header"].et_pb_row:first-of-type {
    z-index: 999 !important;
}

/* Ustawienie overflow dla modułów wyszukiwania */
.et_search_outer,
.et_pb_module.et_pb_search {
    overflow: unset !important;
}

/* Domyślna etykieta "On Sale" WooCommerce */
.woocommerce-page span.onsale,
.woocommerce span.onsale {
    z-index: 1 !important;
}

/* Kontener wyników wyszukiwania */
.divi-ajax-search-ajs-results {
    position: absolute;
    overflow: hidden;
    top: 100%;
}

/* Stylizacja pola sugestii */
.divi-ajax-search-ajs-suggestions {
    border: 1px solid var(--diviajs-border-colour);
    border-top: 0;
    top: 0;
    left: 0;
    right: 0;
    background: var(--diviajs-background) !important;
}

/* Stylizacja pojedynczej sugestii */
.divi-ajax-search-ajs-suggestions > .autocomplete-suggestion {
    box-sizing: border-box;
    cursor: pointer;
    background: none;
    display: flex;
    transition: background 0.5s;
}

.divi-ajax-search-ajs-suggestions > .autocomplete-suggestion:hover,
.divi-ajax-search-ajs-suggestions > .autocomplete-suggestion.active {
    background: var(--diviajs-background-hovered) !important;
}

.divi-ajax-search-ajs-suggestions > .autocomplete-suggestion:last-child {
    border-bottom: none;
    margin-bottom: 10px;
}

.divi-ajax-search-ajs-suggestions > .autocomplete-no-suggestion {
    line-height: 40px;
    text-align: center;
}

.divi-ajax-search-ajs-hide .divi-ajax-search-ajs-suggestions,
.divi-ajax-search-ajs-hide .divi-ajax-search-ajs-view-all-holder {
    display: none !important;
}

/* Przyciski "View All" */
.divi-ajax-search-ajs-results.has-viewall-button {
    padding-bottom: 30px;
}

.divi-ajax-search-ajs-results.has-viewall-button .divi-ajax-search-ajs-suggestions {
    bottom: 30px;
}

.divi-ajax-search-ajs-view-all-holder {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    display: none;
}

.divi-ajax-search-ajs-view-all-holder > a {
    display: block;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: var(--diviajs-view-all-button-font-color) !important;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    background: var(--diviajs-view-all-colour);
    transition: background 0.5s;
}

.divi-ajax-search-ajs-view-all-holder > a:hover {
    background: var(--diviajs-view-all-highlight-colour);
    color: var(--diviajs-view-all-button-font-color-hovered) !important;
}

/* Tekst "Other results" */
.divi-ajax-search-ajs-other-result {
    height: 33px;
    line-height: 33px;
    background: #f5f3f3;
    text-align: left;
    color: #8b8888;
    text-transform: uppercase;
    padding-left: 10px;
    width: 100%;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.divi-ajax-search-ajs-other-result-wrap {
    cursor: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none;
}

/* Sugestie postów i produktów */
.divi-ajax-search-ajs-suggestions .divi-ajax-search-ajs-post,
.divi-ajax-search-ajs-suggestions .divi-ajax-search-ajs-product {
    width: 100%;
    color: #323232;
    display: flex;
    align-items: center; /* Wyrównanie pionowe */
    padding: 10px;
    transition: 0.2s all;
}

/* Kontener miniaturki */
.divi-ajax-search-ajs-post-thumbnail,
.divi-ajax-search-ajs-product-image {
    width: 50px; /* Ustaw pożądaną szerokość miniaturki */
    margin-right: 10px; /* Odstęp między obrazkiem a tytułem */
    flex-shrink: 0; /* Zapobiega zmniejszaniu się kontenera obrazka */
}

.divi-ajax-search-ajs-post-thumbnail img,
.divi-ajax-search-ajs-product-image img {
    width: 100%; /* Obrazek wypełnia całą szerokość kontenera */
    height: auto; /* Zachowanie proporcji */
    display: block; /* Usunięcie odstępów poniżej obrazka */
}

/* Stylizacja tytułu */
.divi-ajax-search-ajs-post-title,
.divi-ajax-search-ajs-product-title {
    flex-grow: 1; /* Pozwala tytułowi zająć pozostałą przestrzeń */
    font-size: 14px; /* Dostosuj rozmiar czcionki według potrzeb */
    color: #323232; /* Kolor tekstu */
}

/* Podświetlanie wyszukiwanego tekstu */
.divi-ajax-search-ajs-results span.match-text {
    text-decoration: underline;
    display: contents;
}

/* Stylizacja ceny produktu */
.divi-ajax-search-ajs-product-price {
    font-size: 13px;
    color: #de9915;
    font-weight: 600;
}

.divi-ajax-search-ajs-product-price ins {
    color: #de9915;
    font-weight: 600;
}

.divi-ajax-search-ajs-product-price del {
    margin-right: 5px;
    color: #999;
    font-weight: 400;
}

/* Etykieta typu posta w sugestiach */
.divi-ajax-search-ajs-post .divi-ajax-search-ajs-post-title span.post-type {
    text-transform: uppercase;
    color: #999;
    font-size: 11px;
    margin-left: auto;
    padding-left: 10px;
}

/* Poprawka koloru tekstu "No suggestion" w menu bocznym */
.et_slide_menu_top .autocomplete-no-suggestion {
    color: #666;
}

/* Dostosowania responsywne */
@media screen and (max-width: 768px) {
    .divi-ajax-search-ajs-results {
        min-width: 100vw;
        border: 0 !important;
        outline: 0 !important;
    }

    .divi-ajax-search-ajs-suggestions {
        min-width: 100%;
        border: 0 !important;
        outline: 0 !important;
    }
}

@media screen and (max-width: 480px) {
    .divi-ajax-search-ajs-post-thumbnail {
        width: 40px; /* Mniejsza szerokość miniaturki na urządzeniach mobilnych */
    }

    .divi-ajax-search-ajs-post-title {
        font-size: 13px;
    }
}
