/* =============================================
   APKSure Smart Search Autocomplete v1006
   الـ dropdown بـ position:fixed في الـ body
   يتجاوز أي overflow أو stacking context
   ============================================= */

#as-global-drop {
    position: fixed !important;
    z-index: 99999999 !important;   /* فوق كل حاجة حتى #header */
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,.15);
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    animation: as-in .15s ease;
    /* إذا الكيبورد على الموبايل ضيّق الشاشة */
    max-width: calc(100vw - 20px);
}
@keyframes as-in {
    from { opacity:0; transform:translateY(-5px); }
    to   { opacity:1; transform:translateY(0);    }
}

/* ── List ── */
.as-list { list-style:none; margin:0; padding:4px 0; }

/* ── Item ── */
.as-item { position:relative; transition:background .12s; }
.as-item:hover,
.as-item.as-active { background:#f3f4f6; }

.as-item .as-link {
    display:flex; align-items:center;
    padding:9px 14px; min-height:50px;
    text-decoration:none; color:inherit; gap:10px;
}

/* ── Icon ── */
.as-icon {
    width:38px; height:38px; border-radius:9px;
    object-fit:cover; flex-shrink:0;
    background:#f0f0f0; border:1px solid #e5e7eb;
}
.as-icon-ph {
    display:inline-block;
    background:linear-gradient(135deg,#dde1ea,#c9cdd6);
    border-radius:9px;
}
.as-icon-history {
    width:38px; height:38px; flex-shrink:0; border-radius:9px;
    border:1px solid #e5e7eb;
    background:#f3f4f6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' stroke='%23aab' stroke-width='2'/%3E%3Cpath d='M12 7v5l3 3' stroke='%23aab' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
}

/* ── Text ── */
.as-info { flex:1; overflow:hidden; }
.as-title { font-size:14px; font-weight:500; color:#111827; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.4; }
.as-meta  { display:flex; gap:5px; margin-top:3px; flex-wrap:wrap; }
.as-cat, .as-ver { font-size:11px; color:#6b7280; background:#f3f4f6; padding:1px 6px; border-radius:20px; white-space:nowrap; }

mark.hl { background:transparent; color:var(--color_button,#3b82f6); font-weight:700; }

/* ── Delete btn ── */
.as-item-del {
    position:absolute; right:10px; top:50%; transform:translateY(-50%);
    width:26px; height:26px; display:flex; align-items:center; justify-content:center;
    font-size:11px; color:#9ca3af; cursor:pointer; border-radius:50%;
    transition:opacity .15s, background .15s;
}
@media (pointer:fine) {
    .as-item-del { opacity:0; }
    .as-item:hover .as-item-del { opacity:1; }
}
@media (pointer:coarse) { /* موبايل: دايماً ظاهر */
    .as-item-del { opacity:1; }
}
.as-item-del:hover { background:#e5e7eb; color:#374151; }

/* ── History header ── */
.as-history-header { display:flex; align-items:center; justify-content:space-between; padding:8px 14px 4px; border-bottom:1px solid #f3f4f6; }
.as-history-title  { font-size:11px; font-weight:600; color:#9ca3af; text-transform:uppercase; letter-spacing:.4px; }
.as-history-clear  { font-size:12px; color:var(--color_button,#3b82f6); cursor:pointer; padding:2px 7px; border-radius:4px; }
.as-history-clear:hover { background:#eff6ff; }

/* ── Footer ── */
.as-footer { border-top:1px solid #f3f4f6; padding:8px 14px; text-align:center; }
.as-all-link { font-size:13px; font-weight:500; color:var(--color_button,#3b82f6); text-decoration:none; display:inline-flex; align-items:center; gap:4px; }
.as-all-link:hover { text-decoration:underline; }
.as-arrow { font-size:16px; line-height:1; }

/* ── Empty ── */
.as-empty { padding:16px 14px; text-align:center; color:#9ca3af; font-size:13px; }

/* ── Loading dots ── */
.as-loading { padding:14px; display:flex; justify-content:center; gap:6px; }
.as-loading span { width:7px; height:7px; border-radius:50%; background:var(--color_button,#3b82f6); animation:as-bounce .8s infinite ease-in-out; opacity:.6; }
.as-loading span:nth-child(1){animation-delay:0s}
.as-loading span:nth-child(2){animation-delay:.15s}
.as-loading span:nth-child(3){animation-delay:.3s}
@keyframes as-bounce { 0%,80%,100%{transform:scale(.6);opacity:.3} 40%{transform:scale(1);opacity:1} }

/* ── Scrollbar ── */
#as-global-drop::-webkit-scrollbar{width:4px}
#as-global-drop::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:2px}

/* ── Mobile ── */
@media (max-width:996px) {
    #as-global-drop { max-height:55vh; border-radius:8px; }
    .as-item .as-link { padding:10px 14px; }
    .as-icon { width:34px; height:34px; }
    .as-title { font-size:13px; }
}
