/* =========================
   1. WRAPPER
========================= */
.xsearch-global {
    width: 400px;
    max-width: 100%;
    margin: 0 auto;
    flex: 0 0 400px;
}

/* =========================
   2. BOX
========================= */
.xsearch-box {
    position: relative;
    width: 100%;
}

/* =========================
   3. INPUT (FIX ASTRA)
========================= */
/* Selector mạnh hơn Astra */
body .xsearch-global .xsearch-box input.xsearch-input {
    width: 100%;
    height: 46px;
    padding: 0 50px 0 22px;

    border: 2px solid #0060B2 !important;
    border-radius: 999px !important;

    background-color: #fff !important;
    font-size: 14px;

    outline: none !important;
    box-shadow: none !important;

    transition: all 0.2s ease;
}

/* Hover */
.xsearch-global .xsearch-box input.xsearch-input:hover {
    border-color: #0074D9;
}

/* Focus */
.xsearch-global .xsearch-box input.xsearch-input:focus {
    border-color: #0074D9;
    box-shadow: 0 0 0 3px rgba(0,116,217,0.15);
}

/* =========================
   4. ICON KÍNH LÚP
========================= */
.xsearch-box::after {
    content: "";
    display: block;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);

    width: 18px;
    height: 18px;

    pointer-events: none;

    background: no-repeat center/contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%230060B2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

/* =========================
   5. CLEAR BUTTON
========================= */
.xsearch-global .xsearch-clear {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);

    display: none;
    z-index: 10;
    cursor: pointer;

    font-size: 18px;
    font-weight: bold;
    color: #bbb;

    transition: 0.2s;
}

.xsearch-global .xsearch-clear:hover {
    color: #ff3b30;
}

/* =========================
   6. DROPDOWN
========================= */
#xsearch-floating {
    position: fixed;
    z-index: 999999;

    background: #fff;
    border-radius: 12px;

    border: 1px solid #eee;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);

    overflow: hidden;
}

/* =========================
   7. ITEM
========================= */
.xsearch-item {
    display: block;
    padding: 10px 14px;

    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;

    transition: background 0.15s ease;
}

.xsearch-item:last-child {
    border-bottom: none;
}

.xsearch-item:hover {
    background: #fffcd4;
}

.xsearch-item.active {
    background: #e6f4ff;
}

/* =========================
   8. TEXT
========================= */
.xsearch-title {
    font-size: 15px;
    font-weight: 600;
    color: #0060B2;
}

.xsearch-author {
    font-size: 13px;
    color: #0074D9;
    margin-top: 2px;
}

#xsearch-floating small {
    display: block;
    margin-top: 2px;

    font-size: 12px;
    color: #777;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

mark {
    background: #ffe58a;
    padding: 0 2px;
    border-radius: 2px;
}

/* =========================
   9. MOBILE
========================= */
@media (max-width: 768px) {

    header .xsearch-global {
        width: 100%;
        flex: 1;
    }

    .xsearch-global .xsearch-box input.xsearch-input {
        height: 42px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {

    .xsearch-global .xsearch-box input.xsearch-input {
        height: 44px;
        font-size: 15px;
    }
}