/**
 * ProductSearchPicker - стили компонента поиска и выбора товаров
 */

.product-search-picker .product-picker-item {
    transition: all 0.15s ease;
    border: 2px solid transparent;
}

.product-search-picker .product-picker-item:hover {
    border-color: #dee2e6;
    background-color: #f8f9fa;
}

.product-search-picker .product-picker-item.selected {
    border-color: #198754 !important;
    background-color: #d1e7dd !important;
}

.product-search-picker .product-picker-item.selected .card {
    border-color: #198754;
}

/* Grid view - карточки */
.product-search-picker .product-picker-grid[data-view="grid"] {
    display: flex;
    flex-wrap: wrap;
}

.product-search-picker .product-picker-grid[data-view="grid"] .product-picker-item .card {
    transition: transform 0.15s, box-shadow 0.15s;
}

.product-search-picker .product-picker-grid[data-view="grid"] .product-picker-item:hover .card {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-search-picker .product-picker-grid[data-view="grid"] .product-picker-item.selected .card {
    box-shadow: 0 0 0 2px #198754;
}

/* List view - список */
.product-search-picker .product-picker-grid[data-view="list"] {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-search-picker .product-picker-grid[data-view="list"] .col-6,
.product-search-picker .product-picker-grid[data-view="list"] .col-lg-4,
.product-search-picker .product-picker-grid[data-view="list"] .col-xl-3 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0;
}

/* Loading spinner */
.product-search-picker .product-picker-loading {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Контент - scrollable */
.product-search-picker .product-picker-content {
    position: relative;
    min-height: 150px;
}

/* Фильтры */
.product-search-picker .product-picker-filters {
    background-color: #f8f9fa;
}

/* Счетчик выбранных */
.product-search-picker .product-picker-selected-count {
    min-width: 24px;
    text-align: center;
}

/* Иконка выбора в list view */
.product-search-picker .product-picker-grid[data-view="list"] .bi-circle,
.product-search-picker .product-picker-grid[data-view="list"] .bi-check-circle-fill {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Иконка выбора в grid view */
.product-search-picker .product-picker-grid[data-view="grid"] .check-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Пустой результат */
.product-search-picker .product-picker-empty {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Кнопка очистки поиска */
.product-search-picker .product-picker-search-clear {
    border-left: 0;
}

/* Hover эффект для кнопок действий */
.product-search-picker .card-footer .btn {
    transition: all 0.15s;
}

/* Адаптивность */
@media (max-width: 768px) {
    .product-search-picker .product-picker-grid[data-view="grid"] .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .product-search-picker .card-header .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .product-search-picker .card-header .input-group {
        width: 100% !important;
    }

    .product-search-picker .card-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .product-search-picker .card-footer > div {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .product-search-picker .card-footer .btn {
        flex: 1;
    }
}

@media (max-width: 576px) {
    .product-search-picker .product-picker-grid[data-view="grid"] .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .product-search-picker .product-picker-filters .row {
        flex-direction: column;
    }

    .product-search-picker .product-picker-filters .col-auto {
        width: 100%;
    }

    .product-search-picker .product-picker-filters .col-auto.ms-auto {
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }
}
