/* Плавание фильтров */
#filters-wrapper {
    flex: 0 0 300px; /* фиксированная ширина */
}

#filters {
    position: sticky;
    top: 20px;
}

/* Липкие колонки */
.sticky-first {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
}

.sticky-price {
    position: sticky;
    right: 7.5rem;
    z-index: 2;
    background: #fff;
}

.sticky-action {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
}

/* Чипы */
.chip {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    line-height: 1rem;
    white-space: nowrap;
}

.chip-muted {
    background: #F1F5F9;
    color: #0F172A;
}

.chip-green {
    background: #DCFCE7;
    color: #14532D;
}

.chip-amber {
    background: #FEF3C7;
    color: #92400E;
}

/* Плотность строк: всегда компактно */
.density-compact td {
    padding: .5rem .5rem;
}

/* Hover + раскрытие */
.row-hover:hover {
    background: #F8FAFC;
}

.details {
    display: none;
}

.row-expanded + .details {
    display: table-row;
}

.caret {
    transition: transform .2s ease;
}

.rot-90 {
    transform: rotate(90deg);
}

/* Мобильные карточки */
@media (max-width: 1024px) {
    table thead {
        display: none;
    }

    table tbody, table tr, table td {
        display: block;
        width: 100%;
    }

    tr {
        border: 1px solid #E5E7EB;
        border-radius: 12px;
        margin-bottom: 12px;
        background: #fff;
    }

    td {
        border-bottom: 1px dashed #E5E7EB;
    }

    td:last-child {
        border-bottom: none;
    }

    .sticky-first, .sticky-price, .sticky-action {
        position: static;
        right: auto;
        left: auto;
    }
}

/* Сбрасываем обычные бордеры у этих строк */
tr.row-main.active td,
tr.row-main.active + tr.details td {
    border: none;
}

/* Общая рамка */
tr.row-main.active td {
    border-top: 2px solid #93c5fd;   /* верх рамки */
    background-color: #bfdcff !important;
}

tr.row-main.active + tr.details td {
    border-bottom: 2px solid #93c5fd; /* низ рамки */
    background-color: #bfdcff !important;
}

/* Левая и правая граница у обеих */
tr.row-main.active td:first-child,
tr.row-main.active + tr.details td:first-child {
    border-left: 2px solid #93c5fd;
    background-color: #bfdcff !important;
}

tr.row-main.active td:last-child,
tr.row-main.active + tr.details td:last-child {
    border-right: 2px solid #93c5fd;
    background-color: #bfdcff !important;
}

.configurator {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

/* Контейнер фильтров */
.filters-box {
    background: #bfdcff;
    padding: 1rem;
    border-radius: 1rem; /* аналог rounded-2xl */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* аналог shadow */
    width: 300px;
}

/* Заголовок */
.filters-title {
    font-size: 1.125rem; /* аналог text-lg */
    font-weight: bold;
    margin-bottom: 1rem;
}

/* Группы фильтров */
.filter-group {
    margin-bottom: 1rem;
}

/* Лейблы */
.filter-label {
    display: block;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    color: #374151; /* text-gray-700 */
    margin-bottom: 0.25rem;
}

/* Селекты */
.filter-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fff;
}

/* Слайдеры */
.filter-slider {
    margin-top: 0.5rem;
}

/* Диапазон значений */
.filter-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}
/* Обертка для серваков */
.servers-wrapper {
    flex: 1; /* занимает оставшееся место */
}

/* Коробка для содержимого */
.servers-box {
    background: #fff;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Счётчик */
.servers-count {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563; /* text-gray-600 */
}

/* Верхняя панель */
.servers-topbar,
.servers-bottombar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

/* Пагинация */
.pagination {
    display: flex;
    gap: 0.5rem;
}

/* Блок выбора количества */
.perpage {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.filter-select-count {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fff;
}

/* Таблица */
.table-wrapper {
    overflow-x: auto;
}

.servers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem; /* text-sm */
}

.servers-table thead {
    background: #f3f4f6; /* bg-gray-100 */
    color: #475569;      /* text-slate-600 */
    text-align: left;
}

.servers-table th,
.servers-table td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    font-weight: 500;
}

/* Заголовки таблицы жирные */
.servers-table th {
    font-weight: 600;
}

/* Выравнивание */
.text-right {
    text-align: right;
}

/* Модалка */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal.hidden {
    display: none;
}

.modal-box {
    background: #fff;
    width: 100%;
    max-width: 42rem; /* аналог max-w-2xl */
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* Хедер */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600;
}

.modal-close {
    font-size: 1.2rem;
    color: #6b7280; /* gray-500 */
    cursor: pointer;
    background: none;
    border: none;
    transition: color .2s;
}

.modal-close:hover {
    color: #000;
}

/* Форма */
.modal-form {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-serverinfo {
    font-size: 0.875rem;
    color: #374151;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-submit {
    background: #2563eb; /* blue-600 */
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background .2s;
}

.btn-submit:hover {
    background: #1d4ed8; /* темнее */
}

/* Сообщение */
.order-message {
    padding: 1rem;
    color: #16a34a; /* green-600 */
    display: none; /* скрыто по умолчанию */
}

/* Ячейка CPU */
.cpu-cell {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.cpu-cell .caret {
    width: 12px;
    height: 12px;
    color: #94a3b8;
    margin-top: 2px;
    transition: transform .2s;
}

/* Детали */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.details-label {
    color: #64748b; /* slate-500 */
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

/* Кнопка заказа */
.order-btn {
    background: #16a34a; /* green-600 */
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background .2s;
    font-size: 0.875rem;
}
.order-btn:hover {
    background: #15803d; /* green-700 */
}

/* Пагинация */
.pagination-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    background: #fff;
    cursor: pointer;
    transition: background .2s;
    font-size: 0.875rem;
}
.pagination-btn:hover:not(.disabled):not(.active) {
    background: #f1f5f9;
}
.pagination-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination-dots {
    padding: 0 0.5rem;
}

.align-top{
    text-align: center;
    vertical-align: middle;
}

/* === Адаптивность === */
@media (max-width: 1199px) {
    .configurator {
        flex-direction: column; /* фильтры сверху, сервера снизу */
    }

    #filters-wrapper {
        flex: 1 1 auto;
        width: 100%;
    }

    .filters-box {
        width: 100%; /* фильтры растягиваются */
    }

    .servers-wrapper {
        width: 100%;
    }
}

.cursor-pointer {
    cursor: pointer;
}

/* Адаптивная пагинация */
@media (max-width: 1199px) {
    .servers-topbar,
    .servers-bottombar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center; /* центрируем */
    }

    /* Кнопки пагинации компактнее */
    .pagination {
        flex-wrap: wrap; /* чтобы переносились */
        justify-content: center;
    }

    .pagination-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        min-width: 36px;
    }

    .pagination-dots {
        padding: 0 0.25rem;
    }

    /* Блок выбора количества серверов */
    .perpage {
        justify-content: center;
        font-size: 0.8rem;
        gap: 0.25rem;
    }

    .filter-select-count {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Совсем узкие экраны (например, смартфон) */
@media (max-width: 600px) {
    .pagination-btn {
        min-width: 28px;
        padding: 0.3rem 0.4rem;
        font-size: 0.7rem;
    }
    .perpage label {
        display: none; /* можно скрыть подпись для экономии места */
    }
}