.category {
    margin-top: 20px;
}

.category h2 {
    margin-bottom: 10px;
}

.products-grid {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 0px;
}

.books-category .products-grid {
    gap: 20px;
    justify-content: flex-start; /* This was changed from space-between */
}

.products-grid .product {
    width: 25%;
}

.other-categories .products-grid {
    gap: 0px;
}

.products-grid .product {
    padding: 10px;
}

.product-card-book {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: calc(20% - 20px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card-book .product-image {
    width: 100%;
    overflow: hidden;
    text-align: center;
}

.product-card-book .product-image img {
    width: 100%;
    aspect-ratio: 5 / 7;
    transition: transform 0.3s ease;
    object-fit: cover;
}

.product-card-book .product-image:hover img {
    transform: scale(1.05);
}

.product-card-book .product-info {
    padding: 15px;
}

.product-card-book .product-title {
    font-size: 1.2rem;
    margin: 10px 0;
}

.product-card-book .product-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
    font-size: 16px;
}

.product-card-book .product-title a:hover {
    color: #007bff;
}

.product-card-book .product-meta {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #555;
}

.product-card-book .product-meta li {
    margin: 5px 0;
}

.product-card-book .btn {
    width: 100%;
}

.woocommerce-Price-amount {
    font-weight: 700;
}

@media(max-width: 768px) {
    .product-card-book {
        width: calc(50% - 20px);
    }
    .products-grid .product {
        width: 50%;
    }
}

/* --- START: New Pagination Styles --- */

/* This is the main container for the pagination links */
.woocommerce-pagination {
    display: flex;
    justify-content: center; /* This centers the pagination block */
    align-items: center;
    width: 100%;
    margin-top: 30px;
    padding: 10px 0;
}

/* This targets the individual links and the current page number */
.woocommerce-pagination .page-numbers {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    color: #555;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 40px; /* Ensures all numbers have the same width */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Style for when you hover over a link */
.woocommerce-pagination .page-numbers:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
    color: #333;
}

/* Style for the currently active page number */
.woocommerce-pagination .page-numbers.current {
    background-color: var(--primary-color, #007bff); /* Uses your theme's primary color */
    border-color: var(--primary-color, #007bff);
    color: #fff;
    cursor: default;
}

/* Style for the "..." dots */
.woocommerce-pagination .page-numbers.dots {
    border: none;
    background: none;
    box-shadow: none;
    cursor: default;
}

/* --- END: New Pagination Styles --- */