.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    outline: none;
}

.search-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 5px;
    z-index: 99999;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    width: 100%;
}

/* Estilos específicos para mobile */
@media (max-width: 768px) {
    .search-results {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 80vh;
        border-radius: 15px 15px 0 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 99999;
    }

    .search-container {
        position: static;
    }

    /* Estilos para el menú móvil */
    .wrapper-sb {
        position: relative;
    }

    .mobile-nav-links-sb {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 100% !important;
        background: white !important;
        z-index: 99999 !important;
        padding-top: 60px !important;
        overflow-y: auto !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .mobile-nav-links-sb.show {
        transform: translateX(0);
    }

    .close-btn-sb {
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        z-index: 100000 !important;
    }

    .menu-btn-sb {
        z-index: 99998 !important;
    }
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: #222;
    background: #fff;
    pointer-events: auto;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.result-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
}

.result-info {
    flex-grow: 1;
}

.result-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
}

.result-details {
    font-size: 0.85em;
    color: #666;
}

.result-type {
    font-size: 0.8em;
    color: #007bff;
    text-transform: uppercase;
    margin-left: auto;
    padding-left: 15px;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: #666;
}

/* Loading indicator */
.search-loading {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.search-loading::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Overlay para mobile */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.2);
    z-index: 9999;
    pointer-events: none;
}

/* Integración con clases existentes */
.input-group-stars {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    overflow: visible;
}

.search-input.form-control-stars {
    width: 100%;
    height: 41px;
    padding-right: 48px;
    border-radius: 24px 0 0 24px;
    border: 1px solid #ddd;
    font-size: 1.1rem;
    box-sizing: border-box;
}

.search-input.form-control-stars:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    outline: none;
}

.input-group-stars-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0;
    z-index: 2;
}

.search-button {
    background: #888;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 48px;
    border-radius: 0 24px 24px 0;
    font-size: 1.4rem;
    transition: background 0.2s;
    margin-left: -1px;
    padding: 0;
}

.search-button:hover {
    background: #007bff;
    color: #fff;
}

.search-button .icon-search, .search-button i, .search-button svg {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 5px;
}

.search-suggestions.active {
    display: block !important;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.suggestion-content {
    flex: 1;
}

.suggestion-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.suggestion-code {
    font-size: 0.8em;
    color: #666;
}

.suggestion-type {
    font-size: 0.8em;
    color: #888;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f0f0f0;
}

/* Estilo para el scrollbar */
.search-suggestions::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Estilos responsive */
@media screen and (min-width: 768px) {
    .search-container {
        max-width: 500px;
        margin-left: auto;
    }
    
    .search-container .form-control-stars {
        border-radius: 15px 0 0 15px !important;
    }
}

@media screen and (max-width: 768px) {
    .search-container {
        display: none;
    }

    .search-suggestions {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 80vh;
        border-radius: 15px 15px 0 0;
        margin-top: 0;
    }
}

/* Loading state */
.search-loading {
    padding: 15px;
    text-align: center;
    color: #666;
}

/* No results state */
.no-results {
    padding: 15px;
    text-align: center;
    color: #666;
}

/* Ajustes para el input de búsqueda */
.form-control-stars {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Ajustes para el botón de búsqueda */
.input-group-stars-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.search-btn {
    height: 100%;
    padding: 0 15px;
    border: none;
    background: none;
    cursor: pointer;
} 