/* Nexell Dox — Site Search Styles
 * Overlay fullscreen + dropdown de resultados
 * Variables: --nexell-blue, --nexell-green, --nexell-gray, --nexell-light
 */

/* === SEARCH BUTTON (NAV) === */
.ndx-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nexell-gray, #6C7A86);
    transition: color 0.2s;
}
.ndx-search-btn:hover {
    color: var(--nexell-blue, #1F3B4D);
}
.ndx-search-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
}

/* === OVERLAY FULLSCREEN === */
.ndx-search-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
    padding-top: 100px;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
    align-items: center;
}
.ndx-search-overlay.open {
    display: flex;
}

/* === SEARCH INPUT CONTAINER === */
.ndx-search-box {
    background: #FFFFFF;
    border-radius: 10px 10px 0 0;
    width: 90%;
    max-width: 580px;
    display: flex;
    align-items: center;
    padding: 0.9rem 1rem;
    border: 2px solid var(--nexell-blue, #1F3B4D);
    border-bottom: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    gap: 0.6rem;
}
.ndx-search-box svg {
    width: 18px; height: 18px;
    stroke: var(--nexell-gray, #6C7A86);
    stroke-width: 2.2;
    fill: none;
    flex-shrink: 0;
}
.ndx-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    color: var(--nexell-blue, #1F3B4D);
    background: transparent;
}
.ndx-search-input::placeholder {
    color: var(--nexell-gray, #6C7A86);
    opacity: 0.6;
}
.ndx-search-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--nexell-gray, #6C7A86);
    padding: 0 0.2rem;
    line-height: 1;
    transition: color 0.15s;
}
.ndx-search-close:hover {
    color: var(--nexell-blue, #1F3B4D);
}

/* === RESULTS DROPDOWN === */
.ndx-search-results {
    background: #FFFFFF;
    border-radius: 0 0 10px 10px;
    width: 90%;
    max-width: 580px;
    max-height: 55vh;
    overflow-y: auto;
    border: 2px solid var(--nexell-blue, #1F3B4D);
    border-top: 1px solid #E0E4E8;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}
.ndx-search-results:empty {
    display: none;
}
.ndx-search-results::-webkit-scrollbar {
    width: 6px;
}
.ndx-search-results::-webkit-scrollbar-thumb {
    background: #CCC;
    border-radius: 3px;
}

/* === RESULT ITEMS === */
.ndx-result-item {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid #F0F2F4;
    transition: background 0.12s;
    cursor: pointer;
}
.ndx-result-item:hover,
.ndx-result-item.ndx-active {
    background: var(--nexell-light, #F4F7F9);
}
.ndx-result-item:last-child {
    border-bottom: none;
}
.ndx-result-page {
    display: block;
    font-size: 0.7rem;
    color: var(--nexell-green, #69BE28);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.1rem;
}
.ndx-result-heading {
    display: block;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--nexell-blue, #1F3B4D);
    margin-bottom: 0.15rem;
    line-height: 1.3;
}
.ndx-result-snippet {
    display: block;
    font-size: 0.82rem;
    color: var(--nexell-gray, #6C7A86);
    line-height: 1.4;
}

/* Highlight matches */
.ndx-result-heading mark,
.ndx-result-snippet mark {
    background: rgba(105, 190, 40, 0.2);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* No results */
.ndx-no-results {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--nexell-gray, #6C7A86);
    font-size: 0.9rem;
}

/* Search hint (initial state) */
.ndx-search-hint {
    padding: 1.2rem 1rem;
    text-align: center;
    color: var(--nexell-gray, #6C7A86);
    font-size: 0.82rem;
    opacity: 0.7;
}

/* === MOBILE === */
@media (max-width: 768px) {
    .ndx-search-overlay {
        padding-top: 70px;
    }
    .ndx-search-box,
    .ndx-search-results {
        width: 95%;
    }
    .ndx-search-input {
        font-size: 16px; /* Prevent iOS auto-zoom */
    }
    .ndx-result-heading {
        font-size: 0.88rem;
    }
    .ndx-result-snippet {
        font-size: 0.78rem;
    }
}
