/* ============================================
   ALGOLIA SEARCH - FULL CUSTOM CSS
   (No satellite theme needed)
   ============================================ */

/* ---------- WRAPPER ---------- */
.algolia-search-wrapper {
    position: relative;
    width: 100%;
}

#searchbox {
    width: 100%;
    position: relative;
}

/* ---------- FORM ---------- */
.ais-SearchBox-form {
    position: relative;
    margin: 0;
    display: block;
    width: 100%;
}

/* ---------- INPUT FIELD ---------- */
.ais-SearchBox-input {
    width: 100%;
    height: 42px;
    padding: 0 48px 0 20px;
    font-size: 15px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #202124;
    background: #f1f3f4;
    border: 1px solid transparent;
    border-radius: 22px;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none !important;
}

/* Input के अंदर किसी भी तरह का icon न आए */
.ais-SearchBox-input::-webkit-search-cancel-button,
.ais-SearchBox-input::-webkit-search-decoration,
.ais-SearchBox-input::-webkit-search-results-button,
.ais-SearchBox-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.ais-SearchBox-input::placeholder {
    color: #5f6368;
    opacity: 1;
}

.ais-SearchBox-input:hover {
    background: #e8eaed;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
}

.ais-SearchBox-input:focus {
    background: #fff;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

/* ---------- FORM के ::before और ::after को पूरी तरह बंद करें ---------- */
.ais-SearchBox-form::before,
.ais-SearchBox-form::after {
    display: none !important;
    content: none !important;
    background: none !important;
}

.ais-SearchBox-input::before,
.ais-SearchBox-input::after {
    display: none !important;
    content: none !important;
    background: none !important;
}

/* ---------- DEFAULT ICONS को पूरी तरह HIDE करें ---------- */
.ais-SearchBox-submitIcon,
.ais-SearchBox-resetIcon,
.ais-SearchBox-loadingIcon,
.ais-SearchBox-submit svg:not(.custom-search-icon),
.ais-SearchBox-submit svg:not(.custom-search-icon) path {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
}

/* ---------- हमारा CUSTOM SUBMIT BUTTON (RIGHT SIDE) ---------- */
.ais-SearchBox-submit {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    border-radius: 50%;
    color: #1a73e8;
    transition: background 0.2s;
    padding: 0;
    box-shadow: none !important;
}

.ais-SearchBox-submit:hover {
    background: rgba(26, 115, 232, 0.08) !important;
}

/* सिर्फ हमारा custom icon दिखे */
.ais-SearchBox-submit svg.custom-search-icon {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    fill: #1a73e8 !important;
    opacity: 1 !important;
}

/* ---------- RESET (X) BUTTON ---------- */
.ais-SearchBox-reset {
    position: absolute;
    right: 42px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    border-radius: 50%;
    color: #5f6368;
    padding: 0;
    box-shadow: none !important;
}

.ais-SearchBox-reset:hover {
    background: rgba(95, 99, 104, 0.08) !important;
}

.ais-SearchBox-reset svg {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    fill: currentColor !important;
}

.ais-SearchBox-reset[hidden] {
    display: none !important;
}

/* ---------- LOADING SPINNER ---------- */
.ais-SearchBox-loadingIndicator {
    position: absolute;
    right: 42px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #dadce0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: algolia-spin 0.8s linear infinite;
}

.ais-SearchBox-loadingIndicator[hidden] {
    display: none !important;
}

@keyframes algolia-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ---------- DROPDOWN RESULTS ---------- */
#hits {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(32, 33, 36, 0.15);
    max-height: 450px;
    overflow-y: auto;
    z-index: 999;
    display: none;
    border: 1px solid #e8eaed;
}

#hits:not(:empty) {
    display: block;
}

.algolia-hit-item {
    display: block;
    padding: 12px 20px;
    text-decoration: none !important;
    color: inherit;
    border-bottom: 1px solid #f1f3f4;
    transition: background 0.15s ease;
    cursor: pointer;
}

.algolia-hit-item:last-child {
    border-bottom: none;
}

.algolia-hit-item:hover {
    background: #f8f9fa;
}

.algolia-hit-title {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 500;
    color: #202124;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.algolia-hit-title::before {
    content: '🔍';
    font-size: 13px;
    flex-shrink: 0;
}

.algolia-hit-desc {
    margin: 0;
    font-size: 13px;
    color: #5f6368;
    line-height: 1.4;
    padding-left: 22px;
}

mark {
    background: transparent;
    color: #1a73e8;
    font-weight: 600;
    padding: 0;
}

.algolia-empty {
    padding: 30px 20px;
    text-align: center;
    color: #5f6368;
    font-size: 14px;
}

/* ---------- AUTH BUTTONS ---------- */
.btn-login {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #202124 !important;
    background: transparent;
    border: none;
    border-radius: 6px;
    text-decoration: none !important;
    transition: background 0.2s;
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
}

.btn-login:hover {
    background: #f1f3f4;
}

.btn-signup {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #fff !important;
    background: #1a73e8;
    border: none;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
}

.btn-signup:hover {
    background: #1557b0;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

/* ---------- SCROLLBAR ---------- */
#hits::-webkit-scrollbar { width: 8px; }
#hits::-webkit-scrollbar-track { background: transparent; }
#hits::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 4px;
}
#hits::-webkit-scrollbar-thumb:hover { background: #bdc1c6; }

/* ---------- MOBILE ---------- */
@media (max-width: 991px) {
    .ais-SearchBox-input {
        height: 44px;
        font-size: 15px;
    }

    #hits {
        max-height: 55vh;
    }

    .algolia-hit-item { padding: 12px 16px; }
    .algolia-hit-title { font-size: 14px; }
    .algolia-hit-desc { font-size: 12px; }
}