/* Файл: assets/css/shop.css (Baseline v3.46 - Фикс истории и адаптивности) */

.shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 350px);
    justify-content: center;
    gap: 30px;
    margin-top: 2rem;
    align-items: stretch;
}

.shop-item {
    display: flex;
    flex-direction: column;
    padding: 25px;
    background-color: var(--surface-color);
    border: 1px solid #282828;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 350px;
}

.shop-item h3 { margin-top: 0; margin-bottom: 1rem; font-size: 1.4rem; color: var(--accent-color); }
.shop-item-desc { font-size: 0.9rem; color: #fff; flex-grow: 1; margin-bottom: 1.5rem; }

.shop-form .form-group-row label { color: #fff; font-weight: bold; margin-bottom: 5px; display: block; }

/* ТЕМНАЯ ТЕМА SELECT2 */
.select2-container--default .select2-selection--single {
    background-color: #0f0f1a !important;
    border: 1px solid #334 !important;
    height: 40px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #fff !important;
    line-height: 40px !important;
}
.select2-dropdown {
    background-color: #161625 !important;
    border: 1px solid #334 !important;
    color: #fff !important;
}
.select2-results__option { background-color: #161625 !important; color: #fff !important; }
.select2-results__option--highlighted { background-color: var(--accent-color) !important; color: #000 !important; }
.select2-search__field { background-color: #0c0c14 !important; color: #fff !important; border: 1px solid #444 !important; }

/* БЛОК ИСТОРИИ С ПРОКРУТКОЙ */
.purchase-history-section {
    margin: 4rem auto 2rem auto;
    max-width: 1110px;
    padding: 25px;
    background-color: #1a1a2e;
    border-left: 2px solid #ffc107;
    border-right: 2px solid #ffc107;
    border-radius: 8px;
}

.purchase-history-section h2 {
    text-align: center;
    color: #fff;
    margin-bottom: 1.5rem;
}

.history-scroll-box-shop {
    max-height: 450px; /* Высота блока до появления прокрутки */
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg-color);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #334;
}

/* Настройка скроллбара таблицы */
.history-scroll-box-shop::-webkit-scrollbar { width: 8px; }
.history-scroll-box-shop::-webkit-scrollbar-track { background: #0c0c14; }
.history-scroll-box-shop::-webkit-scrollbar-thumb { background: #363377; border-radius: 10px; }
.history-scroll-box-shop::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }

.shop-history-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Фиксируем ширину для контроля переполнения */
}

.shop-history-table th, .shop-history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #282828;
    color: #fff;
    word-wrap: break-word; /* Перенос длинных названий */
    overflow-wrap: break-word;
}

/* Ширина колонок */
.shop-history-table th:nth-child(1) { width: 15%; } /* Услуга */
.shop-history-table th:nth-child(2) { width: 45%; } /* Трек */
.shop-history-table th:nth-child(3) { width: 20%; } /* Статус */
.shop-history-table th:nth-child(4) { width: 20%; } /* Дата */

@media (max-width: 1150px) {
    .shop-grid { grid-template-columns: 1fr 1fr; justify-items: center; }
    .shop-item { width: 100%; max-width: 350px; }
    .purchase-history-section { max-width: 95%; }
}

@media (max-width: 768px) {
    .shop-grid { grid-template-columns: 1fr; }
    .purchase-history-section { padding: 15px; }
    .shop-history-table { font-size: 0.8rem; }
    .shop-history-table th, .shop-history-table td { padding: 8px 5px; }
    .history-scroll-box-shop { overflow-x: auto; } /* На мобилках разрешаем горизонтальный свайп самой таблицы */
}
