/* Custom WooCommerce Search Styles - FiboSearch Compatible */
.cws-search-wrapper,
.dgwt-wcas-search-wrapp {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    font-family: inherit;
    z-index: 999;
}

.cws-search-form,
.dgwt-wcas-search-form {
    position: relative;
}

.cws-search-input-wrapper,
.dgwt-wcas-sf-wrapp {
    display: flex;
    align-items: center;
    position: relative;
    background: #fff;
    border: 2px solid #e1e1e1;
    border-radius: 3px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.cws-search-input-wrapper:focus-within,
.dgwt-wcas-sf-wrapp:focus-within {
    border-color: #96588a;
    box-shadow: 0 0 0 1px rgba(150, 88, 138, 0.2);
}

.dgwt-wcas-ico-magnifier {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: 0 12px 0 15px;
    flex-shrink: 0;
}

.dgwt-wcas-ico-magnifier svg {
    width: 16px;
    height: 16px;
}

.cws-search-input,
.dgwt-wcas-search-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
    font-size: 14px;
    line-height: 1.4;
    background: transparent;
    color: #333;
    font-family: inherit;
    min-width: 0;
}

.dgwt-wcas-ico-magnifier + .cws-search-input,
.dgwt-wcas-ico-magnifier + .dgwt-wcas-search-input {
    padding-left: 0;
}

.cws-search-input::placeholder,
.dgwt-wcas-search-input::placeholder {
    color: #999;
    font-style: italic;
}

.cws-search-submit,
.dgwt-wcas-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    background: #96588a;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 0;
    white-space: nowrap;
}

.cws-search-submit:hover,
.dgwt-wcas-search-submit:hover {
    background: #7d4a75;
    transform: translateY(-1px);
}

.cws-search-submit svg {
    width: 14px;
    height: 14px;
}

.dgwt-wcas-preloader,
.cws-preloader {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.dgwt-wcas-loader {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #96588a;
    border-radius: 50%;
    animation: cws-spin 1s linear infinite;
}

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

/* Suggestions Container */
.cws-suggestions-container,
.dgwt-wcas-suggestions-wrapp {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-top: none;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 500px;
    overflow: hidden;
    font-size: 14px;
}

.cws-suggestions-wrapper,
.dgwt-wcas-suggestions {
    max-height: 450px;
    overflow-y: auto;
}

/* Individual Suggestions */
.dgwt-wcas-suggestion {
    display: block;
    padding: 0;
    border-bottom: 1px solid #f5f5f5;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.dgwt-wcas-suggestion:hover,
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-selected {
    background-color: #f8f9fa;
}

.dgwt-wcas-suggestion:last-child {
    border-bottom: none;
}

.dgwt-wcas-suggestion-content {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
}

.dgwt-wcas-suggestion-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: #f8f9fa;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.dgwt-wcas-suggestion-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dgwt-wcas-suggestion-details {
    flex: 1;
    min-width: 0;
}

.dgwt-wcas-suggestion-title {
    font-weight: 600;
    color: #333;
    margin: 0 0 6px 0;
    line-height: 1.3;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dgwt-wcas-suggestion-excerpt {
    color: #666;
    font-size: 12px;
    line-height: 1.4;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dgwt-wcas-suggestion-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dgwt-wcas-suggestion-price,
.dgwt-wcas-sp {
    font-weight: 600;
    color: #96588a;
    font-size: 14px;
}

.dgwt-wcas-suggestion-price .woocommerce-Price-amount {
    font-weight: inherit;
}

.dgwt-wcas-suggestion-badge {
    font-size: 10px;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.dgwt-wcas-suggestion-badge.badge-page {
    background: #f3e5f5;
    color: #7b1fa2;
}

.dgwt-wcas-suggestion-badge.badge-post {
    background: #e8f5e8;
    color: #2e7d32;
}

.dgwt-wcas-suggestion-date {
    font-size: 11px;
    color: #999;
}

/* Section Headers */
.dgwt-wcas-suggestion-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
    padding: 8px 15px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Loading State */
.cws-loading,
.dgwt-wcas-preloader-wrapp {
    padding: 20px;
    text-align: center;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
}

.dgwt-wcas-preloader-wrapp .dgwt-wcas-preloader {
    position: relative;
    transform: none;
}

/* No Results */
.cws-no-results {
    padding: 30px 20px;
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cws-search-input-wrapper,
    .dgwt-wcas-sf-wrapp {
        border-radius: 25px;
    }
    
    .cws-search-input,
    .dgwt-wcas-search-input {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .cws-search-submit,
    .dgwt-wcas-search-submit {
        padding: 12px 16px;
        border-radius: 0 25px 25px 0;
    }
    
    .dgwt-wcas-suggestion-content {
        padding: 12px;
        gap: 12px;
    }
    
    .dgwt-wcas-suggestion-thumb {
        width: 50px;
        height: 50px;
    }
    
    .dgwt-wcas-suggestion-title {
        font-size: 13px;
    }
    
    .dgwt-wcas-suggestion-excerpt {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .cws-search-wrapper,
    .dgwt-wcas-search-wrapp {
        margin: 0 10px;
    }
    
    .dgwt-wcas-suggestion-content {
        padding: 10px;
        gap: 10px;
    }
    
    .dgwt-wcas-suggestion-thumb {
        width: 45px;
        height: 45px;
    }
}

/* Widget compatibility */
.widget .cws-search-wrapper,
.widget .dgwt-wcas-search-wrapp {
    max-width: 100%;
}

/* Hide loading when not active */
.dgwt-wcas-preloader:not(.loading) {
    display: none !important;
}

/* Ensure high z-index for suggestions */
.dgwt-wcas-suggestions-wrapp {
    z-index: 999999 !important;
}
