/* WooSearch Widget Container */
.woosearch-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.woosearch-form {
    display: flex;
    margin: 0;
}

.woosearch-input-group {
    display: flex;
    width: 100%;
    background: #ffffff !important;
    border-radius: 30px !important;
    border: 1px solid #ffd1bf !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important;
    transition: all 0.3s ease;
    align-items: stretch;
    min-height: 48px;
}

.woosearch-input-group:focus-within {
    border-color: #ffbba1;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.woosearch-input-group:focus-within {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.2);
}

/* Category Select */
.woosearch-category-select {
    border: none !important;
    background-color: transparent !important;
    padding: 0 25px 0 15px !important; /* Right padding for custom arrow */
    font-size: 13px; /* Slightly smaller font */
    color: #333 !important;
    cursor: pointer;
    border-radius: 30px 0 0 30px !important; /* Force border radius against theme overrides */
    outline: none !important;
    flex: 0 0 120px; /* Force a fixed width so it doesn't take too much space */
    width: 120px;
    height: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" stroke="%23c41e4a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><polyline points="6 9 12 15 18 9"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-size: 12px !important;
    background-position: right 10px center !important;
}

.woosearch-category-select:focus {
    outline: none;
    box-shadow: none;
}

/* Search Input Wrapper */
.woosearch-search-field-wrapper {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    min-width: 100px; /* Ensure input has a decent minimum typing area */
}

/* Search Input */
.woosearch-input {
    flex: 1 1 auto;
    width: 100%;
    border: none !important;
    background: transparent !important;
    padding: 0 15px !important;
    margin: 0 !important;
    height: 100% !important;
    font-size: 14px;
    color: #333 !important;
    outline: none !important;
    box-shadow: none !important;
}

.woosearch-input:focus {
    outline: none;
    box-shadow: none;
}

.woosearch-input::placeholder {
    color: #999;
}

/* Submit Button */
.woosearch-submit-btn {
    background-color: transparent !important;
    border: none !important;
    padding: 0 20px !important;
    margin: 0 !important;
    height: 100% !important;
    box-shadow: none !important;
    color: #c41e4a !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 0 30px 30px 0 !important; /* Force border radius against theme overrides */
}

.woosearch-submit-btn:hover {
    background-color: #c41e4a !important;
    color: #ffffff !important;
}

/* Suggestions Dropdown */
.woosearch-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.woosearch-suggestions-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.woosearch-suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
}

.woosearch-suggestion-item:last-child {
    border-bottom: none;
}

.woosearch-suggestion-item:hover, .woosearch-suggestion-item.active {
    background: #f9f9f9;
}

.woosearch-suggestion-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    background: #f0f0f0;
}

.woosearch-suggestion-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.woosearch-suggestion-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.woosearch-suggestion-price {
    font-size: 13px;
    color: #666;
}
.woosearch-suggestion-price ins {
    text-decoration: none;
    color: #333;
    font-weight: 600;
}
.woosearch-suggestion-price del {
    margin-right: 5px;
    color: #999;
}

.woosearch-loading {
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woosearch-spinner {
    border: 2px solid rgba(0,0,0,0.1);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border-left-color: #D81B60;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.woosearch-no-results {
    padding: 15px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .woosearch-category-select {
        max-width: 110px;
        font-size: 13px;
        padding: 8px 20px 8px 10px;
        background-position: right 5px center;
    }
    
    .woosearch-input {
        font-size: 14px;
    }
    
    .woosearch-container {
        max-width: 100%;
    }
}
@media (max-width: 480px) {
    .woosearch-category-select {
        display: none; /* Hide category select on very small screens to save space */
    }
    .woosearch-input-group {
        border-radius: 8px; /* Less rounded on mobile for a tighter fit */
    }
}
