/* Modern top menu */
/* Hide original sidebar on desktop */
#column-left {
    display: none !important;
}

/* Adjust content margin for top menu */
#content {
    margin-left: 0 !important;
}

/* Show top menu on desktop */
#top-menu-bar {
    display: block !important;
}

@media (min-width: 992px) {
    #container {
        overflow: visible;
    }
}

/* Mobile styles */
@media (max-width: 991px) {
    /* Hide top menu */
    #top-menu-bar,
    #top-menu {
        display: none !important;
    }
    
    /* Content container */
    #content {
        margin-left: 0 !important;
        position: relative;
        width: 100%;
        min-height: 100vh;
        background: #fff;
        left: 0;
        transition: left 0.3s ease;
    }
    
    body.menu-visible #content {
        left: 220px;
        position: relative;
    }
    
    /* Menu button */
    #button-menu {
        display: block !important;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001;
        background: #fff;
        border: 1px solid #ddd;
        padding: 8px 12px;
        border-radius: 4px;
        cursor: pointer;
    }
    
    /* Menu styles */
    #column-left {
        display: block !important;
        width: 220px !important;
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100% !important;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background: #1e293b;
        overflow-y: auto;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    /* When menu is visible */
    body.menu-visible {
        overflow: hidden;
    }
    
    body.menu-visible #column-left {
        transform: translateX(0);
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-visible #page-container {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    /* Menu items */
    #column-left .nav > li > a {
        color: #e2e8f0;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    #column-left .nav > li > a:hover,
    #column-left .nav > li.active > a {
        background: rgba(255,255,255,0.1);
        color: #fff;
    }
    
    /* Submenu container */
    #column-left .nav .nav {
        display: none;
        background: rgba(0, 0, 0, 0.15);
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
    
    /* Parent menu items */
    #column-left .nav > li {
        position: relative;
    }
    
    #column-left .nav > li > a {
        position: relative;
        padding-right: 35px;
        display: block;
    }
    
    /* Dropdown arrow for parent items */
    #column-left .nav > li > a:after {
        content: '\f107';
        font-family: 'FontAwesome';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        transition: transform 0.3s ease;
    }
    
    /* Rotate arrow when submenu is open */
    #column-left .nav > li > a.open:after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    /* First level submenu */
    #column-left .nav > li > ul > li > a {
        padding: 10px 15px 10px 30px;
        font-size: 14px;
        position: relative;
        display: block;
    }
    
    /* Second level submenu */
    #column-left .nav > li > ul > li > ul > li > a {
        padding: 8px 15px 8px 45px;
        font-size: 13px;
    }
    
    /* Add arrow to items with submenus */
    #column-left .nav .nav > li > a:after {
        content: '\f105';
        right: 10px;
    }
    
    /* Hover states */
    #column-left .nav .nav > li > a:hover,
    #column-left .nav .nav > li > a:focus {
        background: rgba(255, 255, 255, 0.1);
    }
    
    /* Active state for submenu items */
    #column-left .nav .nav > li.active > a {
        background: rgba(255, 255, 255, 0.15);
    }
    
    /* Active menu item */
    #column-left .nav > li.active > a {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    /* Menu toggle icon */
    .fa-bars:before {
        content: "\f0c9";
        font-family: 'FontAwesome';
    }
    
    /* Smooth transitions */
    #column-left .nav ul {
        transition: all 0.3s ease;
    }
}

:root {
    --admin-fg: #000;
    --admin-muted: #94a3b8;
    --admin-accent: #f90000;
    --admin-accent-2: #22d3ee;
}

/* Override Bootstrap navbar height */
.navbar {
    min-height: 45px;
}

/* Full width background */
#top-menu-bar.navbar-modern {
    width: 100%;
    background: #ededed;
    margin: 0 0 10px 0;
    padding: 0;
    border: 0;
    box-shadow: 0 2px 8px rgba(2, 6, 23, 0.6);
    top: 0;
    left: 0;
    z-index: 1000;
}

/* Centered container for menu items */
#top-menu-bar .container-fluid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Menu items container */
#top-menu {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

#top-menu>li {
    max-width: 200px;
}

@media (min-width: 1400px) {
    #top-menu>li {
        max-width: 240px;
    }

}

#top-menu>li>a,
#top-menu>li>a:focus {
    color: var(--admin-fg);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#top-menu>li>a:hover {
    color: var(--admin-accent);
}

#top-menu>li>a::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 8px;
    height: 2px;
    background: linear-gradient(90deg, var(--admin-accent), var(--admin-accent-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease;
}

#top-menu>li>a:hover::after {
    transform: scaleX(1);
}

#top-menu>li.active>a,
#top-menu>li>a.active {
    color: var(--admin-accent);
}

#top-menu .dropdown-menu {
    position: absolute;
    z-index: 1000;
}

#top-menu .dropdown-menu>li>a {
    color: var(--admin-fg);
    padding: 8px 14px;
    line-height: 1.2;
    white-space: nowrap;
    /* Prevent text wrapping */
    display: block;
    transition: all 0.2s ease;
}

