:root {
    --bg: #f3f5f9;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #dbe2ea;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eaf2ff;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, Arial, sans-serif;
    background: radial-gradient(circle at top left, #d8dbdf 0%, #d3d5d9 35%, #ced2d7 100%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.brand {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.brand span {
    color: var(--primary);
}

.toolbar {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 20px;
}

.filters {
    display: grid;
    grid-template-columns: 2fr 180px 140px 140px 170px 170px 180px 120px;
    gap: 12px;
}

.filters input[type="text"],
.filters input[type="number"],
.filters select {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    background: #fff;
    outline: none;
    font-size: 14px;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.filters input:focus,
.filters select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    background: #fff;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
}

.checkbox-wrap input {
    accent-color: var(--primary);
}

.btn {
    height: 46px;
    border: 0;
    border-radius: 12px;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.20);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.count {
    color: var(--muted);
    font-size: 14px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.10);
    border-color: #bfd3f9;
}

.image-wrap {
    position: relative;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.badge-row {
    position: absolute;
    left: 12px;
    top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
    backdrop-filter: blur(6px);
}

.badge.reserved {
    color: #991b1b;
    background: rgba(254, 226, 226, .96);
    border-color: #fecaca;
}

.badge.shipping {
    color: #1e40af;
    background: rgba(219, 234, 254, .96);
    border-color: #bfdbfe;
}

.badge.warranty {
    color: #166534;
    background: rgba(220, 252, 231, .96);
    border-color: #bbf7d0;
}

.badge.refurbished {
    color: #92400e;
    background: rgba(254, 243, 199, .96);
    border-color: #fde68a;
}

.card-body {
    padding: 16px;
}

.price {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
    min-height: 42px;
    color: #111827;
}

.desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    min-height: 58px;
    margin-bottom: 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.info {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.source {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 11px;
    border: 1px solid #cfe0ff;
    text-transform: uppercase;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 700;
}

.pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.empty {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    color: var(--muted);
    box-shadow: var(--shadow);
}

@media (max-width: 1280px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filters {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 16px;
    }

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

    .filters {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
