﻿:root {
    --primary: #c8102e; /* Đỏ son Việt Nam */
    --gold: #d4af37; /* Vàng kim */
    --dark: #2c1810;
    --light: #fffaf0;
}

.navbar {
    background: linear-gradient(to bottom, #fff, #fffaf0);
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.2);
    position: sticky;
    z-index: 1000;
    top: 0;
    border-bottom: 4px solid var(--primary);
    padding: 0;
    font-family: 'Roboto', sans-serif;
    margin-bottom: 10px;
}

/* === DÒNG TRÊN === */
.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5%;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.4s ease;
}

    .logo:hover {
        transform: scale(1.08) rotate(5deg);
    }

    .logo img {
        height: 58px;
        filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.15));
    }

.nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
}

    .nav > li {
        position: relative;
    }

    .nav a {
        color: var(--dark);
        padding: 12px 18px;
        text-decoration: none;
        font-weight: 600;
        border-radius: 8px;
        transition: all 0.3s ease;
        position: relative;
    }

        .nav a:hover {
            background: var(--primary);
            color: blue;
            transform: translateY(-4px);
        }

        .nav a::after {
            content: '';
            position: absolute;
            bottom: 6px;
            left: 50%;
            width: 0;
            height: 2px;
            background: var(--gold);
            transition: all 0.3s;
        }

        .nav a:hover::after {
            width: 60%;
            left: 20%;
        }

/* Search */
.search-bar form {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(200, 16, 46, 0.1);
}

.search-bar input {
    border: none;
    padding: 12px 20px;
    width: 320px;
    outline: none;
    font-size: 1rem;
}

.search-bar button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

    .search-bar button:hover {
        background: #a00c24;
        transform: scale(1.05);
    }

/* === DÒNG DƯỚI (User) === */
.bottom-row {
    display: flex;
    justify-content: flex-end;
    padding: 10px 5%;
    background: rgba(255,250,240,0.95);
    gap: 15px;
    align-items: center;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-btn {
    background: linear-gradient(135deg, var(--primary), #a00c24);
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
    max-width: 400px;
    width: min(100%, 400px);
    overflow: hidden;
    text-overflow: ellipsis;
}

    .user-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(200, 16, 46, 0.4);
    }

.user-dropdown {
    display: none;
    position: absolute;
    left: 50%;
    top: 100%;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 12px;
    min-width: 220px;
    padding: 8px 0;
    z-index: 999;
    border: 1px solid #eee;
    list-style: none;
    transform: translateX(-50%);
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown li a {
    display: block;
    padding: 14px 20px;
    color: var(--dark);
    text-decoration: none;
    transition: 0.3s;
}

    .user-dropdown li a:hover {
        background: #fff1f0;
        color: var(--primary);
        padding-left: 28px;
    }

/* ==================== MENU CHÍNH ==================== */
.nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
}

    .nav > li {
        position: relative;
    }

        .nav > li > a {
            color: #2c1810;
            padding: 14px 20px;
            text-decoration: none;
            font-weight: 600;
            border-radius: 8px;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 6px;
        }

            .nav > li > a:hover {
                background: #c8102e;
                color: white;
                transform: translateY(-3px);
            }

/* ==================== SUBMENU CẤP 1 - XỔ XUỐNG DƯỚI ==================== */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%; /* Xổ xuống dưới */
    left: 0;
    background: #fff;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
    border-radius: 12px;
    min-width: 260px;
    padding: 10px 0;
    border: 1px solid #f0e6d2;
    z-index: 999;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown:hover > .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ==================== SUBMENU CẤP 2,3,... - XỔ SANG PHẢI ==================== */
.dropdown-submenu {
    position: relative;
}

    .dropdown-submenu > a {
        position: relative;
        padding-right: 35px; /* chỗ cho caret */
    }

        .dropdown-submenu > a .caret {
            position: absolute;
            right: 18px;
            top: 50%;
            transform: translateY(-50%);
            transition: transform 0.3s;
        }

    .dropdown-submenu:hover > a .caret {
        transform: translateY(-50%) rotate(-90deg);
    }

    /* Submenu cấp sau xổ sang phải */
    .dropdown-submenu .dropdown-menu {
        top: 0;
        left: 100%;
        margin-left: 8px;
        transform: translateX(20px);
    }

    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        transform: translateX(0);
    }

/* Style chung cho các item trong menu */
.dropdown-menu a {
    display: block;
    padding: 13px 24px;
    color: #2c1810;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 2px 6px;
}

    .dropdown-menu a:hover {
        background: #fff4e6;
        color: #c8102e;
        padding-left: 32px;
    }

/* Caret cho menu chính */
.dropdown-toggle .caret {
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle .caret {
    transform: rotate(180deg);
}

/* Admin */
.admin-link button {
    background: linear-gradient(135deg, #d4af37, #b8972e);
    color: #2c1810;
    font-weight: 700;
}

/* Animation cho caret */
.caret {
    display: inline-block;
    transition: transform 0.3s ease;
}

.dropdown:hover .caret {
    transform: rotate(180deg);
}

@media (max-width: 992px) {
    .top-row, .bottom-row {
        padding: 12px 8%;
    }

    .search-bar input {
        width: 260px;
    }
}
