/* Базовые стили (ПК) */
.bagon-ajax-search-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    font-family: inherit;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
}

.bagon-search-input-container {
    position: relative;
    width: 100%;
    overflow: visible;
}

.bagon-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 40px 12px 15px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
}

.bagon-search-input:focus {
    border-color: #fbd38d;
}

.bagon-search-loader {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #555;
    border-top-color: #fbd38d;
    border-radius: 50%;
    animation: bagon-spin 1s linear infinite;
}

@keyframes bagon-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.bagon-search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 150%;
    max-height: 450px;
    overflow-y: auto;
    background: #1f1f1f;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 999999;
    padding: 10px;
    box-sizing: border-box;
}

.bagon-search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bagon-search-result-item {
    border-bottom: 1px solid #2d2d2d;
    transition: background 0.2s ease;
    border-radius: 6px;
}

.bagon-search-result-item:last-child {
    border-bottom: none;
}

.bagon-search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.bagon-search-widget-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    text-decoration: none !important;
    color: inherit;
}

.bagon-search-widget-img img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.bagon-search-widget-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.bagon-search-widget-name {
    font-size: 13px;
    color: #e0e0e0;
    line-height: 1.2;
    margin-bottom: 4px;
}

.bagon-search-widget-price {
    font-size: 13px;
    color: #fbd38d;
    margin-top: 2px;
}

.bagon-search-empty {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
}

/* Скроллбар */
.bagon-search-dropdown::-webkit-scrollbar { width: 6px; }
.bagon-search-dropdown::-webkit-scrollbar-track { background: #1f1f1f; }
.bagon-search-dropdown::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
.bagon-search-dropdown::-webkit-scrollbar-thumb:hover { background: #555; }

/* =========================================
   АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ И МОБИЛЬНЫХ
   ========================================= */

/* Планшеты (до 768px) */
@media (max-width: 768px) {
    .bagon-search-input {
        padding: 10px 35px 10px 12px;
        font-size: 14px;
    }
    
    .bagon-search-dropdown {
        max-height: 350px;
        width: 100%;
    }
    
    .bagon-search-widget-img img {
        width: 45px;
        height: 45px;
    }
}

/* Мобильные телефоны (до 480px) */
@media (max-width: 480px) {
    .bagon-search-input {
        padding: 8px 30px 8px 10px;
        font-size: 13px;
    }
    
    .bagon-search-loader {
        right: 10px;
        width: 16px;
        height: 16px;
    }
    
    .bagon-search-dropdown {
        max-height: 300px;
        padding: 5px;
        top: calc(100% + 5px);
        width: 100%;
    }
    
    .bagon-search-widget-link {
        gap: 8px;
        padding: 8px;
    }
    
    .bagon-search-widget-img img {
        width: 40px;
        height: 40px;
    }
    
    .bagon-search-widget-name {
        font-size: 12px;
    }
}