/** BÚSQUEDA (Categorías) CSS para el buscador de categorias (Blade_Shop) */

:root {
    --omega-blue-deep: #121a77;
    --omega-blue-bright: #1e2dbf;
    --omega-orange: #f97316;
    --omega-orange-soft: #fff4ec;
    --white: #ffffff;
}

/*  CONTENEDOR PRINCIPAL */
.autocomplete-box {
    position: absolute;
    top: 100%;
    /* Justo debajo del input */
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 99;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 4px;
    animation: fadeIn 0.15s ease-in;
}

/* ELEMENTOS INDIVIDUALES */
.autocomplete-item {
    display: block;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    color: var(--omega-blue-deep);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    border-left: 3px solid transparent;
    font-weight: 500;

    /* Evita que los textos largos deformen el cuadro */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Hover */
.autocomplete-item:hover {
    background-color: var(--omega-orange-soft);
    border-left-color: var(--omega-orange);
    color: var(--omega-blue-deep);
    transform: translateX(3px);
}

/* Estado sin resultados */
.autocomplete-item.no-results {
    text-align: center;
    color: #888;
    cursor: default;
    font-style: italic;
    border-left: none;
}

/* DESTACADO DE COINCIDENCIAS */
.autocomplete-highlight {
    color: var(--omega-orange);
    font-weight: 700;
}

/*  TOOLTIP OPCIONAL (nombre completo al pasar el cursor) */
.autocomplete-item[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 12px;
    bottom: -30px;
    background: var(--omega-blue-deep);
    color: var(--white);
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 5px;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* SCROLL Y RESPONSIVIDAD */
.autocomplete-box::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-box::-webkit-scrollbar-thumb {
    background-color: var(--omega-blue-bright);
    border-radius: 3px;
}

/* Responsividad */
@media (max-width: 768px) {
    .autocomplete-box {
        max-height: 180px;
        font-size: 0.9rem;
    }

    .autocomplete-item {
        padding: 0.55rem 0.9rem;
        font-size: 0.9rem;

        /* Ajuste del texto largo también en móviles */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Tooltip desactivado en móvil (por toques) */
    .autocomplete-item[title]:hover::after {
        display: none;
    }
}

/* ANIMACIÓN DE APARICIÓN */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}