#top-menu .dropdown-menu>li>a:hover {
    background: rgba(148, 163, 184, 0.08);
    color: var(--admin-accent);
    padding-left: 16px;
}

#top-menu .dropdown-header {
    color: var(--admin-muted);
    font-weight: 600;
    padding: 8px 14px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#top-menu .divider {
    background-color: rgba(148, 163, 184, 0.15);
    margin: 4px 0;
}

/* Make sure dropdowns stay within viewport */
#top-menu>li {
    position: relative;
}

/* Adjust submenu positioning */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu>.dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
    position: absolute;
    min-width: 220px;
    z-index: 1001;
}

.dropdown-submenu-header {
    padding: 8px 14px;
    cursor: pointer;
    color: var(--admin-fg);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.dropdown-submenu-header:hover {
    background: rgba(148, 163, 184, 0.08);
    color: var(--admin-accent);
    padding-left: 16px;
}

.dropdown-submenu-header i {
    margin-left: 10px;
    transition: transform 0.2s ease;
}

.dropdown-submenu-header i.fa-caret-down {
    transform: rotate(0deg);
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu>.dropdown-submenu-items {
    display: none;
    position: absolute;
    left: 100%;
    top: -6px;
    min-width: 220px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 0 8px 8px 8px;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.1);
    padding: 5px 0;
    z-index: 1001;
    margin-left: 1px;
}

.dropdown-submenu>.dropdown-submenu-items>li>a {
    padding: 8px 20px;
    display: block;
    color: var(--admin-fg);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-submenu>.dropdown-submenu-items>li>a:hover {
    background: rgba(148, 163, 184, 0.08);
    color: var(--admin-accent);
    padding-left: 24px;
}

/* Arrow for submenu items */
/* Hide default OpenCart arrows */
.dropdown-submenu>a:after,
.dropdown-submenu>a:before {
    display: none;
}

/* Style for submenu arrow */
.dropdown-submenu>.dropdown-submenu-header .submenu-arrow {
    margin-left: 8px;
    font-size: 16px;
    vertical-align: middle;
    float: right;
}

/* Hide any other arrows */
.dropdown-submenu>.dropdown-submenu-header>.fa-caret-right,
.dropdown-submenu>.dropdown-submenu-header>.fa-chevron-right {
    display: none;
}

/* Desktop hover behavior */
@media (min-width: 992px) {
    #top-menu li.dropdown.open>.dropdown-menu,
    .dropdown-submenu.open>.dropdown-submenu-items {
        display: block;
        animation: fadeIn 0.2s ease-in-out;
    }
}

/* Remove all list markers */
#top-menu,
#top-menu ul,
#top-menu li,
.dropdown-menu,
.dropdown-submenu,
.dropdown-submenu-items {
    list-style: none;
    list-style-type: none;
}

/* Ensure dropdowns are properly positioned */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 160px;
    padding: 5px 0;
    margin: 2px 0 0;
    list-style: none;
    list-style-type: none;
    font-size: 14px;
    text-align: left;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}

/* Remove any remaining markers */
#top-menu li::marker,
.dropdown-menu li::marker,
.dropdown-submenu li::marker,
.dropdown-submenu-items li::marker {
    display: none;
    content: "";
}

.dropdown-menu>li>a {
    display: block;
    padding: 3px 20px;
    clear: both;
    font-weight: 400;
    line-height: 1.42857143;
    color: #333;
    white-space: nowrap;
}

.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus {
    color: #262626;
    text-decoration: none;
    background-color: #f5f5f5;
}

.dropdown-menu>.active>a,
.dropdown-menu>.active>a:hover,
.dropdown-menu>.active>a:focus {
    color: #fff;
    text-decoration: none;
    background-color: #337ab7;
    outline: 0;
}

.dropdown-menu>.disabled>a,
.dropdown-menu>.disabled>a:hover,
.dropdown-menu>.disabled>a:focus {
    color: #777;
}

.dropdown-menu>.disabled>a:hover,
.dropdown-menu>.disabled>a:focus {
    text-decoration: none;
    cursor: not-allowed;
    background-color: transparent;
    background-image: none;
    filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}

.open>.dropdown-menu {
    display: block;
}

.open>a {
    outline: 0;
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-menu-left {
    right: auto;
    left: 0;
}

.dropdown-header {
    display: block;
    padding: 3px 20px;
    font-size: 12px;
    line-height: 1.42857143;
    color: #777;
    white-space: nowrap;
}

.dropdown-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 990;
}

.pull-right>.dropdown-menu {
    right: 0;
    left: auto;
}

.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
    content: "";
    border-top: 0;
    border-bottom: 4px solid;
}

.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
    top: auto;
    bottom: 100%;
    margin-bottom: 2px;
}

/* Mobile styles */
@media (max-width: 991px) {
    .dropdown-submenu>.dropdown-submenu-items {
        position: static;
        display: none;
        margin-left: 15px;
        border: none;
        box-shadow: none;
        padding-left: 0;
    }

    .dropdown-submenu.open>.dropdown-submenu-items {
        display: block;
    }

}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
