/* Estilos para el overlay de búsqueda */
.search-navigation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.search-navigation-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.search-overlay-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.search-overlay-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #f7921e;
    border-radius: 50%;
    animation: search-spinner-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes search-spinner-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-overlay-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.search-overlay-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.search-overlay-query {
    font-size: 18px;
    color: #f7921e;
    font-weight: 500;
    background: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #f7921e;
    display: inline-block;
}

.search-overlay-progress {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
}

.search-overlay-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffb870 0%, #f7921e 50%, #ff6600 100%);
    border-radius: 3px;
    width: 0;
    position: absolute;
    animation: progress-animation 2s ease-in-out infinite;
}

@keyframes progress-animation {
    0% { width: 0; left: 0; }
    50% { width: 70%; left: 0; }
    100% { width: 0; left: 100%; }
}

/* Estilos para resultados de autocompletado */
.resultados-vista-previa {
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    margin-top: 5px;
    scrollbar-width: thin;
    scrollbar-color: #ddd #fff;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f7f9fc;
}

.autocomplete-item.suggested {
    background-color: #fff5e6;
}

.autocomplete-item.ver-mas-resultados {
    background-color: #f7921e;
    color: white;
    font-weight: bold;
    justify-content: center;
    padding: 14px;
    text-align: center;
}

.autocomplete-item.ver-mas-resultados:hover {
    background-color: #ff6a00;
}

.item-image-wrapper {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 12px;
    background-color: #f5f5f5;
    position: relative;
}

.item-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}

.item-image-wrapper img:not(.loaded) {
    opacity: 0;
}

.item-image-wrapper img.loaded {
    opacity: 1;
}

.item-content {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.item-meta {
    font-size: 12px;
    color: #666;
}

.item-arrow {
    color: #999;
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.item-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.autocomplete-item.enhanced img.loaded + .item-shimmer {
    display: none;
}

.autocomplete-item.enhanced {
    position: relative;
}

.autocomplete-item.no-results,
.autocomplete-item.error-state {
    justify-content: center;
    text-align: center;
    padding: 20px 16px;
    cursor: default;
}

.autocomplete-item.error-state .item-title {
    color: #e53935;
}