/* ===========================
   SHOPEE STYLE NAVBAR
=========================== */

:root {
    --shopee-primary: #007bff;
    --shopee-gradient: #ffffff;
    --shopee-text: #333;
    --shopee-hover: rgba(0, 0, 0, 0.05);
    --search-bg: #f3f4f6;
    --search-btn: #007bff;
    --badge-bg: #f04d2d;
}


/* Base resets for navbar */
.shopee-top-bar,
.shopee-main-header {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.shopee-top-bar a,
.shopee-main-header a {
    text-decoration: none;
    color: var(--shopee-text);
}

.shopee-top-bar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ===========================
   TOP BAR
=========================== */
.shopee-top-bar {
    background: var(--shopee-gradient);
    font-size: 13px;
    padding: 4px 0;
    color: var(--shopee-text);
}

.shopee-top-bar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-links li {
    position: relative;
    display: flex;
    align-items: center;
}

.top-links a {
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.top-links a:hover {
    opacity: 0.8;
}

.social-text {
    margin-right: 5px;
}

.top-links.left-links li:not(:last-child)::after,
.top-links.right-links li:not(:last-child):not(.account-menu-item)::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    height: 12px;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.2);
}

/* Account Dropdown */
.account-menu-item {
    position: relative;
    padding: 5px 0;
}

.shopee-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    min-width: 350px;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 200;
    flex-direction: column;
    overflow: hidden;
}

/* Keep dropdown visible when hovering over it */
/* Dropdown visibility controlled via .open class */
.notification-menu-item.open .shopee-dropdown,
.account-menu-item.open .shopee-dropdown,
.profile-menu-item.open .shopee-dropdown {
    display: flex;
}

/* Keep dropdown visible when hovering over it */
.shopee-dropdown:hover {
    display: flex;
}

.shopee-dropdown a {
    color: #333;
    padding: 10px 15px;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.shopee-dropdown a:hover {
    background: #fafafa;
    color: var(--shopee-primary);
}

/* Notif Dropdown Enhanced */
.notif-dropdown {
    min-width: 350px;
    padding: 0;
    border-top: none;
}

.notif-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 25px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #fff;
    filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.1));
}

