﻿/* ================================================== */
/* 1. CẤU TRÚC HEADER & HIỆU ỨNG CUỘN */
/* ================================================== */

/* Đẩy nội dung body xuống để không bị Header che mất phần đầu */
body {
    padding-top: 110px;
}

/* Header mặc định (Nền Đen Đặc) */
.header_section {
    background-color: #000000;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease; /* Hiệu ứng chuyển đổi mượt */
    padding: 10px 0;
}

    /* Header khi cuộn xuống (Hiệu ứng kính mờ - Glassmorphism) */
    .header_section.scrolled {
        background-color: rgba(0, 0, 0, 0.75) !important; /* Đen trong suốt 75% */
        backdrop-filter: blur(15px); /* Làm mờ hậu cảnh */
        -webkit-backdrop-filter: blur(15px); /* Hỗ trợ Safari */
        padding: 5px 0; /* Thu nhỏ thanh header lại */
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

/* Hiệu ứng co giãn padding của Navbar bên trong */
.navbar {
    transition: padding 0.4s ease;
}

.header_section.scrolled .navbar {
    padding: 5px 0;
}

/* ================================================== */
/* 2. LOGO */
/* ================================================== */
.navbar-brand img {
    height: 75px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

    /* Phóng to logo khi di chuột */
    .navbar-brand img:hover {
        transform: scale(1.05);
    }

/* Thu nhỏ logo khi cuộn trang */
.header_section.scrolled .navbar-brand img {
    height: 60px;
}

/* ================================================== */
/* 3. MENU LINKS (QUAN TRỌNG: SỬA LỖI MÀU VÀNG) */
/* ================================================== */
.navbar-nav {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
}

    /* --- TRẠNG THÁI MẶC ĐỊNH: MÀU TRẮNG --- */
    .navbar-nav .nav-link {
        color: #ffffff !important; /* Sửa từ vàng thành TRẮNG */
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-size: 16px;
        transition: all 0.3s ease;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.8); /* Bóng chữ để dễ đọc */
        position: relative;
    }

        /* --- TRẠNG THÁI ACTIVE (ĐANG CHỌN) HOẶC HOVER: MÀU VÀNG --- */
        .navbar-nav .nav-link:hover,
        .navbar-nav .nav-link.active {
            color: #FFD700 !important; /* Màu vàng kim */
            text-shadow: 0 0 10px rgba(255, 215, 0, 0.8); /* Hiệu ứng phát sáng */
            transform: translateY(-2px); /* Nhảy lên nhẹ */
        }

            /* Thêm gạch chân cho mục đang Active để rõ hơn */
            .navbar-nav .nav-link.active::after {
                content: '';
                display: block;
                width: 100%;
                height: 2px;
                background: #FFD700;
                margin-top: 2px;
                box-shadow: 0 0 5px #FFD700;
            }
/* ================================================== */
/* 4. ICON USER & GIỎ HÀNG (ĐÃ SỬA LỖI DROPDOWN) */
/* ================================================== */
.user_option {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    margin-right: 20px;
    position: relative; /* Để định vị dropdown */
}

    /* --- Style cho nút User và Giỏ hàng (Cấp 1) --- */
    /* Chỉ tác động đến các thẻ a trực tiếp (cấp 1) hoặc class cụ thể để không ảnh hưởng menu con */
    .user_option > .dropdown > a,
    .user_option > a.cart_link {
        color: #ffffff !important;
        font-size: 18px;
        transition: all 0.3s ease;
        text-decoration: none;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
        cursor: pointer;
    }

        /* Khi di chuột vào icon User/Giỏ hàng */
        .user_option > .dropdown > a:hover,
        .user_option > a.cart_link:hover {
            color: #FFD700 !important;
            transform: scale(1.1);
        }

    /* --- SỬA LỖI MENU XỔ XUỐNG (DROPDOWN) --- */
    .user_option .dropdown-menu {
        background-color: #ffffff !important; /* Nền trắng sạch sẽ */
        border: none;
        border-top: 3px solid #FFD700; /* Viền trên màu vàng tạo điểm nhấn */
        border-radius: 0 0 5px 5px;
        padding: 0;
        margin-top: 15px; /* Đẩy menu xuống một chút cho đẹp */
        box-shadow: 0 5px 15px rgba(0,0,0,0.15); /* Đổ bóng */
        min-width: 200px;
        /* Căn chỉnh vị trí để không bị lệch */
        right: 0;
        left: auto;
    }

    /* Style cho từng mục trong menu con (Đăng nhập/Đăng ký) */
    .user_option .dropdown-item {
        color: #333333 !important; /* CHỮ MÀU ĐEN (Quan trọng) */
        font-size: 14px;
        font-weight: 500;
        padding: 12px 20px;
        border-bottom: 1px solid #eee;
        transition: all 0.3s;
        display: flex;
        align-items: center;
    }

        /* Bỏ đường kẻ ở mục cuối cùng */
        .user_option .dropdown-item:last-child {
            border-bottom: none;
        }

        /* Icon bên trong menu con */
        .user_option .dropdown-item i {
            width: 25px;
            color: #FFD700; /* Icon nhỏ màu vàng */
            margin-right: 5px;
        }

        /* Hiệu ứng khi di chuột vào mục menu con */
        .user_option .dropdown-item:hover {
            background-color: #fff8e1; /* Nền vàng nhạt */
            color: #b8860b !important; /* Chữ chuyển màu vàng đậm */
            padding-left: 25px; /* Hiệu ứng đẩy chữ sang phải */
        }

/* ================================================== */
/* 5. RESPONSIVE (MOBILE) */
/* ================================================== */
@media (max-width: 991px) {
    .navbar-brand img {
        height: 55px;
        margin-left: 0;
    }

    /* Menu sổ xuống trên mobile phải có nền đen đặc */
    .navbar-collapse {
        background-color: #000000;
        text-align: center;
        padding: 20px 0;
        margin-top: 10px;
        border-top: 1px solid #333;
    }

    .navbar-nav {
        gap: 10px;
    }

    .user_option {
        justify-content: center;
        margin: 15px 0;
        margin-right: 0;
    }

    /* Nút 3 gạch (Hamburger) màu trắng */
    .navbar-toggler {
        border-color: rgba(255,255,255,0.5);
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
}
