/* 1. THIẾT LẬP CHUNG (RESET CSS) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif; /* Font chữ hiện đại cho nội dung */
    background-color: #f9f5f0; /* Màu nền kem nhạt dịu mắt */
    color: #333;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Merriweather', serif; /* Font có chân cho tiêu đề nhìn sang trọng */
}

a {
    text-decoration: none;
    color: inherit;
}

/* 2. HEADER & MENU */
header {
    background-color: #5D4037; /* Màu nâu gỗ */
    color: #fff;
    padding: 15px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; /* Menu dính trên cùng khi cuộn */
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.logo h1 {
    font-size: 24px;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    color: #FFCC80; /* Màu vàng nhạt khi di chuột vào */
}

.cart-icon {
    font-size: 18px;
    cursor: pointer;
}

/* 3. BANNER (HERO SECTION) */
.hero-banner {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?auto=format&fit=crop&q=80&w=1600');
    background-size: cover;
    background-position: center;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
}

.hero-content h2 {
    font-size: 40px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 20px;
}

.btn-primary {
    background-color: #E64A19; /* Màu cam đất nổi bật */
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    transition: transform 0.3s, background-color 0.3s;
}

.btn-primary:hover {
    background-color: #D84315;
    transform: scale(1.05);
}

/* 4. PHẦN SÁCH (GRID LAYOUT) */
#book-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: #5D4037;
    font-size: 32px;
    border-bottom: 3px solid #E64A19;
    display: inline-block;
    padding-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.book-container {
    display: grid;
    /* Tự động chia cột: mỗi cột tối thiểu 250px */
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); 
    gap: 30px;
}

.book-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    padding-bottom: 20px;
}

.book-card:hover {
    transform: translateY(-10px); /* Hiệu ứng bay lên khi di chuột */
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.book-img {
    height: 300px;
    overflow: hidden;
    background-color: #ddd;
}

.book-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Đảm bảo ảnh lấp đầy khung mà không bị méo */
    transition: transform 0.5s;
}

.book-card:hover .book-img img {
    transform: scale(1.1); /* Phóng to ảnh nhẹ khi hover */
}

.book-info {
    padding: 15px;
}

.book-title {
    font-size: 18px;
    margin: 10px 0 5px;
    color: #333;
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis; /* Cắt bớt tên sách nếu quá dài */
}

.book-author {
    color: #777;
    font-size: 14px;
    margin-bottom: 10px;
    font-style: italic;
}

.price-box {
    margin-bottom: 15px;
}

.price {
    color: #E64A19;
    font-weight: bold;
    font-size: 18px;
    margin-right: 10px;
}

.price-box del {
    color: #999;
    font-size: 14px;
}

.btn-add {
    background-color: #5D4037;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-add:hover {
    background-color: #3E2723;
}

/* 5. FOOTER */
footer {
    background-color: #3E2723;
    color: #ccc;
    text-align: center;
    padding: 40px 0;
    margin-top: 50px;
}

.footer-content h3 {
    color: #fff;
    margin-bottom: 10px;
}

.footer-bottom {
    margin-top: 20px;
    border-top: 1px solid #555;
    padding-top: 10px;
    font-size: 14px;
}