/* Search PostType Live Search Styles */

.spt-search-container {
    /* Mặc định biến CSS, có thể bị ghi đè inline */
    --spt-img-size: 60px;
    --spt-font-size: 16px;
    --spt-width: 600px;
    --spt-height: 45px;

    position: relative;
    width: 100%;
    max-width: var(--spt-width);
    margin: 0 auto;
    font-family: inherit;
}

.spt-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.spt-search-input {
    width: 100%;
    height: var(--spt-height);
    padding: 0 45px 0 15px;
    border-radius: 8px;
    font-size: var(--spt-font-size);
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    color: #333;
}

.spt-search-input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.spt-search-submit {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 45px;
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: all 0.2s;
    border-radius: 0 8px 8px 0;
    outline: none !important;
    line-height: 1;
}

.spt-search-submit:hover {
    background: rgba(0, 0, 0, 0.05);
}

.spt-search-submit:hover .spt-search-icon {
    color: #007cba;
}

.spt-search-icon {
    width: 20px;
    height: 20px;
    color: #999;
    display: block;
    margin: 0 auto;
}

.spt-search-loader {
    position: absolute;
    right: 12.5px;
    /* Căn giữa trong nút 45px (45 - 20)/2 = 12.5 */
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spt-spin 1s linear infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes spt-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spt-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 5px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
}

.spt-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.spt-result-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f5f5f5;
}

.spt-result-item:last-child {
    border-bottom: none;
}

.spt-result-item a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.spt-result-item a:hover {
    background: #f9f9f9;
}

.spt-item-img {
    flex-shrink: 0;
    width: var(--spt-img-size);
    height: var(--spt-img-size);
    margin-right: 15px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.spt-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spt-item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.spt-item-title {
    font-size: var(--spt-font-size);
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.spt-item-desc {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 3px;
}

.spt-item-meta {
    font-size: 0.8em;
    color: #999;
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
}

.spt-meta-author {
    font-weight: 500;
}

.spt-item-price {
    font-size: 0.95em;
    color: #d9534f;
    font-weight: bold;
}

.spt-no-results {
    padding: 20px;
    text-align: center;
    color: #777;
    font-size: 15px;
}

/* Initial & Related Suggestions */
.spt-initial-box,
.spt-related-suggestions {
    padding: 15px;
}

.spt-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    margin: 5px 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spt-section-title:after {
    content: "";
    flex-grow: 1;
    height: 1px;
    background: #f1f5f9;
}

.spt-trending-section {
    margin-bottom: 25px;
}

.spt-keywords-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spt-item-minimal {
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.spt-item-minimal:hover {
    background: #f8fafc;
}

.spt-item-minimal a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 !important;
}

.spt-minimal-icon {
    width: 14px;
    height: 14px;
    color: #cbd5e1;
}

.spt-minimal-icon svg {
    width: 100%;
    height: 100%;
}

.spt-item-minimal .spt-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0;
}

.spt-keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.spt-keyword-tag:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}

.spt-tag-icon {
    width: 12px;
    height: 12px;
    opacity: 0.5;
}

.spt-related-suggestions {
    border-top: 1px solid #eee;
    margin-top: 5px;
    background: #fafafa;
}

.spt-no-tags {
    font-size: 13px;
    color: #999;
    font-style: italic;
}