* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: Arial, Helvetica, sans-serif;
}

#main {
    width: 100%;
}

header {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr 1fr 1fr;
    align-items: center;
    background-color: #5873cc;
    padding: 0 16px;
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    gap: 16px;
}

.logo{
    height:56px;
}

#nav {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 16px;
}

#nav li a {
    text-decoration: none;
    color: #fff;
    padding: 12px;
}

#nav li:hover a {
    background-color: #ccc;
    color: #000;
    border-radius: 4px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: white;
    padding: 4px 8px;
    border-radius: 4px;
    height: 32px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

.search-container i {
    color: #000000;
    font-size: 16px;
}

.search {
    border: none;
    outline: none;
    font-size: 14px;
    min-width: 300px;
}

.cart{
    font-weight: bold;
}

.cart a {
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    height: 46px;
    padding: 0 12px;
}

/* .cart:hover {
    background-color: #fff;
    color: #000;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
} */

.cart a:hover{
    color:#000;
    font-weight: bold;
}

.user-icon {
    position: relative;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    justify-self: end;
}

.user-icon:hover {
    color: #000;
    opacity: 0.8;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 0;
    min-width: 180px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-icon:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    font-size: 14px;
}

.user-dropdown a:hover {
    background-color: #f0f0f0;
}


.cart-hover {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 9999;
}

.user-icon:hover .cart-hover {
    display: block;
}

.cart-hover a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.product-list {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    cursor: pointer;
    width: fit-content;
    justify-self: start;
}

.product-list > a {
    text-decoration: none;
    color: white;
    padding: 12px 4px;
}

.product-list > i {
    font-size: 12px;
    color: white;
    transition: transform 0.2s ease;
}

.product-list:hover > i {
    transform: rotate(180deg);
}

.product-list .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #ccc;
    padding: 0;
    margin: 0;
    list-style: none;
    border-radius: 4px;
    min-width: 180px;
    z-index: 9999;
}

.product-list:hover .dropdown {
    display: block;
}

.product-list .dropdown li a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.product-list .dropdown li a:hover {
    background-color: #f0f0f0;
}




#content {
    padding-top: 6px;
}

/* --- Menu & Slider --- */
#menu-slider {
    width: 100%;
}

#slider {
    background-size: cover;
    height:520px;
    animation: slider 12s infinite;
}

@keyframes slider {
    0%, 30% {
        background-image: url('https://bookbuy.vn/Res/Images/Album/8aee647d-753c-47c4-9c0e-c591563ea3d5.jpg?w=880&scale=both&h=320&mode=crop');
        opacity: 1;
    }
    33%, 36% {
        opacity: 0.7;
    }
    37%, 67% {
        background-image: url('https://bookbuy.vn/Res/Images/Album/1b3b3268-841f-4364-83e9-708f1d321735.jpg?w=880&scale=both&h=320&mode=crop');
        opacity: 1;
    }
    70%, 73% {
        opacity: 0.7;
    }
    74%, 97% {
        background-image: url('https://bookbuy.vn/Res/Images/Album/503b1bc3-827c-4a57-9a51-b099f4d70104.jpg?w=880&scale=both&h=320&mode=crop');
        opacity: 1;
    }
    98%, 100% {
        opacity: 0.7;
    }
}

section > h2 {
    background-color: #757575;
    color: white;
    padding: 10px 12px;
    text-transform: uppercase;
    font-weight: bold;
}

/* --- Xem thêm --- */
.more {
    text-align: center;
    font-size: 18px;
    margin: 16px 0 32px 0;
}

/* --- Truyện tranh --- */
.genre-list {
    overflow: hidden;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.genre-list .book-item {
    font-size: 16px;
    text-align: center;
    float: left;
    margin: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; 
    width: 160px;
}

.genre-list h2 {
    font-size: 18px;
}

.genre-list .book-item p {
    margin-top: 12px;
}

.genre-list .book-img {
    width: 160px;
    height: 180px;
    margin: 0 20px 12px 20px;
}

/* --- Footer --- */
#footer {
    background-color:#5873cc;
    color: white;
    padding: 32px 0;
    text-align: center;
    margin-top: 500px;
}

        #footer {
            background-color: #5873cc;
            color: white;
            padding: 40px 0;
            font-size: 14px;
                text-align: center;
    margin-top: 40px;

        }

        .footer-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-around;
            max-width: 1200px;
            margin: auto;
            padding: 0 16px;
            gap: 24px;
        }

        .footer-column {
            flex: 1 1 240px;
            min-width: 200px;
        }

        .footer-column h4 {
            font-size: 16px;
            margin-bottom: 12px;
            border-bottom: 1px dotted #ccc;
            padding-bottom: 6px;
        }

        .footer-column ul {
            list-style: none;
            padding: 0;
        }

        .footer-column ul li {
            margin: 6px 0;
        }

        .footer-column ul li a {
            color: white;
            text-decoration: none;
        }

        .footer-column ul li a:hover {
            text-decoration: underline;
        }

        .footer-logo {
            width: 160px;
            max-height: 80px;
            object-fit: contain;
            margin-bottom: 12px;
        }

        .footer-bottom {
            text-align: center;
            margin-top: 32px;
            border-top: 1px solid #ccc;
            padding-top: 16px;
            font-size: 13px;
        }

.book-title{
    display:-webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow:hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    line-height: 1.4;
    height:2.8em;
}
