.book-card {
    transition: transform 0.3s ease;
    height: 100%;
    border: none;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.book-image-container {
    width: 100%;
    height: 250px;
    /* Cố định chiều cao khung */
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
}

.book-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    /* Giữ nguyên ảnh, không cắt */
    object-position: center;
    transition: transform 0.3s ease;
    animation: fadeIn 0.5s ease-in;
}

/* Placeholder khi không có ảnh */
.book-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #6c757d;
}

.book-card:hover .book-image {
    transform: scale(1.1);
}

/* Category badge */
.book-category {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Card body */
.card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    /* Cố định chiều cao tối thiểu */
}

/* Title - 2 lines */
.book-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
}

/* Author */
.book-author {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.4rem;
}

.book-author i {
    margin-right: 0.3rem;
    color: #007bff;
}

/* Meta info */
.book-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

.book-meta i {
    margin-right: 0.3rem;
    color: #007bff;
}

/* Description */
.book-description {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
    height: 3.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.8rem;
}

/* Price container - Giống search.css, KHÔNG có lớp phủ trắng */
.price-container {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.price-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* Price styling - Giống search.css */
.book-price {
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.price-icon {
    margin-right: 4px;
    font-size: 1rem;
}

.currency {
    font-size: 0.8rem;
    margin-left: 3px;
    opacity: 0.9;
}

/* Button styling - Giống search.css */
.btn-group-custom {
    gap: 4px;
}

.btn-custom {
    border-radius: 5px;
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    transition: all 0.3s ease;
}

.btn-primary-custom {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-1px);
    color: white;
}

.btn-outline-custom {
    border: 1px solid #667eea;
    color: #667eea;
    background: transparent;
}

.btn-outline-custom:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Pagination styling */
.pagination {
    margin-top: 1.5rem;
}

.page-link {
    color: #667eea;
    border: 1px solid #dee2e6;
}

.page-link:hover {
    color: #fff;
    background-color: #667eea;
    border-color: #667eea;
}

.page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
}

/* Per page selector */
.per-page-selector {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Grid improvements */
.row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.row>[class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .book-image-container {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .book-image-container {
        height: 200px;
    }

    .book-title {
        font-size: 0.85rem;
    }

    .card-body {
        min-height: 180px;
    }
}

@media (max-width: 576px) {
    .book-image-container {
        height: 180px;
    }

    .book-title {
        font-size: 0.8rem;
        height: 2.4em;
    }

    .card-body {
        min-height: 160px;
        padding: 0.8rem;
    }
}