.rwls-search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.rwls-search-form {
    display: flex;
    width: 100%;
}

.rwls-search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

.rwls-search-button {
    padding: 10px 15px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.rwls-search-button:hover {
    background-color: #005177;
}

.rwls-results-container {
    display: none;
    position: absolute;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.rwls-product-item {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.rwls-product-item:last-child {
    border-bottom: none;
}

.rwls-product-item:hover {
    background-color: #f9f9f9;
}

.rwls-product-image {
    width: 60px;
    height: 60px;
    margin-right: 10px;
    object-fit: cover;
}

.rwls-product-details {
    flex: 1;
}

.rwls-product-title {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: bold;
}

.rwls-product-sku {
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.rwls-product-price {
    color: #0073aa;
    font-weight: bold;
}

.rwls-loading, .rwls-error, .rwls-no-results {
    padding: 15px;
    text-align: center;
}

.rwls-error {
    color: #d63638;
}

/* Suchauftrags-Styles */
.rwls-search-request-option {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
}

.rwls-create-search-request-btn {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.rwls-create-search-request-btn:hover {
    background-color: #005177;
}

/* Modal-Styles */
.rwls-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.rwls-modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    position: relative;
}

.rwls-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.rwls-modal-close:hover {
    color: black;
}

#rwls-search-request-form {
    margin-top: 20px;
}

#rwls-search-request-form .rwls-form-group {
    margin-bottom: 15px;
}

#rwls-search-request-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

#rwls-search-request-form input[type="text"],
#rwls-search-request-form input[type="email"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.rwls-submit-search-request {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.rwls-submit-search-request:hover {
    background-color: #005177;
}

.rwls-form-message {
    margin-top: 15px;
}

.rwls-form-message .rwls-success {
    color: #2e7d32;
    padding: 10px;
    background-color: #e8f5e9;
    border-radius: 4px;
}

/* Standalone Search Request Form */
.rwls-search-request-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.rwls-search-request-title {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.rwls-search-request-subtitle {
    color: #666;
    margin-bottom: 20px;
}

.rwls-search-request-form {
    margin-top: 20px;
}

.rwls-search-request-form .rwls-form-row {
    margin-bottom: 15px;
}

.rwls-search-request-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.rwls-search-request-form input[type="text"],
.rwls-search-request-form input[type="email"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.rwls-search-request-button {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.rwls-search-request-button:hover {
    background-color: #005177;
}

.rwls-search-request-message {
    margin-top: 15px;
}

.rwls-search-request-message .rwls-success {
    color: #2e7d32;
    padding: 10px;
    background-color: #e8f5e9;
    border-radius: 4px;
}

/* Neue Stile für Master-ID Erkennung */
.success-result {
    color: #0073aa !important;
    background-color: #f0f8ff !important;
    border-left: 4px solid #0073aa !important;
    padding: 10px !important;
    font-weight: bold !important;
}

.no-result em {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

.rwls-success {
    color: #0073aa;
    background-color: #f0f8ff;
    border: 1px solid #0073aa;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.rwls-search-results-list .rwls-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Theme integration: keep AJAX results visually consistent and isolated from theme link styles */
form.searchform {
    position: relative;
}

form.searchform .livesearch-box {
    position: absolute;
    z-index: 9999;
    display: none;
    background: #ffffff;
    border: 1px solid #d6d9de;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

form.searchform .livesearch-box .results {
    max-height: min(62vh, 460px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

form.searchform .livesearch-box .results .rwls-search-results {
    margin: 0;
    padding: 0;
}

form.searchform .livesearch-box .results .rwls-product-item {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    margin: 0 !important;
    padding: 10px 12px;
    border-bottom: 1px solid #eceff3;
    background: #ffffff;
    text-decoration: none !important;
    color: #1f2937 !important;
}

form.searchform .livesearch-box .results .rwls-product-item:last-child {
    border-bottom: 0;
}

form.searchform .livesearch-box .results .rwls-product-item:hover {
    background: #f6f8fb;
}

form.searchform .livesearch-box .results .rwls-product-image {
    width: 56px;
    height: 56px;
    margin: 0;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}

form.searchform .livesearch-box .results .rwls-product-details {
    min-width: 0;
    flex: 1;
}

form.searchform .livesearch-box .results .rwls-product-title {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
    color: #111827 !important;
    text-decoration: none !important;
}

form.searchform .livesearch-box .results .rwls-product-sku {
    margin: 0 0 4px;
    font-size: 12px;
    line-height: 1.3;
    color: #4b5563 !important;
}

form.searchform .livesearch-box .results .rwls-product-price {
    margin: 0;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 700;
    color: #0f766e !important;
}

form.searchform .livesearch-box .results .rwls-product-description {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.4;
    color: #6b7280;
}

form.searchform .livesearch-box .results .no-result,
form.searchform .livesearch-box .results .success-result {
    list-style: none;
    margin: 0;
    padding: 14px 12px;
    font-size: 14px;
    line-height: 1.45;
}

form.searchform .livesearch-box .results .no-result {
    color: #374151;
}

form.searchform .livesearch-box .results .success-result {
    color: #0f766e !important;
    background: #f0fdf4 !important;
    border-left: 3px solid #0f766e !important;
}

@media (max-width: 767px) {
    form.searchform .livesearch-box {
        border-radius: 8px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    }

    form.searchform .livesearch-box .results {
        max-height: 52vh;
    }

    form.searchform .livesearch-box .results .rwls-product-item {
        padding: 10px;
        gap: 10px;
    }

    form.searchform .livesearch-box .results .rwls-product-image {
        width: 48px;
        height: 48px;
    }

    form.searchform .livesearch-box .results .rwls-product-title {
        font-size: 14px;
    }
}

/* Global overlay dropdown for theme searchforms (prevents clipping by hero/header overflow) */
#rwls-theme-search-dropdown {
    position: fixed;
    z-index: 2147483000;
    display: none;
    background: #ffffff;
    border: 1px solid #d6d9de;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

#rwls-theme-search-dropdown .results {
    max-height: 68vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#rwls-theme-search-dropdown .rwls-search-results {
    margin: 0;
    padding: 0;
}

#rwls-theme-search-dropdown .rwls-product-item {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    margin: 0 !important;
    padding: 10px 12px;
    border-bottom: 1px solid #eceff3;
    background: #ffffff;
    text-decoration: none !important;
    color: #1f2937 !important;
}

#rwls-theme-search-dropdown .rwls-product-item:last-child {
    border-bottom: 0;
}

#rwls-theme-search-dropdown .rwls-product-item:hover {
    background: #f6f8fb;
}

#rwls-theme-search-dropdown .rwls-product-image {
    width: 56px;
    height: 56px;
    margin: 0;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}

#rwls-theme-search-dropdown .rwls-product-details {
    min-width: 0;
    flex: 1;
}

#rwls-theme-search-dropdown .rwls-product-title {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
    color: #111827 !important;
    text-decoration: none !important;
}

#rwls-theme-search-dropdown .rwls-product-sku {
    margin: 0 0 4px;
    font-size: 12px;
    line-height: 1.3;
    color: #4b5563 !important;
}

#rwls-theme-search-dropdown .rwls-product-price {
    margin: 0;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 700;
    color: #0f766e !important;
}

