.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    cursor: pointer;
    font-size: 24px;
    color: #4b5563;
}
.modal-close:hover {
    color: #1f2937;
}
.book-card {
    transition: transform 0.2s, box-shadow 0.2s;
}
.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
#loading {
    display: none;
    text-align: center;
    padding: 20px;
    font-size: 1.2rem;
    color: #4b5563;
}
.swiper-container {
    width: 100%;
    overflow: hidden;
}
.swiper-wrapper {
    width: 100%;
    box-sizing: border-box;
}
.swiper-slide {
    flex-shrink: 0;
    width: 100%;
    max-width: 300px;
}
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #3b82f6;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}
#back-to-top:hover {
    background-color: #2563eb;
    transform: translateY(-4px);
}
a{
  font-size:14px;
}
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: height 0.3s ease;
    z-index: 999;
}
header.scrolled {
    height: 50px;
}
header .logo img {
    height: 70px;
    transition: height 0.3s ease;
}
header.scrolled .logo img {
    height: 40px;
}

/* Footer */
footer {
    background-color: #1f2937;
    color: #fff;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 44px; /* Chiều cao thấp, tương đương h-16 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 999;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  }
  
  footer a {
    color: #d1d5db;
    text-decoration: none;
    margin-left: 1rem;
  }
  
  footer a:hover {
    color: #f3f4f6;
  }
  
  /* Điều chỉnh nội dung chính để không bị che */
  #main {
    padding-bottom: 64px; /* Đảm bảo nội dung không bị che bởi footer */
  }
  

.search-container {
    position: relative;
  }
  
  .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
  }
  
  #search-input {
    width: 200px;
    padding: 8px 10px 8px 30px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    transition: width 0.3s ease-in-out;
  }
  
  nav {
    display: flex;
    align-items: center;
  }
  
  nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  nav ul li {
    margin-left: 20px;
  }
  
  nav ul li a {
    text-decoration: none;
    color: #1f2937;
  }
  
  #menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
  }

  #latest-books {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* Mặc định 2 cột trên mobile đứng */
  }
  
  #author-detail {
    max-width: 800px;
    margin: 0 auto;
  }
  
  #author-detail.hidden {
    display: none;
  }
  
  #author-books img {
    width: 100%;
    height: auto;
  }

  @media (min-width: 640px) {
    #latest-books {
      grid-template-columns: repeat(4, minmax(0, 1fr)); /* 4 cột từ sm trở lên (desktop nhỏ) */
    }
  }
  
  @media (min-width: 768px) {
    #latest-books {
      grid-template-columns: repeat(6, minmax(0, 1fr)); /* 6 cột từ md trở lên (desktop) */
    }
  }
  
  /* Điều chỉnh cho mobile ngang */
  @media (max-width: 767px) and (orientation: landscape) {
    #latest-books {
      grid-template-columns: repeat(4, minmax(0, 1fr)); /* 4 cột trên mobile ngang */
    }
  }  


@media (max-width: 768px) {
    header{height:50px;}
    header .logo img {
        height: 40px;
    }
    
    header nav {
        display: none;
    }
    #search-input {
        width: 180px; /* Thu gọn ô tìm kiếm trên mobile */
      }
    
      nav ul {
        display: none; /* Ẩn menu trên mobile */
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        padding: 10px 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      }
    
      nav ul.active {
        display: flex; /* Hiển thị menu khi có class active */
      }
    
      nav ul li {
        margin: 10px 0;
        text-align: center;
        width: 100%;
      }
    
      #menu-toggle {
        display: block; /* Hiển thị nút hamburger trên mobile */
      }
      .content-container {
        padding-top: 100px;
    }
}
.content-container {
    padding-top: 100px; /* Khoảng cách để header không che nội dung */
}        
.content-container2 {
    padding-top: 80px; /* Khoảng cách để header không che nội dung */
}

 
        .no-results {
            text-align: center;
            padding: 40px;
            color: #6b7280;
        }