/* Loaded at the very end of the page (before.body.end) to override Amasty Xsearch generated CSS without using !important. */

/* Fix: Amasty sets an excessive padding-right when input is "typed". */
.search-header.amsearch-form-block {
    position: initial;
}

.search-header .amsearch-input-wrapper .amsearch-input {
    width: 100%;
    border-color: var(--color-fg) !important;
    border-radius: 10px;
    height: 54px;
    padding-left: 40px !important;
}

.search-header .amsearch-input-wrapper .amsearch-input::placeholder {
    color: var(--color-fg) !important;
}

.search-header .amsearch-button.-loupe {
    left: 10px;
    right: auto !important;
    background-image: url("data:image/svg+xml,%3Csvg width='21' height='21' viewBox='0 0 21 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.75 19.75L15.2187 15.2187M17.6667 9.33333C17.6667 13.9357 13.9357 17.6667 9.33333 17.6667C4.73096 17.6667 1 13.9357 1 9.33333C1 4.73096 4.73096 1 9.33333 1C13.9357 1 17.6667 4.73096 17.6667 9.33333Z' stroke='%231E1E1E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-size: 18px !important;

}

.search-header .amsearch-result-section {
    top: 162px;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.2);
    border-radius: 0;
    max-height: 90vh;
}

.amsearch-items-section {
    display: none !important;
}

.amsearch-products-section .amsearch-product-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 20px;
    max-width: 1280px;
    margin: 0 auto;
}

.amsearch-products-section .amsearch-link {
    color: var(--color-sw-rose);
}

.amsearch-products-section.-grid:not(.-slider) .amsearch-item {
    max-width: 100%;
}

.amsearch-products-section .amsearch-item {
    padding: 10px;
}

.amsearch-products-section .amsearch-block-header {
    padding-bottom: 5px;
    border-bottom: 1px solid var(--color-zinc-300);
    margin: 0 auto;
    max-width: 1280px;
}

.amsearch-message-block {
    justify-content: start;
    background:#fff;
}

.amsearch-message-block ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin-top: 0.5rem;
}

.amsearch-message-block p + p {
    margin-top: 0.5rem;
}



@media (min-width: 1024px) {
    body:has(.amsearch-result-section:not([style*="display: none"])) {
        overflow: hidden;
    }
}

@media (max-width: 1023px) {
    /* Compiled styles.css may still lock body scroll — that closes the Android keyboard */
    body:has(.amsearch-result-section:not([style*="display: none"])) {
        overflow: visible !important;
    }
      body:has(.amsearch-result-section:not([style*="display: none"])).-amsearch-overlay-opened {
        overflow: hidden !important;
    }
    .amsearch-wrapper-block-hyva {
        position: relative;
        width: 100%;
    }

    .search-header.amsearch-form-block {
        position: relative;
    }

    .amsearch-overlay.amsearch-overlay--hyva {
        position: fixed;
        inset: 0;
        z-index: 140;
        background: rgba(0, 0, 0, 0.19);
        /* Let taps reach the search input on Android; outside clicks still close via Alpine. */
        pointer-events: none;
    }

    .search-header .amsearch-button.-loupe {
        pointer-events: none;
    }

    .search-header .amsearch-input-wrapper .amsearch-input {
        position: relative;
        z-index: 2;
    }

    #header,
    #header>div,
    .amsearch-wrapper-block-hyva,
    .search-header.amsearch-form-block {
        overflow: visible;
    }

    .search-header.amsearch-form-block.-opened {
        z-index: 151;
    }

    .search-header .amsearch-result-section {
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }

    .amsearch-products-section .amsearch-product-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px;
    }
    .amsearch-message-block{
        padding: 10px;
        font-size: 15px;
    }
}