﻿
/* CẢI TIẾN: Thêm scroll-padding để header không che nội dung khi nhảy tới anchor link */
html {
    scroll-padding-top: 100px; /* Điều chỉnh giá trị này bằng chiều cao của header */
}

.header-container {
    position: relative;
}

.top-bar {
    background-color: #f8f8f8;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info span {
    margin-right: 15px;
    color: #666;
}

.contact-info i {
    margin-right: 5px;
    color: #d70018;
}

.user-actions {
    display: flex;
    align-items: center;
}

.user-dropdown .dropdown-toggle,
.login-link, .register-link, .cart-link {
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
}

    .user-dropdown .dropdown-toggle:hover,
    .login-link:hover, .register-link:hover {
        color: #d70018;
    }

.divider {
    margin: 0 10px;
    color: #ddd;
}

.cart-link {
    position: relative;
    margin-left: 15px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d70018;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-menu {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo-img {
    max-height: 50px;
}

.main-nav {
    flex-grow: 1;
    margin: 0 30px;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.nav-item {
    position: relative;
    margin: 0 12px;
}

.nav-link {
    color: #333;
    font-weight: 500;
    text-decoration: none;
    padding: 10px 0;
    position: relative;
    transition: color 0.3s;
}

    .nav-link:hover, .nav-link.active {
        color: #d70018;
    }

    .nav-link:after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: #d70018;
        transition: width 0.3s;
    }

    .nav-link:hover:after, .nav-link.active:after {
        width: 100%;
    }

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 0;
    margin-top: 10px !important; /* Ghi đè bootstrap */
}

.user-dropdown .dropdown-menu {
    margin-top: 5px !important;
}

.dropdown-item {
    padding: 8px 20px;
    color: #333;
    transition: all 0.2s;
}

    .dropdown-item i {
        margin-right: 8px;
        width: 15px; /* Căn chỉnh icon */
        text-align: center;
    }

    .dropdown-item:hover {
        background: #f8f8f8;
        color: #d70018;
    }

/* Mega Menu */
.mega-menu {
    width: 600px; /* Đặt chiều rộng cho mega menu */
    padding: 20px;
    left: 50% !important; /* Căn giữa mega menu */
    transform: translateX(-50%);
}

.mega-menu-list {
    list-style: none;
    padding: 0;
}

    .mega-menu-list li {
        margin-bottom: 8px;
    }

    .mega-menu-list a {
        color: #666;
        text-decoration: none;
        transition: all 0.2s ease;
    }

        .mega-menu-list a:hover {
            color: #d70018;
            padding-left: 5px;
        }

.search-box {
    position: relative;
    width: 200px;
}

    .search-box input {
        width: 100%;
        padding: 8px 35px 8px 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
    }

    .search-box button {
        position: absolute;
        right: 0;
        top: 0;
        height: 100%;
        background: none;
        border: none;
        color: #666;
        padding: 0 10px;
        cursor: pointer;
    }



/* Mobile Toggle */
.mobile-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    margin-left: 15px;
}

/* Responsive */
@media (max-width: 992px) {
    .main-nav {
        order: 3;
        width: 100%;
        margin: 15px 0 0;
        display: none; /* Ẩn sẵn để slideToggle hoạt động */
        background-color: white;
        border-top: 1px solid #eee;
    }

    .nav-list {
        flex-direction: column;
        padding: 10px 0;
    }

    .nav-item {
        margin: 5px 0;
        text-align: center;
    }

    .mobile-toggle {
        display: block;
    }

    .mega-menu, .mega-menu .row > div {
        width: 100%;
        transform: none;
        left: 0 !important;
    }

    .header-slide {
        height: 350px;
    }

    .slider-content {
        padding: 0 30px;
    }

    .slider-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        gap: 5px;
    }
}

.dropdown-toggle::after {
    border-right: hidden;
    border-top: none;
    border-left:none;
}