/* ========================================
   SHOP TABLE STYLES - Табличный вид магазина
   Цветовая палитра проекта Azeroth
   ======================================== */

/* Табы категорий */
.shop-categories-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: linear-gradient(135deg, rgba(30, 30, 80, 0.7) 0%, rgba(15, 15, 50, 0.7) 100%);
    border: 2px solid rgba(120, 140, 255, 0.6);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 18px;
}

.shop-category-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(120, 140, 255, 0.4);
    border-radius: 10px;
    color: #c9d1ff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.shop-category-tab:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #fff;
    border-color: rgba(120, 140, 255, 0.7);
    transform: translateY(-1px);
}

.shop-category-tab.active {
    background: linear-gradient(145deg, #ffd700 0%, #ffeb3b 100%);
    border-color: rgba(255, 215, 0, 0.7);
    color: #0a0a2a;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.35);
}

.shop-category-tab img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

/* Контейнер таблицы */
.shop-table-container {
    background: linear-gradient(135deg, rgba(30, 30, 80, 0.7) 0%, rgba(15, 15, 50, 0.7) 100%);
    border: 2px solid rgba(120, 140, 255, 0.6);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}

/* Таблица товаров */
.shop-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.shop-items-table thead {
    background: linear-gradient(135deg, rgba(20, 20, 60, 0.95) 0%, rgba(10, 10, 40, 0.95) 100%);
}

.shop-items-table thead .thead-labels th {
    padding: 12px 14px;
    text-align: left;
    color: #ffd700;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(120, 140, 255, 0.4);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    transition: background 0.2s ease;
}

/* Все заголовки одного цвета */
.shop-items-table thead th,
.shop-items-table thead .th-text {
    color: #ffd700 !important;
}

/* Колонка ID - узкая */
.shop-items-table th.col-id,
.shop-items-table td.col-id {
    width: 80px;
}

/* Колонка Название */
.shop-items-table th.col-name,
.shop-items-table td.col-name {
    width: 25%;
}

/* Заголовки не переносятся */
.shop-items-table thead .thead-labels th {
    white-space: nowrap;
}

/* Заголовки с сортировкой */
.sortable-th {
    cursor: pointer;
    position: relative;
}

.sortable-th:hover {
    background: rgba(255, 255, 255, 0.05);
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.th-text {
    flex: 1;
}

.sort-btn {
    opacity: 0;
    color: #c9d1ff;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.2s ease, color 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
}

.sortable-th:hover .sort-btn {
    opacity: 1;
}

.sort-btn:hover {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
}

.sort-btn.active {
    opacity: 1;
    color: #70d0e8;
}

/* Строка фильтров в thead */
.shop-items-table thead .thead-filters th {
    padding: 8px 10px;
    border-bottom: 2px solid rgba(120, 140, 255, 0.4);
}

.filter-input {
    width: 100%;
    padding: 8px 10px;
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid rgba(120, 140, 255, 0.4);
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Поле ID - ограничено шириной ячейки */
.col-id .filter-input {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

/* Сброс стилей поиска для WebKit браузеров */
.filter-input[type="search"] {
    -webkit-appearance: none;
    background: transparent !important;
}

.filter-input[type="search"]::-webkit-search-decoration,
.filter-input[type="search"]::-webkit-search-cancel-button,
.filter-input[type="search"]::-webkit-search-results-button,
.filter-input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

.filter-input:focus {
    outline: none;
    border-color: #70d0e8;
    box-shadow: 0 0 6px rgba(112, 208, 232, 0.3);
}

.filter-input::placeholder {
    color: rgba(201, 209, 255, 0.5);
    font-size: 12px;
}

.filter-input-half {
    width: 48%;
    display: inline-block;
}

.filter-input-half:first-of-type {
    margin-right: 4%;
}

/* Кнопка сброса фильтров */
.filter-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 6px;
    color: #ff6b6b;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-clear-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    border-color: #ff6b6b;
    transform: scale(1.1);
}

.shop-items-table th {
    padding: 14px 18px;
    text-align: left;
    color: #ffd700;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(120, 140, 255, 0.4);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.shop-items-table td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(120, 140, 255, 0.2);
    color: #e6e8ff;
    vertical-align: middle;
}

.shop-items-table tbody tr {
    transition: background 0.2s ease;
}

.shop-items-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

.shop-items-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.shop-items-table tbody tr:nth-child(even):hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Колонки */
.col-id {
    width: 70px;
    color: #70d0e8 !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 700;
}

.col-name {
    min-width: 250px;
}

.col-name a {
    color: #70d0e8;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.col-name a:hover {
    color: #a8e8ff;
    text-shadow: 0 0 8px rgba(112, 208, 232, 0.5);
}

/* Качество предметов (WoWHead добавит классы) */
.col-name a.q0 { color: #9d9d9d; } /* Poor */
.col-name a.q1 { color: #ffffff; } /* Common */
.col-name a.q2 { color: #1eff00; } /* Uncommon */
.col-name a.q3 { color: #0070dd; } /* Rare */
.col-name a.q4 { color: #a335ee; } /* Epic */
.col-name a.q5 { color: #ff8000; } /* Legendary */
.col-name a.q6 { color: #e6cc80; } /* Artifact */
.col-name a.q7 { color: #00ccff; } /* Heirloom */

.col-ilvl {
    width: 130px;
    text-align: center;
    color: #c9d1ff !important;
    font-weight: 500;
}

.col-req {
    width: 130px;
    text-align: center;
    color: #c9d1ff !important;
    font-weight: 500;
}

.col-price {
    width: 140px;
    text-align: center;
}

.col-price .price-amount {
    color: #ffd700;
    font-weight: 700;
    font-size: 15px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.col-price .price-icon {
    width: 14px;
    height: 14px;
    margin-left: 4px;
    vertical-align: middle;
}

.col-price .price-icon-sm {
    width: 12px;
    height: 12px;
    margin-left: 3px;
    vertical-align: middle;
    opacity: 0.5;
}

/* Блок цены со скидкой */
.item-price-promo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.item-price-old-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-price-new-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Перечёркнутая старая цена */
.price-amount-old {
    color: #888;
    font-size: 12px;
    text-decoration: line-through;
    font-weight: 400;
}

/* Новая цена со скидкой */
.price-amount-sale {
    color: #ff6b6b !important;
    font-size: 16px !important;
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.4) !important;
}

/* Таймер в строке таблицы */
.item-promo-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    color: #ffa94d;
    margin-top: 2px;
    white-space: nowrap;
}

.item-promo-timer .promo-timer-label {
    font-size: 11px;
}

.item-promo-timer .promo-timer-value {
    font-weight: 600;
    color: #ffa94d;
}

.item-promo-timer.promo-timer-ending .promo-timer-value {
    color: #ff6b6b;
    animation: timer-warning 1s ease-in-out infinite;
}

.col-buy {
    width: 60px;
    text-align: center;
}

/* Кнопка покупки */
.shop-buy-btn {
    background: transparent;
    border: none;
    color: #79e27d;
    font-size: 20px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.shop-buy-btn:hover {
    opacity: 1;
    transform: scale(1.2);
    color: #8eff92;
    text-shadow: 0 0 10px rgba(121, 226, 125, 0.5);
}

/* Пагинация */
.shop-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(20, 20, 60, 0.9) 0%, rgba(10, 10, 40, 0.9) 100%);
    border-top: 1px solid rgba(120, 140, 255, 0.4);
    font-size: 13px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.pagination-btn img {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.pagination-btn img.arrow-flip {
    transform: scaleX(-1);
}

.pagination-btn:hover {
    opacity: 1;
}

.pagination-info {
    color: #c9d1ff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-input {
    width: 55px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(112, 208, 232, 0.3);
    border-radius: 6px;
    color: #fff;
    text-align: center;
    font-size: 13px;
    transition: border-color 0.2s ease;
}

.pagination-input:focus {
    outline: none;
    border-color: #70d0e8;
    box-shadow: 0 0 8px rgba(112, 208, 232, 0.3);
}

.pagination-summary {
    color: rgba(201, 209, 255, 0.6);
    font-size: 12px;
}

/* Пустой магазин */
.shop-empty {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, rgba(30, 30, 80, 0.7) 0%, rgba(15, 15, 50, 0.7) 100%);
    border: 2px solid rgba(120, 140, 255, 0.6);
    border-radius: 14px;
}

.shop-empty-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.4;
}

.shop-empty p {
    color: #c9d1ff;
    font-size: 16px;
    margin: 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .shop-search-form {
        padding: 12px;
    }
    
    .shop-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-group {
        width: 100%;
        min-width: auto;
    }
    
    .filter-group-wide {
        flex: none;
    }
    
    .filter-group input[type="number"] {
        width: 100%;
    }
    
    .filter-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .filter-btn {
        flex: 1;
        justify-content: center;
    }
    
    .shop-categories-tabs {
        gap: 4px;
        padding: 8px;
    }
    
    .shop-category-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .shop-items-table {
        font-size: 12px;
        table-layout: auto;
    }
    
    .shop-items-table th,
    .shop-items-table td {
        padding: 8px 6px;
    }
    
    /* Скрываем колонки на мобильных */
    .col-ilvl,
    .col-req {
        display: none;
    }
    
    /* Адаптация thead */
    .shop-items-table thead .thead-labels th {
        font-size: 11px;
        padding: 10px 6px;
        white-space: normal;
    }
    
    .shop-items-table thead .thead-filters th {
        padding: 6px 4px;
    }
    
    /* Скрываем кнопки сортировки на мобильных */
    .sort-btn {
        display: none;
    }
    
    /* Уменьшаем поля фильтров */
    .filter-input {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .col-id .filter-input {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
    }
    
    /* Колонка ID ещё уже */
    .shop-items-table th.col-id,
    .shop-items-table td.col-id {
        width: 55px;
    }
    
    /* Колонка название шире */
    .shop-items-table th.col-name,
    .shop-items-table td.col-name {
        width: auto;
    }
    
    .shop-pagination {
        flex-direction: column;
        gap: 10px;
        padding: 10px 12px;
    }
    
    .pagination-controls {
        gap: 6px;
    }
    
    .pagination-info {
        font-size: 12px;
    }
    
    .pagination-input {
        width: 45px;
        padding: 4px 6px;
    }
    
    .pagination-summary {
        font-size: 11px;
        text-align: center;
    }
}

/* Планшеты */
@media (max-width: 1024px) and (min-width: 769px) {
    .shop-items-table thead .thead-labels th {
        font-size: 11px;
        padding: 10px 8px;
    }
    
    .filter-input {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .shop-items-table th.col-name,
    .shop-items-table td.col-name {
        width: 22%;
    }
}
