/* css/catalog-table.css — таблица каталога для клиентов */

.catalog-table-page { padding: 24px 0 60px; }
.catalog-table-page h1 { font-size: 28px; margin-bottom: 16px; }

/* ============================================================
   ФИЛЬТРЫ
   ============================================================ */
.catalog-table-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}
.catalog-table-filters input[type="text"] {
    flex: 1 1 280px;
    min-width: 0;
    height: 44px;
    padding: 0 18px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #e1e4e8;
    border-radius: 50px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: .15s;
}
.catalog-table-filters input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.catalog-table-filters select {
    flex: 0 0 auto;
    min-width: 240px;
    height: 44px;
    padding: 0 18px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #e1e4e8;
    border-radius: 50px;
    background: #fff;
    color: var(--ink);
    outline: none;
    cursor: pointer;
}
.catalog-table-filters select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.catalog-table-filters .btn-primary {
    height: 44px;
    padding: 0 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.catalog-table-filters .btn-primary:hover { background: var(--accent-dark); }
.catalog-table-filters .btn-ghost {
    height: 44px;
    padding: 0 20px;
    background: transparent;
    color: var(--muted);
    border: 1px solid #e1e4e8;
    border-radius: 50px;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-family: inherit;
}
.catalog-table-filters .btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

.catalog-table-count {
    color: var(--muted);
    margin-bottom: 14px;
    font-size: 14px;
}

/* ============================================================
   ТАБЛИЦА
   ============================================================ */
.catalog-table-wrap {
    overflow-x: auto;
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}
.catalog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.catalog-table thead {
    background: #f5f7f6;
}
.catalog-table th {
    text-align: left;
    padding: 14px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #6b7a74;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid #eae6e1;
    white-space: nowrap;
}
.catalog-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f3f1;
    vertical-align: middle;
}
.catalog-table tr:last-child td { border-bottom: none; }
.catalog-table tbody tr:hover { background: #fafbfa; }

.catalog-table .col-cover {
    width: 70px;
    padding: 8px 12px;
}
.catalog-table .col-cover img {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.catalog-table .catalog-table-title {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
}
.catalog-table .catalog-table-title:hover { color: var(--accent); }
.catalog-table .col-age { width: 80px; text-align: center; }
.catalog-table .col-price {
    width: 110px;
    white-space: nowrap;
    font-weight: 700;
    color: var(--accent);
}
.catalog-table .col-actions {
    width: 200px;
    white-space: nowrap;
    text-align: right;
}

/* Кнопки */
.catalog-table .btn-cart,
.catalog-table .btn-selection,
.catalog-table .btn-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    text-decoration: none;
    transition: .15s;
    margin-left: 4px;
    vertical-align: middle;
}
.catalog-table .btn-cart {
    background: var(--accent);
    color: #fff;
}
.catalog-table .btn-cart:hover { background: var(--accent-dark); }
.catalog-table .btn-cart:disabled {
    background: #c9d3cd;
    cursor: default;
}
.catalog-table .btn-selection {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0 10px;
    font-size: 16px;
}
.catalog-table .btn-selection:hover { background: var(--accent); color: #fff; }
.catalog-table .btn-selection:disabled { background: #e1e4e8; color: #a5b2ac; cursor: default; }
.catalog-table .btn-preview {
    background: #f0f3f1;
    color: #6b7a74;
    padding: 0 10px;
    font-size: 15px;
}
.catalog-table .btn-preview:hover { background: #e1e4e8; }

.catalog-table-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 15px;
}

/* ============================================================
   МОБИЛЬНЫЙ
   ============================================================ */
@media (max-width: 860px) {
    .catalog-table-filters input[type="text"],
    .catalog-table-filters select {
        flex: 1 1 100%;
        min-width: 0;
    }
    .catalog-table-filters .btn-primary,
    .catalog-table-filters .btn-ghost {
        flex: 1 1 100%;
        justify-content: center;
        text-align: center;
    }
    .catalog-table-page h1 { font-size: 22px; }

    .catalog-table .col-cover { width: 56px; padding: 6px 8px; }
    .catalog-table .col-cover img { width: 40px; height: 56px; }
    .catalog-table th,
    .catalog-table td { padding: 8px 6px; font-size: 13px; }
    .catalog-table .col-actions { width: auto; }
    .catalog-table .btn-cart { padding: 0 10px; font-size: 12px; }
    .catalog-table .col-price { width: auto; }
    .catalog-table .col-age { width: auto; }
}

/* ============================================================
   БЛОК ТЕГОВ (уточняющий поиск)
   ============================================================ */
.catalog-table-tags {
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #f5f7f6;
    border-radius: 12px;
    border: 1px solid #eae6e1;
}
.catalog-table-tags[hidden] { display: none; }

.catalog-table-tags__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.catalog-table-tags__title {
    font-size: 13px;
    font-weight: 700;
    color: #6b7a74;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.catalog-table-tags__reset {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    text-decoration: underline;
}
.catalog-table-tags__reset:hover { color: var(--accent-dark); }

.catalog-table-tags__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    color: var(--ink);
    border: 1px solid #e1e4e8;
    border-radius: 50px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
}
.tag-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.tag-chip.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
}
.tag-chip.is-loading {
    opacity: .6;
    pointer-events: none;
}

/* Мобильный */
@media (max-width: 860px) {
    .catalog-table-tags { padding: 10px 12px; }
    .catalog-table-tags__title { font-size: 12px; }
    .tag-chip { padding: 5px 10px; font-size: 12px; }
}

/* ============================================================
   ВСПЛЫВАЮЩЕЕ УВЕДОМЛЕНИЕ
   ============================================================ */
.catalog-notice {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 9999;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    max-width: 90vw;
    text-align: center;
}
.catalog-notice.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.catalog-notice.is-success { background: #2e7d5b; }
.catalog-notice.is-warning { background: #d97706; }
.catalog-notice.is-error   { background: #c0392b; }
.catalog-notice.is-info    { background: #4a5568; }

@media (max-width: 860px) {
    .catalog-notice {
        top: 12px;
        font-size: 13px;
        padding: 10px 18px;
    }
}

/* Сортировка */
.catalog-table .sort-link {
    color: #6b7a74;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color .15s;
}
.catalog-table .sort-link:hover {
    color: var(--accent);
}
.catalog-table .sort-arrow {
    font-size: 12px;
    opacity: .7;
}