/* Terrall AJAX Search */

.terrall-ajax-search-wrapper {
    width: 100%;
}

/* Input wrapper */
.terrall-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.terrall-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terrall-search-icon svg {
    width: 100%;
    height: 100%;
}

.terrall-search-input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    background: #fff;
}

.terrall-search-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

/* Clear button */
.terrall-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.terrall-search-clear.visible {
    opacity: 1;
    visibility: visible;
}

.terrall-search-clear:hover {
    color: #333;
}

/* Results container */
.terrall-search-results {
    position: relative;
}

/* Results grid */
.terrall-search-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    transition: opacity 0.2s ease;
}

/* Spinner overlay */
.terrall-search-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.6);
}

.terrall-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: terrall-spin 0.7s linear infinite;
}

@keyframes terrall-spin {
    to {
        transform: rotate(360deg);
    }
}

/* No results */
.terrall-search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 15px;
}

/* Result items */
.terrall-search-result-item {
    transition: background-color 0.15s ease;
}

/* ==========================================
   PAGINACION
   ========================================== */
.terrall-pagination-wrapper {
    margin-top: 20px;
}

.terrall-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.terrall-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.terrall-page-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
    text-decoration: none;
    color: #333;
}

.terrall-page-btn.current {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    cursor: default;
    pointer-events: none;
}

.terrall-page-btn.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 767px) {
    .terrall-search-results-grid {
        grid-template-columns: 1fr !important;
    }

    .terrall-pagination {
        gap: 4px;
    }

    .terrall-page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
}
