/**
 * Product archive live search styles.
 *
 * @package MyobAcumaticaWooIntegration
 */

/* Search wrapper */
.myob-archive-search-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 0 20px 0;
    position: relative;
}

/* Search input container */
.myob-archive-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Search input */
.myob-archive-search-input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.myob-archive-search-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.myob-archive-search-input::placeholder {
    color: #999;
}

/* Search icon and spinner */
.myob-archive-search-icon,
.myob-archive-search-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.myob-archive-search-spinner .myob-spin {
    animation: myob-spin 1s linear infinite;
}

@keyframes myob-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Clear button */
.myob-archive-search-clear {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: #ccc;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.myob-archive-search-clear:hover {
    background: #999;
}

/* Filter status bar */
.myob-archive-filter-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 10px 15px;
    background: #e8f4f8;
    border: 1px solid #b8daed;
    border-radius: 4px;
    font-size: 14px;
    color: #1a5276;
}

.myob-archive-filter-status .filter-count {
    font-weight: 500;
}

.myob-archive-filter-status .myob-archive-filter-clear {
    background: none;
    border: none;
    color: #1a5276;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
}

.myob-archive-filter-status .myob-archive-filter-clear:hover {
    color: #0d3d56;
}

/* Filtered products grid */
ul.products.myob-filtered {
    animation: myobFadeIn 0.3s ease;
}

@keyframes myobFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* No results and error states */
ul.products.myob-no-results {
    display: block !important;
    width: 100%;
}

.myob-filter-no-results,
.myob-filter-error {
    width: 100%;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 15px;
    list-style: none;
}

.myob-filter-no-results p,
.myob-filter-error p {
    margin: 0;
}

.myob-filter-error {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .myob-archive-search-wrapper {
        max-width: 100%;
    }

    .myob-archive-search-input {
        padding: 10px 40px 10px 14px;
        font-size: 14px;
    }
}