#rwls-theme-search-dropdown .rwls-product-description {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.4;
    color: #6b7280;
}

#rwls-theme-search-dropdown .no-result,
#rwls-theme-search-dropdown .success-result {
    list-style: none;
    margin: 0;
    padding: 14px 12px;
    font-size: 14px;
    line-height: 1.45;
}

#rwls-theme-search-dropdown .no-result {
    color: #374151;
}

#rwls-theme-search-dropdown .success-result {
    color: #0f766e !important;
    background: #f0fdf4 !important;
    border-left: 3px solid #0f766e !important;
}

#rwls-theme-search-dropdown .rwls-loading,
#rwls-theme-search-dropdown .rwls-focus-info {
    margin: 0;
    padding: 14px 12px;
    font-size: 14px;
    line-height: 1.45;
}

#rwls-theme-search-dropdown .rwls-loading {
    color: #1f2937;
}

#rwls-theme-search-dropdown .rwls-focus-info {
    color: #374151;
    background: #f8fafc;
}

@media (max-width: 767px) {
    #rwls-theme-search-dropdown {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    }

    #rwls-theme-search-dropdown .results {
        max-height: 58vh;
    }

    #rwls-theme-search-dropdown .rwls-product-item {
        padding: 10px;
        gap: 10px;
    }

    #rwls-theme-search-dropdown .rwls-product-image {
        width: 48px;
        height: 48px;
    }

    #rwls-theme-search-dropdown .rwls-product-title {
        font-size: 14px;
    }
}
