/* =====================================================
   RESET & BASE STYLES
===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Giữ padding & border trong width/height */
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: #f0f2f5;
    color: #333;
}

/* Container chuẩn */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* =====================================================
   HEADER
===================================================== */
body.login-page {
    background: url(../images/bannernew.jpg);
    background-size: cover;
}
.main-header {
    background: #fff;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
}

.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-top {
    background: #004a80;
    color: #fff;
    padding: 5px 0;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    flex-wrap: wrap;
    z-index: 9999;
}

/* Logo */
.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.logo img {
    height: 70px;
}

.brand-text .main-title {
    font-size: 22px;
    font-weight: 800;
    color: #004a80;
    display: block;
    line-height: 1;
}

/* Nút đăng nhập */
.btn-login a {
    background: #ff6600;
    color: #fff !important;
    border-radius: 4px;
    padding: 8px 20px !important;
    margin-left: 10px;
}

.btn-login a:hover {
    background: #e65c00;
}

/* Tinh chỉnh cho Desktop */
.input_search_lg {
    max-width: 300px; /* Giới hạn độ rộng ô tìm kiếm trên máy tính */
}



/* =====================================================
   LAYOUT CHUNG
===================================================== */
.main-layout {
    
    gap: 25px;
    align-items: flex-start;
    margin-top: 15px;
}



/* =====================================================
   BOX STYLE - ĐỒNG BỘ
===================================================== */
.box {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.box-header {
    background: #004a80;
    color: #fff;
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-weight: bold;
    border-bottom: 3px solid #ff6600;
}

.box-content {
    padding: 15px;
}

.welcome {
    background: #f9f9f9;
    font-style: italic;
    font-size: 14px;
}

/* =====================================================
   MENU LIST
===================================================== */
.menu-list { list-style: none; }

.menu-list li {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.menu-list a {
    text-decoration: none;
    color: #444;
}

/* Menu item row với mũi tên nhỏ */
.menu-item-row {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.menu-item-row a {
    flex: 1; /* Thẻ A chiếm hết không gian bên trái */
    padding: 12px 15px !important;
}

.submenu-trigger {
    padding: 12px 15px;
    cursor: pointer;
    background: #f0f0f0;
    border-left: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

.arrow-down {
    border: solid #333;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    margin-left: 5px;
    margin-bottom: 3px;
}

/* =====================================================
   BOOK GRID
===================================================== */
.book-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Responsive fallback cho book-grid */
.book-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.book-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    padding: 0.5rem; /* padding cho flex wrap */
    box-sizing: border-box;
}

.book-img {
    width: 100%;
    height: 200px;
    background: #eee;
    margin-bottom: 10px;
    overflow: hidden;
}

.book-card h3 {
    font-size: 15px;
    /* margin-bottom: 5px;
    height: 40px; */
    overflow: hidden;
}

/* Carousel click fix */
.carousel {
    position: relative;
}
.carousel-control-prev,
.carousel-control-next {
    z-index: 5;
    width: 5%; /* Thu hẹp vùng click của controls */
    opacity: 0.5;
}
.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}
.carousel-inner {
    position: relative;
    z-index: 1;
}
.carousel-item .row {
    position: relative;
    z-index: 1;
}
.book-card {
    position: relative;
    z-index: 10;
    cursor: pointer;
}
.book-card .book-img,
.book-card h3 {
    position: relative;
    z-index: 11;
}

/* Đảm bảo link có thể click */
.book-card a {
    cursor: pointer;
    display: block;
}
.book-card a:hover {
    text-decoration: none;
}

/* Đảm bảo link có thể click */
.book-card a {
    cursor: pointer;
    display: block;
}
.book-card a:hover {
    text-decoration: none;
}
.book-card>p{
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    font-size: 13px;
}
.book-img>a>img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.book-img>img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tag {
    font-size: 12px;
    color: #004a80;
    font-weight: bold;
}
/* =====================================================
   PAGE LINK
===================================================== */
.active>.page-link, .page-link.active {
    background-color: #004a80;
}
.page-link{
    color: #004a80;
}

/* =====================================================
   FOOTER
===================================================== */
.main-footer {
    background: #004a80;
    color: #ecf0f1;
    padding: 30px 0 20px;
    margin-top: 50px;
    border-top: 4px solid #ff6600;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    color: #ff6600;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    text-transform: uppercase;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 2px;
    background: #004a80;
}

.footer-column p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 12px;
    color: #ecf0f1;
}

.footer-column a {
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-column a:hover {
    color: #ff6600;
    padding-left: 5px;
}
.footer-bottom>p{
    text-align: center;
    font-size: 12px;
}
ul.menu-list {
    padding-left: 0.5rem;
}
/* Sách trong Single  */
.tieudesingle{
    margin-bottom: 30px;
}
/* =====================================================
   RESPONSIVE
===================================================== */

/* Tablet & Mobile */
@media (max-width: 992px) {

    .input_search_mb {
        flex-grow: 1;
        margin-right: 15px; /* Tạo khoảng cách với nút Toggler */
    }
    .input_search_mb .input-group {
        width: 100%;
    }

    /* Sidebar & content xếp dọc */
    .main-layout { flex-direction: column; }
    .sidebar, .content { width: 100%; flex: none; }

    /* Menu mobile: accordion */
    .main-menu { display: none; width: 100%; margin-top: 10px; border-top: 2px solid #004a80; background: #fff; }
    .main-menu.active { display: block; }

    .sub-menu, .sub-menu-3 {
        display: none;
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
        padding-left: 20px !important;
        background: #fdfdfd !important;
    }

    .has-children.open > .sub-menu,
    .has-children.open > .sub-menu-3 { display: block !important; }

    /* Logo & toggle */
    .logo { flex: 1; }
    .menu-toggle { order: 2; display: block; cursor: pointer; }
    .menu-toggle .bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: #004a80; transition: 0.3s; }
}

/* Book grid responsive */
@media (max-width: 768px) {
    .book-grid { grid-template-columns: repeat(2, 1fr); }
    .logo img { height: 45px; }
    .brand-text .main-title { font-size: 18px; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .footer-column h3::after { left: 50%; transform: translateX(-50%); }
}

@media (max-width: 480px) {
    .book-grid { grid-template-columns: 1fr; }
}