/* === Unified Smart Search === */
.us-wrapper {
    max-width: 460px;
    width: 100%;
    font-family: inherit;
}

.us-container { position: relative; }

.us-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 50px;
    background: #fff;
    padding: 0 6px 0 14px;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.us-input-wrap:focus-within {
    border-color: #2a7a4b;
    box-shadow: 0 0 0 3px rgba(42,122,75,0.14);
}

.us-icon {
    width: 17px; height: 17px;
    color: #999;
    flex-shrink: 0;
    margin-right: 8px;
}

.us-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 9px 0 !important;
    font-size: 14px !important;
    color: #222;
    min-width: 0;
}

.us-input::placeholder { color: #aaa; }

.us-clear {
    background: none; border: none; cursor: pointer;
    padding: 6px; color: #999; line-height: 1;
    border-radius: 50%;
    transition: background 0.1s, color 0.1s;
    flex-shrink: 0;
}
.us-clear:hover { background: #f0f0f0; color: #333; }

/* Dropdown */
.us-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    box-shadow: 0 10px 36px rgba(0,0,0,0.14);
    z-index: 99999;
    overflow: hidden;
    max-height: 440px;
    overflow-y: auto;
    min-width: 250px;
}
.us-dropdown.open { display: block; }

/* Section title (Gợi ý từ khóa / Kết quả) */
.us-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 14px 4px;
}

/* Keyword suggestion row */
.us-suggest-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 13.5px;
    color: #333;
    transition: background 0.1s;
    border-top: 1px solid #f5f5f5;
}
.us-suggest-item:first-of-type { border-top: none; }
.us-suggest-item:hover, .us-suggest-item.active {
    background: #f7f9f8;
}
.us-suggest-icon {
    width: 15px; height: 15px;
    color: #aaa;
    flex-shrink: 0;
}

.us-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 2px 0;
}

.us-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
    border-top: 1px solid #f5f5f5;
}
.us-item:first-child { border-top: none; }
.us-item:hover, .us-item.active { background: #f7f9f8; }

.us-item-thumb {
    width: 50px; height: 50px;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: cover;
    background: #eee;
}
.us-item-thumb-placeholder {
    width: 50px; height: 50px;
    border-radius: 8px;
    background: #eef3f0;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    color: #2a7a4b;
}

.us-item-info { flex: 1; min-width: 0; line-height: 1.2}
.us-item-title {
    font-size: 13.5px;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.us-item-sub {
    font-size: 11.5px;
    color: #888;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.us-match { color: #2a7a4b; font-weight: 600; }

.us-item-badge {
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}
.us-badge-bai-viet { background: #eef2fb; color: #3158a5; }
.us-badge-trang    { background: #fbf0e6; color: #a35d18; }
.us-badge-khoa-hoc { background: #e6f4ed; color: #1d5c37; }
.us-badge-danh-muc { background: #f3e8fb; color: #6a2da5; }

.us-item-price {
    font-size: 12px;
    color: #c0392b;
    font-weight: 600;
    flex-shrink: 0;
}

.us-no-result {
    padding: 18px 14px;
    text-align: center;
    color: #999;
    font-size: 13.5px;
}

.us-loading {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #aaa;
}

.us-footer {
    padding: 7px 14px;
    font-size: 7.5px;
    color: #bbb;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 4px;
    justify-content: space-between;
}
.us-kbd {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1px 2px;
    font-size: 8.5px;
    color: #888;
}

/* Highlight card khóa học sau khi scroll đến */
.us-course-highlight {
    animation: us-highlight-pulse 3s ease;
}
@keyframes us-highlight-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(41, 97, 66, 0.5); }
    30%  { box-shadow: 0 0 0 8px rgba(41, 97, 66, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(41, 97, 66, 0); }
}

/* Responsive: header thường hẹp trên mobile */
@media (max-width: 600px) {
    .us-wrapper { max-width: 100%; }
}