/**
 * Стили для раскрывающихся меню с ценами поставщиков
 * Современный минималистичный дизайн
 */

/* Кнопка раскрывающегося меню */
.price-dropdown-btn {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
    border: 1px solid rgba(79, 172, 254, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    color: #4facfe;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.price-dropdown-btn:hover {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.2) 0%, rgba(0, 242, 254, 0.2) 100%);
    border-color: #4facfe;
    transform: translateY(-1px);
}

.price-dropdown-btn.expanded {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.3) 0%, rgba(0, 242, 254, 0.3) 100%);
    border-color: #4facfe;
}

.dropdown-icon {
    font-size: 0.9rem;
}

.dropdown-text {
    font-weight: 500;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.price-dropdown-btn.expanded .dropdown-arrow {
    transform: rotate(180deg);
}

/* Контент раскрывающегося меню */
.price-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(79, 172, 254, 0.3);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Заголовок с статистикой */
.price-dropdown-header {
    padding: 12px;
    border-bottom: 1px solid rgba(79, 172, 254, 0.2);
    background: rgba(79, 172, 254, 0.05);
}

.price-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

.stat-item {
    color: #a0a9c1;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Список цен */
.price-list {
    max-height: 200px;
    overflow-y: auto;
}

.price-item {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(79, 172, 254, 0.1);
    transition: background-color 0.2s ease;
}

.price-item:last-child {
    border-bottom: none;
}

.price-item:hover {
    background: rgba(79, 172, 254, 0.05);
}

.price-supplier {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.supplier-name {
    font-weight: 500;
    color: #ffffff;
    font-size: 0.85rem;
}

.availability {
    font-size: 0.75rem;
    color: #a0a9c1;
    background: rgba(160, 169, 193, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.price-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.price-value {
    font-weight: 600;
    color: #4facfe;
    font-size: 0.9rem;
}

.price-description {
    font-size: 0.75rem;
    color: #a0a9c1;
    flex: 1;
    text-align: right;
    opacity: 0.8;
}

/* Состояния загрузки */
.loading-state,
.no-prices-state,
.error-state {
    padding: 20px;
    text-align: center;
    color: #a0a9c1;
}

.loading-state .spinner {
    font-size: 1.5rem;
    margin-bottom: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.no-prices-state .no-prices-icon,
.error-state .error-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.no-prices-text,
.error-text {
    font-weight: 500;
    margin-bottom: 4px;
    color: #ffffff;
}

.no-prices-hint {
    font-size: 0.8rem;
    opacity: 0.7;
}

.retry-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

/* Позиционирование относительно товара */
.order-item {
    position: relative;
}

.item-meta {
    position: relative;
}

.price-dropdown-container {
    position: relative;
    display: inline-block;
}

/* Скроллбар для списка цен */
.price-list::-webkit-scrollbar {
    width: 4px;
}

.price-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.price-list::-webkit-scrollbar-thumb {
    background: rgba(79, 172, 254, 0.3);
    border-radius: 2px;
}

.price-list::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 172, 254, 0.5);
}

/* Адаптивность */
@media (max-width: 768px) {
    .price-dropdown-content {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 400px;
        max-height: 70vh;
    }
    
    .price-stats {
        flex-direction: column;
        gap: 6px;
    }
    
    .price-supplier {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .price-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Анимации */
.price-item {
    animation: slideIn 0.3s ease;
}

.price-item:nth-child(1) { animation-delay: 0.1s; }
.price-item:nth-child(2) { animation-delay: 0.2s; }
.price-item:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Эффекты при наведении */
.price-item:hover .supplier-name {
    color: #4facfe;
}

.price-item:hover .price-value {
    color: #00f2fe;
}

/* Индикаторы лучшей цены */
.price-item.best-price {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border-left: 3px solid #28a745;
}

.price-item.best-price .price-value {
    color: #28a745;
}

.price-item.best-price::before {
    content: '🏆';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
}
