/* Main container */
.rtcl-custom-search {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Form layout */
.rtcl-custom-search form {
    display: flex;
    position: relative;
}

/* Search input */
#rtcl-custom-search-input,
input[name="q"],
input[data-type="location"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    border-right: none;
    font-size: 14px;
    min-width: 0; /* Prevent overflow */
}

/* Suggestions container */
.rtcl-suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1001;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

/* Suggestions list */
.rtcl-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Suggestion items */
.rtcl-suggestion-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
}

.rtcl-suggestion-item:hover {
    background-color: #f8f8f8;
}

/* Thumbnail styles */
.rtcl-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Suggestion details */
.rtcl-suggestion-details {
    flex: 1;
    min-width: 0;
}

.rtcl-suggestion-label {
    display: block;
    font-weight: 500;
    color: #222;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price and meta styles */
.rtcl-price {
    color: #0073aa;
    font-weight: bold;
    font-size: 0.9em;
    display: inline-block;
    margin-right: 8px;
}

.rtcl-category,
.rtcl-location {
    color: #666;
    font-size: 0.85em;
    display: inline-block;
    margin-right: 8px;
}

.rtcl-category:before,
.rtcl-location:before {
    content: "•";
    margin-right: 5px;
    color: #ccc;
}

/* Loading and empty states */
.rtcl-loading,
.rtcl-no-results {
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* Button container */
.search-buttons {
    display: flex;
    border-radius: 0 4px 4px 0;
    overflow: hidden;
}

/* Search button (left) */
#rtcl-search-submit {
    padding: 10px 15px;
    background: green;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

#rtcl-search-submit:hover {
    background: #006799;
}

/* Filter toggle (right) */
#rtcl-filters-toggle {
    padding: 10px 15px;
    background: orange;
    color: white;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#rtcl-filters-toggle.loading .dashicons {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filters panel */
#rtcl-search-filters {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s ease-out;
    will-change: transform, opacity;
}

#rtcl-search-filters.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown selects */
#rtcl-search-filters select {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 30px 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

/* Mobile styles */
@media (max-width: 767px) {
    .rtcl-custom-search {
        max-width: 100%;
    }

    #rtcl-custom-search-input,
    input[name="q"],
    input[data-type="location"] {
        padding: 8px 12px;
    }

    .search-buttons {
        flex-shrink: 0;
    }

    #rtcl-search-submit,
    #rtcl-filters-toggle {
        padding: 8px 12px;
    }

    #rtcl-search-filters {
        width: 100%;
        right: auto;
        left: 0;
    }

    .rtcl-suggestions-container {
        max-height: 300px;
    }

    .rtcl-suggestion-item {
        padding: 10px 12px;
    }

    .rtcl-thumbnail {
        width: 35px;
        height: 35px;
    }
}