/* Top Navigation */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #1c1c1e;
    width: 100%;
    border-bottom: 1px solid #2e2e2e;
    height: 56px;
}

/* Flex container */
.top-nav-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 8px;
}

/* === LEFT SIDE: Logo + Primary nav === */
.top-nav-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Logo */
.topnav-logo {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 10px 0 4px;
    flex-shrink: 0;
}
.topnav-logo img {
    height: 40px;
    width: auto;
    display: block;
}

/* === PRIMARY NAV (Trang chủ + Sản phẩm) — nổi bật === */
.top-nav-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-nav-primary > li {
    position: relative;
}

.top-nav-primary > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none;
    background: rgba(192, 57, 43, 0.18);
    border: 1px solid rgba(192, 57, 43, 0.4);
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.top-nav-primary > li > a:hover,
.top-nav-primary > li.dropdown:hover > a,
.top-nav-primary > li.dropdown.open > a {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff !important;
    box-shadow: 0 2px 12px rgba(192, 57, 43, 0.5);
}


.top-nav-primary > li > a i {
    font-size: 13px;
    color: #e07070;
    transition: color 0.18s;
}

.top-nav-primary > li > a:hover i,
.top-nav-primary > li.dropdown:hover > a i {
    color: #fff;
}

/* === RIGHT SIDE: Quick links === */
.top-nav-quicklink {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    flex-shrink: 0;
}

.top-nav-quicklink > li {
    display: inline-block;
    font-size: 1em;
}

.top-nav-quicklink > li > a {
    display: block;
    color: #c8c8c8;
    padding: 10px 13px;
    transition: color 0.15s;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.top-nav-quicklink > li > a:hover {
    color: #e74c3c;
}

.top-nav-quicklink > li > a:hover i {
    color: #e74c3c;
}

/* === ACCOUNT BUTTON === */

/* Chưa login: nút Đăng nhập nổi bật */
.nav-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #c0392b, #7b241c);
    border-radius: 20px;
    color: #fff !important;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(192,57,43,0.45);
    transition: box-shadow 0.2s, opacity 0.2s;
    white-space: nowrap;
}
.nav-login-btn:hover {
    color: #fff !important;
    opacity: 0.88;
    box-shadow: 0 4px 18px rgba(192,57,43,0.65);
}

/* Đã login: pill avatar + tên */
.nav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px 4px 4px;
    border-radius: 24px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    cursor: pointer;
    text-decoration: none;
    color: #d8d8d8 !important;
    transition: background 0.18s, border-color 0.18s;
    white-space: nowrap;
}
.nav-user-btn:hover,
.topnav-member:hover .nav-user-btn {
    background: #333;
    border-color: #c0392b;
    color: #fff !important;
}

.nav-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0392b, #7b241c);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 1px 6px rgba(192,57,43,0.4);
}

.nav-user-name {
    font-size: 13px;
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tài khoản dropdown */
.topnav-member {
    position: relative;
    display: flex;
    align-items: center;
}
.topnav-member .menuMember {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    min-width: 160px;
    z-index: 2000;
    padding: 4px 0;
    display: none;
}
.topnav-member:hover .menuMember:not(.hide) { display: block; }
.topnav-member .menuMember a {
    display: block;
    padding: 10px 16px;
    color: #d0d0d0;
    font-size: 13px;
    white-space: nowrap;
    font-weight: normal;
    text-decoration: none;
}
.topnav-member .menuMember a:hover {
    color: #e74c3c;
    background: #2a2a2a;
}
/* ===== DROPDOWN BACKDROP (desktop) ===== */
.nav-backdrop {
    display: none;
    position: fixed;
    left: 0; right: 0;
    top: 56px; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    pointer-events: auto;
    animation: backdropFadeIn 0.2s ease;
}
@keyframes backdropFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* ======= End Top navigation ======= */