.notif-dropdown-content {
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    display: flex !important;
    align-items: center;
    gap: 15px;
    padding: 12px 15px !important;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon i {
    font-size: 20px;
    color: var(--shopee-primary);
}

.notif-text {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.notif-text p {
    margin: 0;
}

.notif-text .notif-msg {
    font-size: 13px;
    color: #444;
    line-height: 1.4;
    margin-bottom: 4px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-text .notif-date {
    font-size: 11px !important;
    color: #aaa !important;
    margin: 0;
    display: flex;
    align-items: center;
    line-height: 1;
}

.notif-status {
    font-size: 12px;
    font-weight: 600;
}

.notif-status.success {
    color: #28a745;
}

.notif-status.failed {
    color: #dc3545;
}

.notif-item-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.notif-footer {
    text-align: center;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.notif-footer a {
    display: block !important;
    padding: 12px !important;
    color: #2a8ee5 !important;
    font-weight: 600;
    font-size: 13px !important;
}

.notif-footer a:hover {
    background: #f0f0f0 !important;
}

/* ===========================
   MAIN HEADER
=========================== */
.shopee-main-header {
    background: #ffffff;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.shopee-main-header .header-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    gap: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.shopee-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.shopee-logo img {
    height: 45px;
    /* remove invert filter so logo remains its original color on light bg */
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Search Bar */
.shopee-search-container {
    flex: 1;
    max-width: 800px;
    display: flex;
    flex-direction: column;
}

.shopee-search-form {
    display: flex;
    background: var(--search-bg);
    border-radius: 8px;
    overflow: hidden;
    height: 42px;
    border: 1px solid #e5e7eb;
    transition: border-color 0.3s;
}
.shopee-search-form:focus-within {
    border-color: var(--shopee-primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.shopee-search-form input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 16px;
    font-size: 14px;
    color: #333;
    background: transparent;
    border-radius: 2px 0 0 2px;
}

.shopee-search-form button {
    background: var(--search-btn);
    color: #fff;
    border: none;
    width: 60px;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.shopee-search-form button:hover {
    background: #0056b3;
}

/* Search Suggestions */
.search-suggestions {
    display: flex;
    gap: 12px;
    margin-top: 5px;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
}

.search-suggestions a {
    color: #555;
}

.search-suggestions a:hover {
    color: #007bff;
}

/* Cart */
.shopee-cart,
.shopee-wishlist {
    flex-shrink: 0;
    padding: 0 15px;
}

.shopee-cart a,
.shopee-wishlist a {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-size: 24px;
    color: #555;
    transition: color 0.3s;
}

.shopee-cart a:hover,
.shopee-wishlist a:hover {
    color: #007bff;
}

.shopee-notification a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #555;
    font-size: 26px;
    transition: color 0.3s;
}

.shopee-notification a:hover {
    color: #007bff;
}

.shopee-profile a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--shopee-text);
    font-size: 26px;
    text-decoration: none;
}


.cart-badge,
.notif-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--badge-bg);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 10px;
    border: 1px solid #fff;
    line-height: 1.4;
    min-width: 18px;
    text-align: center;
    animation: pulseBadge 2s infinite;
}

@keyframes iconTada {
    0% { transform: scale(1); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes pulseBadge {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.has-items {
    animation: iconTada 3s infinite;
    display: inline-block;
    transform-origin: center;
}

/* Mobile Toggle */
.mobile-only {
    display: none;
}

/* ===========================
   PROFILE DROPDOWN
=========================== */
.profile-menu-item .profile-toggle {
    display: flex;
    align-items: center;
    background: #fff;
    color: #333 !important;
    padding: 6px 16px 6px 6px;
    border-radius: 30px;
    font-size: 14px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    gap: 8px;
    transition: all 0.3s ease;
}

.profile-menu-item .profile-toggle:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.toggle-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.toggle-role {
    font-size: 11px;
    color: #888;
}

.profile-dropdown {
    min-width: 260px;
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 25px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #fff;
    filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.1));
}

.profile-header-new {
    padding: 10px 20px;
}

.profile-header-new h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.profile-header-new p {
    margin: 3px 0 0;
    font-size: 13px;
    color: #888;
}

.profile-links-new {
    padding: 5px 0;
}

.link-with-shortcut {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px !important;
    color: #333 !important;
    font-size: 14px !important;
    text-decoration: none;
    transition: background 0.2s;
}

.link-with-shortcut .link-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.link-with-shortcut .link-left i {
    font-size: 18px;
    color: #555;
    width: 20px;
    text-align: center;
}

.link-with-shortcut .link-right.shortcut {
    color: #888;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #eaeaea;
}

.link-with-shortcut:hover {
    background: #f5f5f5 !important;
}

.profile-divider {
    border: 0;
    height: 1px;
    background-color: #f0f0f0;
    margin: 5px 0;
}

/* ===========================
   RESPONSIVE (MOBILE VIEW)
=========================== */
@media (max-width: 768px) {
    .shopee-top-bar {
        display: none;
        /* Hide top bar on mobile */
    }

    .shopee-main-header {
        padding: 10px 0;
    }

    .shopee-main-header .header-wrapper {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: space-between;
    }

    .shopee-logo {
        order: 1;
    }

    .shopee-logo img {
        height: 35px;
    }

    .logo-text {
        display: none;
        /* hide text on small screens */
    }

    .shopee-cart,
    .shopee-wishlist {
        order: 2;
        padding: 0 5px;
    }

    .mobile-only {
        display: block;
        order: 3;
        background: transparent;
        border: none;
        color: #555;
        font-size: 26px;
        cursor: pointer;
    }

    /* Mobile Notification Dropdown */
    .notif-dropdown {
        position: absolute;
        left: 0;
        right: 0;
        width: 100%;
        min-width: auto;
        top: 100%;
        border-radius: 0;
    }

    .notif-dropdown::before {
        left: 20px;
        right: auto;
    }

    .shopee-search-container {
        order: 4;
        width: 100%;
        flex: 0 0 100%;
        margin-top: 15px;
    }

    .search-suggestions {
        display: none;
        /* Hide suggestions on mobile */
    }
}

/* Global Back Button (Floating) */
.global-back-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f27a5e, #e0654b);
    color: #fff !important;
    font-size: 20px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(242, 122, 94, 0.4);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.global-back-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(242, 122, 94, 0.6);
}

@media (max-width: 768px) {
    .global-back-btn {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}