/* Primary navigation styles */
.navbar-main {
    background: #262b31;
    padding: 0 1rem;
    position: relative;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.navbar-main .navbar-brand {
    padding: 0.4rem 0;
    margin-right: 1.25rem;
}

.navbar-main .navbar-brand img {
    height: 40px;
    width: auto;
}

.navbar-main .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.6rem;
}

.navbar-main .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, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Navigation links */
.navbar-main .nav-link {
    color: rgba(255, 255, 255, 0.68) !important;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 0.5rem 0.8rem !important;
    transition: color 0.12s ease;
    white-space: nowrap;
    letter-spacing: 0.01em;
    border-radius: 4px;
    position: relative;
}

/* Active indicator line — only for non-dropdown links (dropdown uses Bootstrap caret on ::after) */
.navbar-main .nav-link:not(.dropdown-toggle)::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0.8rem;
    right: 0.8rem;
    height: 3px;
    background: transparent;
    border-radius: 3px 3px 0 0;
    transition: background 0.12s ease;
}

.navbar-main .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.06);
}

.navbar-main .nav-link:not(.dropdown-toggle):hover::after {
    background: rgba(198, 40, 40, 0.4);
}

.navbar-main .nav-link.active-section {
    color: #fff !important;
}

.navbar-main .nav-link:not(.dropdown-toggle).active-section::after {
    background: #c62828;
}

/* POS button styles */
.nav-pos-link {
    color: #fff !important;
    background: #c62828;
    border: none !important;
    border-radius: 5px;
    padding: 0.38rem 0.9rem !important;
    font-weight: 700 !important;
    margin: 0 0.5rem 0 0 !important;
    font-size: 0.82rem !important;
    letter-spacing: 0.02em;
    transition: background 0.12s;
    white-space: nowrap;
}

.nav-pos-link:hover {
    background: #b71c1c !important;
    color: #fff !important;
}

/* Dropdown arrow styles */
.navbar-main .dropdown-toggle::after {
    border-top-color: rgba(255, 255, 255, 0.45);
    vertical-align: 0.2em;
}

.navbar-main .dropdown-toggle:hover::after {
    border-top-color: #fff;
}

/* Dropdown menu container styles */
.navbar-main .dropdown-menu {
    background: #1d2126;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 2px solid #c62828;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    padding: 4px;
    min-width: 190px;
    margin-top: 0;
}

.navbar-main .dropdown-item {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    padding: 0.42rem 0.75rem;
    border-radius: 5px;
    transition: background 0.1s, color 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-main .dropdown-item i {
    width: 14px;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.navbar-main .dropdown-item:hover,
.navbar-main .dropdown-item:focus {
    background: rgba(198, 40, 40, 0.12);
    color: #fff;
}

.navbar-main .dropdown-item:hover i {
    color: #c62828;
}

.navbar-main .dropdown-item.active-item {
    background: rgba(198, 40, 40, 0.15);
    color: #fff;
    font-weight: 600;
}

.navbar-main .dropdown-item.active-item i {
    color: #c62828;
}

.navbar-main .dropdown-divider {
    border-top-color: rgba(255, 255, 255, 0.08);
    margin: 3px 0;
}

.dropdown-group-label {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28);
    padding: 5px 10px 2px;
    pointer-events: none;
}

/* Vertical line separator */
.nav-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.12);
    margin: auto 0.4rem;
    align-self: center;
    display: flex;
    flex-shrink: 0;
}

/* Right side navigation items */
.navbar-main .ms-auto .nav-link {
    padding: 0.82rem 0.5rem !important;
}

.nav-user-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 0.8rem !important;
    padding: 0.82rem 0.5rem !important;
    cursor: default;
}

.nav-user-chip i {
    font-size: 0.85rem;
}

.btn-logout {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.88rem;
    cursor: pointer;
    padding: 0.82rem 0.5rem;
    transition: color 0.12s;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.btn-logout:hover {
    color: #c62828;
}

/* Secondary navigation styles */
.navbar-secondary {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0 1rem;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    scrollbar-width: none;
}

.navbar-secondary::-webkit-scrollbar {
    display: none;
}

.subnav-inner {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 42px;
}

.subnav-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #adb5bd;
    margin-right: 4px;
    flex-shrink: 0;
}

.nav-sub-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.83rem;
    padding: 0.42rem 0.8rem;
    border-radius: 6px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-sub-link i {
    font-size: 0.8rem;
}

.nav-sub-link:hover {
    background: #f1f3f5;
    color: #343a40;
}

.nav-sub-link.active {
    background: #e8f5e9;
    color: #1b5e20;
    font-weight: 600;
}

.nav-sub-link.pos-sub {
    color: #2e7d32;
    font-weight: 700;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.nav-sub-link.pos-sub:hover {
    background: #c8e6c9;
}

.subnav-sep {
    width: 1px;
    height: 18px;
    background: #dee2e6;
    margin: 0 6px;
    flex-shrink: 0;
}

@media (max-width: 991.98px) {
    .nav-divider {
        display: none;
    }
}

/* Mega menu styles for desktop */
@media (min-width: 992px) {
    .dropdown-mega {
        position: static !important;
    }

    .dropdown-mega .dropdown-menu {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #1a1f26 !important;
        border: none !important;
        border-top: 3px solid #c62828 !important;
        border-radius: 0 0 12px 12px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
        padding: 1.5rem !important;
        margin-top: 0 !important;
    }

    .mega-menu-grid {
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 1.5rem !important;
    }

    .mega-menu-col:not(:last-child)::after {
        content: "" !important;
        position: absolute !important;
        top: 0 !important;
        right: -0.75rem !important;
        height: 100% !important;
        width: 1px !important;
        background: rgba(255, 255, 255, 0.08) !important;
    }
}

/* Mega menu styles for mobile */
@media (max-width: 991.98px) {
    .dropdown-mega .dropdown-menu {
        background: #1a1f26 !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.5rem !important;
    }

    .mega-menu-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .mega-menu-col-title {
        font-size: 0.9rem !important;
        margin-bottom: 0.1rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding-bottom: 0.25rem !important;
    }

    .mega-menu-col-subtitle {
        display: none !important;
    }

    .mega-menu-list {
        gap: 0.25rem !important;
    }

    .mega-menu-item-link {
        padding: 0.35rem 0.5rem !important;
    }
}

/* Mega menu element styling */
.mega-menu-col-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 0.2rem !important;
    letter-spacing: 0.02em !important;
}

.mega-menu-col-subtitle {
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    color: #c62828 !important;
    letter-spacing: 0.08em !important;
    margin-bottom: 1rem !important;
}

.mega-menu-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding-left: 0 !important;
    list-style: none !important;
    margin-bottom: 0 !important;
}

.mega-menu-item-link {
    color: rgba(255, 255, 255, 0.68) !important;
    font-size: 0.84rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    padding: 0.45rem 0.75rem !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    transition: all 0.15s ease !important;
    border-left: 3px solid transparent !important;
}

.mega-menu-item-link:hover {
    background: rgba(198, 40, 40, 0.12) !important;
    color: #ffffff !important;
    border-left-color: #c62828 !important;
}

.mega-menu-item-link i {
    width: 16px !important;
    text-align: center !important;
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.35) !important;
    flex-shrink: 0 !important;
    transition: color 0.15s ease !important;
}

.mega-menu-item-link:hover i {
    color: #c62828 !important;
}

.mega-menu-item-link.active {
    background: rgba(198, 40, 40, 0.15) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-left-color: #c62828 !important;
}

.mega-menu-item-link.active i {
    color: #c62828 !important;
}

.mega-menu-col {
    position: relative !important;
}