

body {
    background-color: var(--bg-white);
    color: var(--text-dark);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}


/* ================= SIDEBAR / FILTERS ================= */

.sidebar {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
}

.filter-section {
    margin-bottom: 24px;
}

.filter-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-title i {
    color: var(--primary-blue);
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary-blue);
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
}

.category-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.category-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-blue);
    cursor: pointer;
}

.category-item.active {
    color: var(--primary-blue);
    font-weight: 700;
}


/* Price Range Slider Styling */

.price-range-wrapper {
    margin-top: 10px;
}

.price-slider-track {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    position: relative;
    margin: 15px 0;
}

.price-slider-fill {
    position: absolute;
    right: 0;
    left: 10%;
    height: 100%;
    background: var(--primary-blue);
    border-radius: 3px;
}

.price-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.btn-apply {
    width: 100%;
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.btn-apply:hover {
    background: var(--primary-hover);
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}


/* ================= MAIN CONTENT AREA ================= */

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* Header controls */

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.results-count {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.sort-select {
    background: white;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    color: var(--text-dark);
    cursor: pointer;
    outline: none;
}


/* Grid of Books */

.books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}


/* Book Card */

.book-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-image-wrapper {
    position: relative;
    background: #f1f5f9;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-image-wrapper img {
    height: 85%;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--badge-bg);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 12px;
    height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.book-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.price-tag {
    text-align: right;
}

.price-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
}

.price-currency {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-buy {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-buy:hover {
    background: var(--primary-hover);
}


/* Pagination */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    direction: ltr;
    /* Keeps numeric order left to right */
}

.page-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    background: var(--bg-light);
}

.page-link.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.page-dots {
    color: var(--text-muted);
    padding: 0 4px;
}


/* ================= RESPONSIVE DESIGN ================= */

@media (max-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
    .books-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

