.devices-catalog-top {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
    gap: 12px;
    align-items: end;
}

.devices-catalog-search {
    margin: 0;
    max-width: 520px;
    justify-self: end;
    width: 100%;
}

.devices-catalog-search .filter-row {
    gap: 0;
}

.devices-catalog-search .filter-item--search {
    flex: 1 1 auto;
}

.devices-catalog-nav {
    margin-top: 8px;
    grid-column: 1 / -1;
}

.devices-catalog-nav .archive-navigation__button.is-active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.devices-catalog-grid {
    --devices-catalog-cols: 4;
    grid-template-columns: repeat(var(--devices-catalog-cols), minmax(0, 1fr));
    align-items: stretch;
}

.device-catalog-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.device-catalog-card__link {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.device-catalog-card__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    overflow: hidden;
    display: grid;
    place-items: center;
}

.device-catalog-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.device-catalog-card__image-empty {
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

.device-catalog-card__name {
    margin: 0;
    font-size: 17px;
    line-height: 1.28;
    color: #111827;
    font-weight: 700;
    text-align: center;
}

.devices-popular {
    margin: 0 0 18px;
}

.devices-popular__title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
    color: #111827;
}

.devices-popular__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.devices-popular-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: #fff;
}

.devices-popular-card__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: inherit;
    text-decoration: none;
}

.devices-popular-card__thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    display: grid;
    place-items: center;
    flex: 0 0 56px;
    overflow: hidden;
}

.devices-popular-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 7px;
}

.devices-popular-card__image-empty {
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
}

.devices-popular-card__body {
    min-width: 0;
}

.devices-popular-card__type,
.devices-popular-card__name,
.devices-popular-card__meta {
    margin: 0;
}

.devices-popular-card__type {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 2px;
}

.devices-popular-card__name {
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
    color: #111827;
}

.devices-popular-card__meta {
    margin-top: 4px;
    font-size: 12px;
    color: #374151;
}

.devices-catalog-empty {
    margin: 6px 0 0;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #ffffff;
    color: #374151;
}

.devices-catalog-pagination {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 26px 0 18px;
    clip: auto !important;
    overflow: visible !important;
    white-space: normal !important;
}

.devices-catalog-pagination ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.devices-catalog-pagination a,
.devices-catalog-pagination span {
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 0 10px;
}

.devices-catalog-pagination .current {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.devices-catalog-pagination li {
    display: inline-flex;
    flex: 0 0 auto;
}

.js .devices-catalog-pagination {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

@media (max-width: 1200px) {
    .devices-catalog-grid {
        --devices-catalog-cols: 3;
    }
}

@media (max-width: 820px) {
    .devices-catalog-top {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .devices-catalog-search {
        justify-self: stretch;
        max-width: none;
    }

    .devices-catalog-grid {
        --devices-catalog-cols: 2;
    }

    .devices-popular__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .devices-catalog-grid {
        --devices-catalog-cols: 2;
        gap: 12px;
    }

    .device-catalog-card__link {
        padding: 10px;
    }

    .device-catalog-card__name {
        font-size: 15px;
    }

    .devices-catalog-pagination {
        margin: 22px 0 14px;
    }

    .devices-catalog-pagination ul {
        justify-content: center;
        padding: 0 6px 2px;
        gap: 5px;
    }

    .devices-catalog-pagination a,
    .devices-catalog-pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
    }
}

