.gk-adv-search-container {
    position: relative;
    width: var(--gk-search-width-mobile, 100%) !important;
    margin: 5px auto !important;
    text-align: left !important;
}

@media screen and (min-width: 768px) {
    .gk-adv-search-container {
        width: var(--gk-search-width, 300px) !important;
    }
}

.gk-adv-search-container,
.gk-adv-search-container *,
.gk-adv-search-container *::before,
.gk-adv-search-container *::after {
    box-sizing: border-box !important;
}

.gk-search-input-wrapper {
    position: relative;
    width: 100%;
}

.gk-search-form {
    margin: 0 !important;
    padding: 0 !important;
}

.gk-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gk-search-icon svg {
    width: 100%;
    height: 100%;
}

.gk-adv-search-input {
    width: 100% !important;
    padding: 10px 15px 10px 38px !important;
    /* Increased left padding for icon */
    border: 1px solid #ddd !important;
    border-radius: 25px !important;
    outline: none !important;
    transition: box-shadow 0.3s ease !important;
    background: #fff !important;
    color: #333 !important;
    height: 40px !important;
    /* Fix for iOS auto-zoom: font-size must be at least 16px */
    font-size: 16px !important;
}

@media screen and (min-width: 768px) {
    .gk-adv-search-input {
        font-size: 14px !important;
    }
}

.gk-adv-search-input:focus {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1) !important;
}

/* Results Box */
.gk-adv-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    min-width: 320px;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    margin-top: 5px !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1) !important;
    z-index: 1000000000 !important;
    display: none;
    max-height: 80vh;
    /* Better for mobile */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Scroll-lock utility for search activity */
body.gk-search-lock {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    width: 100% !important;
}

@media screen and (min-width: 768px) {
    .gk-adv-search-results {
        width: 350px;
        max-height: 450px;
    }
}

@media screen and (max-width: 767px) {
    .gk-adv-search-results {
        width: 100% !important;
        max-width: 100% !important;
        border-left: none !important;
        border-right: none !important;
        border-radius: 0 !important;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05), 0 5px 20px rgba(0, 0, 0, 0.1) !important;
        margin-top: 0 !important;
        /* Die Höhe wird nun dynamisch via JS berechnet */
    }
}

.gk-results-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.gk-result-item {
    padding: 10px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    background: none !important;
    margin: 0 !important;
    cursor: pointer;
}

/* ============================================================
   SEARCH RESULTS PAGE CLEANUP (ASTRA / WOOCOMMERCE)
   ============================================================ */

/* ============================================================
   SEARCH RESULTS PAGE CLEANUP (ASTRA / WOOCOMMERCE)
   ============================================================ */

/* Hide unwanted elements */
body.search-results .ast-archive-description p,
body.search-results .woocommerce-products-header>p,
body.search-results .woocommerce-result-count,
body.search-results .archive-description p {
    display: none !important;
}

/* Reset spacing */
body.search-results .woocommerce-products-header,
body.search-results .ast-archive-description,
body.search-results header.woocommerce-products-header {
    margin: 0 !important;
    padding: 0 !important;
}

/* MASSIVE CSS RESET FOR SEARCH TITLES (Astra & WooCommerce) */
body.search-results .woocommerce-products-header .woocommerce-products-header__title,
body.search-results .ast-archive-description .page-title,
body.search-results h1.page-title,
body.search-results h1.woocommerce-products-header__title,
body.search-results .entry-title {
    display: block !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #888 !important;
    text-transform: none !important;
    margin: 5px 0 15px 0 !important;
    padding: 0 !important;
    text-align: left !important;
    border: none !important;
    line-height: normal !important;
}

/* Specific styling for the isolated search term */
.gk-search-term {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #333 !important;
    display: inline-block !important;
    margin-left: 8px !important;
    vertical-align: baseline !important;
    text-transform: none !important;
}

@media screen and (max-width: 767px) {

    body.search-results h1.page-title,
    body.search-results h1.woocommerce-products-header__title,
    body.search-results .entry-title {
        font-size: 13px !important;
    }

    .gk-search-term {
        font-size: 18px !important;
    }
}

.gk-result-item:hover,
.gk-result-item.active {
    background: #f8f9fa !important;
}

/* Larger tap targets for mobile */
@media screen and (max-width: 767px) {
    .gk-result-item {
        padding: 15px 12px !important;
    }

    .gk-results-list {
        padding-bottom: 40px !important;
        /* Reduziert für weniger Lücke */
    }

    .gk-result-thumb {
        width: 50px !important;
        height: 50px !important;
    }

    .gk-result-name {
        font-size: 14px !important;
    }
}

.gk-result-item:last-child {
    border-bottom: none !important;
}

.gk-result-link {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    color: #333 !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    width: 100% !important;
}

.gk-result-thumb {
    width: 40px !important;
    height: 40px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    margin-right: 12px !important;
    flex-shrink: 0;
}

.gk-result-info {
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    flex-grow: 1;
}

.gk-result-name {
    font-weight: 500 !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    color: #333 !important;
    text-transform: none !important;
    margin: 0 !important;
    display: block !important;
    letter-spacing: normal !important;
}

.gk-result-price {
    font-size: 12px !important;
    color: #777 !important;
    margin-top: 2px !important;
    display: block !important;
}

/* Hover Preview Window */
.gk-search-preview {
    position: absolute;
    top: 35px;
    /* Aligned with results */
    left: 355px;
    /* To the right of results */
    width: 300px;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15) !important;
    z-index: 1000000 !important;
    padding: 20px !important;
    display: none;
}

.gk-preview-image {
    width: 100% !important;
    height: auto !important;
    border-radius: 4px !important;
    margin-bottom: 15px !important;
}

.gk-preview-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 10px !important;
    display: block !important;
    line-height: 1.4 !important;
    text-transform: none !important;
}

.gk-preview-sku {
    font-size: 12px !important;
    color: #999 !important;
    margin-bottom: 10px !important;
    display: block !important;
}

.gk-preview-price {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #e44d26 !important;
    margin-bottom: 15px !important;
    display: block !important;
}

.gk-preview-excerpt {
    font-size: 13px !important;
    color: #666 !important;
    line-height: 1.5 !important;
    margin-bottom: 15px !important;
    display: block !important;
    text-transform: none !important;
}

.gk-preview-stock {
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-bottom: 15px !important;
    display: block !important;
}

.gk-add-to-cart-btn {
    display: block !important;
    width: 100% !important;
    padding: 10px !important;
    background: #a9cfbf !important;
    /* Sage green like the user's screenshot */
    color: #333 !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
}

.gk-show-all-results {
    padding: 15px !important;
    text-align: center !important;
    border-top: 1px solid #f0f0f0 !important;
    background: #fafafa !important;
}

.gk-show-all-results a {
    text-decoration: none !important;
    color: #888 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.gk-show-all-results a:hover {
    color: #333 !important;
}

.gk-no-results {
    padding: 20px !important;
    text-align: center !important;
    color: #999 !important;
    font-size: 14px !important;
    text-transform: none !important;
}

/* Mobile Close Button */
.gk-results-close {
    display: none;
    padding: 10px;
    text-align: right;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

@media screen and (max-width: 767px) {
    .gk-results-close {
        display: block;
    }
}

.gk-results-close span {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    cursor: pointer;
}