/* 
 * Mobile Menu Improvements
 * Modern, clean mobile navigation design
 */

/* =========================
   HAMBURGER ICON
   ========================= */
@media (max-width: 991px) {
    /* Modern hamburger button */
    .navbar-light .navbar-toggler {
        cursor: pointer;
        position: relative;
        height: 24px;
        width: 32px;
        border: none;
        padding: 0;
        margin-top: 26px;
        margin-bottom: 26px;
        background: transparent;
        outline: none;
        transition: all 0.3s ease;
    }

    .navbar-light .navbar-toggler:focus {
        box-shadow: none;
        outline: none;
    }

    /* Hamburger lines */
    .navbar-light .navbar-toggler span {
        height: 3px;
        width: 100%;
        display: block;
        background: #ff2a39;
        cursor: pointer;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        border-radius: 2px;
    }

    .navbar-light .navbar-toggler span::before {
        content: "";
        height: 3px;
        width: 100%;
        display: block;
        background: #ff2a39;
        position: absolute;
        left: 0;
        top: -9px;
        transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        border-radius: 2px;
    }

    .navbar-light .navbar-toggler span::after {
        content: "";
        height: 3px;
        width: 100%;
        display: block;
        background: #ff2a39;
        position: absolute;
        left: 0;
        bottom: -9px;
        transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        border-radius: 2px;
    }

    /* Animated X when menu is open */
    .navbar-light .navbar-toggler[aria-expanded="true"] span {
        background: transparent !important;
    }

    .navbar-light .navbar-toggler[aria-expanded="true"] span::before {
        transform: rotate(45deg);
        top: 0;
        background: #ff2a39 !important;
    }

    .navbar-light .navbar-toggler[aria-expanded="true"] span::after {
        transform: rotate(-45deg);
        bottom: 0;
        background: #ff2a39 !important;
    }

    /* =========================
       MOBILE MENU CONTAINER
       ========================= */
    .main_menu .navbar-collapse {
        background: #ffffff;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        overflow-x: hidden;
        margin-top: 10px;
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        -webkit-overflow-scrolling: touch;
    }

    .main_menu .navbar-collapse.collapsing {
        transition: height 0.25s ease;
    }

    /* =========================
       MENU ITEMS STYLING
       ========================= */
    .main_menu .navbar.navbar-expand-lg .navbar-nav {
        padding: 4px 0;
    }

    .main_menu .navbar.navbar-expand-lg .navbar-nav li {
        margin-right: 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .main_menu .navbar.navbar-expand-lg .navbar-nav li:last-child {
        border-bottom: none;
    }

    .main_menu .navbar.navbar-expand-lg .navbar-nav > li > a {
        padding: 11px 15px !important;
        font-size: 14px !important;
        font-weight: 400;
        color: #34373b !important;
        transition: background-color 0.2s ease;
    }

    .main_menu .navbar.navbar-expand-lg .navbar-nav > li > a:hover,
    .main_menu .navbar.navbar-expand-lg .navbar-nav > li > a:active {
        background-color: #f9f9f9;
        color: #ff2a39 !important;
    }

    /* Hide Contact dropdown on mobile - just show main link */
    .main_menu .navbar.navbar-expand-lg .navbar-nav > li.dropdown.submenu > .dropdown-menu {
        display: none !important;
    }

    /* Make Contact link clickable and styled */
    .main_menu .navbar.navbar-expand-lg .navbar-nav > li.dropdown.submenu > a.dropdown-toggle {
        display: flex !important;
        padding: 11px 15px !important;
        background: #fff;
        color: #34373b !important;
        font-weight: 400;
        pointer-events: auto !important;
        cursor: pointer !important;
    }

    .main_menu .navbar.navbar-expand-lg .navbar-nav > li.dropdown.submenu > a.dropdown-toggle:hover {
        background: #f9f9f9;
        color: #ff2a39 !important;
    }

    /* =========================
       CATEGORY MENU (PRODUSE)
       ========================= */
    .header-categories-wrapper {
        padding: 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .produse-button {
        width: 100%;
        text-align: left;
        padding: 11px 15px;
        background: #fff;
        border: none;
        font-size: 14px;
        font-weight: 500;
        color: #ff2a39;
        transition: background-color 0.2s ease;
    }

    .produse-button:hover {
        background-color: #f9f9f9;
    }

    .produse-button i {
        margin-right: 8px;
        font-size: 15px;
    }

    #produse-menu {
        background: #f9f9f9;
        padding: 4px 0;
    }

    #produse-menu .menu-list {
        padding: 0;
        margin: 0;
    }

    /* Mobile category accordion */
    .mobile-category {
        border-bottom: 1px solid #eeeeee;
        background: #ffffff;
    }

    .accordion-toggle {
        width: 100%;
        text-align: left;
        background: #ffffff;
        border: none;
        padding: 9px 15px;
        font-size: 13px;
        font-weight: 400;
        color: #34373b;
        display: flex;
        align-items: center;
        justify-content: space-between;
        transition: background-color 0.2s ease;
    }

    .accordion-toggle:hover {
        background-color: #f5f5f5;
    }

    .accordion-toggle::after {
        content: "›";
        font-size: 16px;
        color: #999;
        transition: transform 0.25s ease;
    }

    .accordion-toggle.active::after {
        transform: rotate(90deg);
        color: #ff2a39;
    }

    .accordion-toggle i {
        margin-right: 8px;
        width: 16px;
        text-align: center;
        color: #ff2a39;
        font-size: 12px;
    }

    /* Nested items */
    .mobile-subsubmenu {
        display: none;
        background: #f9f9f9;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .mobile-list-item {
        border-bottom: 1px solid #eeeeee;
    }

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

    .mobile-list-item > a {
        display: block;
        padding: 8px 15px 8px 30px;
        color: #555;
        font-size: 13px;
        text-decoration: none;
        transition: background-color 0.2s ease;
    }

    .mobile-list-item > a:hover {
        background-color: #f5f5f5;
        color: #ff2a39;
    }

    /* Deeper nesting */
    .mobile-subsubmenu .mobile-category {
        background: #f5f5f5;
    }

    .mobile-subsubmenu .accordion-toggle {
        padding-left: 30px;
        font-size: 12px;
        background: #f5f5f5;
    }

    .mobile-subsubmenu .mobile-subsubmenu .accordion-toggle {
        padding-left: 45px;
        font-size: 12px;
        background: #f0f0f0;
    }

    /* =========================
       USER MENU DROPDOWN
       ========================= */
    .navbar-right .search_icon.dropdown {
        width: 100%;
    }

    /* Hide dropdown menu on mobile - we only want the main link */
    .navbar-right .search_icon.dropdown.submenu > .dropdown-menu {
        display: none !important;
    }

    /* Show just the "Contul meu" link on mobile */
    .navbar-right .search_icon.dropdown > a.dropdown-toggle {
        display: flex !important;
        align-items: center;
        width: 100%;
        padding: 11px 15px !important;
        font-size: 14px;
        color: #34373b !important;
        background: #fff;
        border-bottom: 1px solid #f0f0f0;
        pointer-events: auto !important;
    }

    .navbar-right .search_icon.dropdown > a.dropdown-toggle:hover {
        background-color: #f9f9f9;
        color: #ff2a39 !important;
    }

    .navbar-right .search_icon.dropdown > a.dropdown-toggle i {
        font-size: 16px;
        margin-right: 10px;
    }

    /* Mobile account label */
    .mobile-account-label {
        font-size: 14px;
        font-weight: 400;
        color: inherit;
    }

    .navbar-right .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background: #f9f9f9;
        border-radius: 0;
        margin: 0;
        padding: 4px 0;
        width: 100%;
    }

    .navbar-right .dropdown-menu li {
        border-bottom: 1px solid #f0f0f0;
    }

    .navbar-right .dropdown-menu li:last-child {
        border-bottom: none;
    }

    .navbar-right .dropdown-menu li a {
        padding: 10px 15px 10px 35px !important;
        font-size: 14px;
        color: #34373b !important;
        transition: background-color 0.2s ease;
    }

    .navbar-right .dropdown-menu li a:hover {
        background-color: #ffffff;
        color: #ff2a39 !important;
    }

    .navbar-right .dropdown-menu li a i {
        margin-right: 10px;
        width: 18px;
        text-align: center;
        font-size: 14px;
    }

    /* User header in dropdown */
    .dropdown-user-header {
        background: #ffffff;
        padding: 12px 15px;
        margin-bottom: 4px;
        border-bottom: 2px solid #ff2a39;
    }

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

    .dropdown-user-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #ff2a39;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .dropdown-user-avatar span {
        font-size: 18px;
        font-weight: 700;
        color: #ffffff !important;
    }

    .dropdown-user-greeting {
        font-size: 11px;
        color: #999;
        margin-bottom: 2px;
    }

    .dropdown-user-name {
        font-size: 14px;
        font-weight: 500;
        color: #34373b;
    }

    /* Guest message */
    .dropdown-guest-message {
        background: #fff5f5;
        padding: 12px 15px;
        margin-bottom: 4px;
    }

    .dropdown-guest-message p {
        margin: 0;
        font-size: 13px;
        color: #666;
        text-align: center;
    }

    /* Logout button */
    .dropdown-logout-wrapper {
        padding: 6px 15px;
        background: #f9f9f9;
    }

    .dropdown-logout-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 9px 15px !important;
        background: #ff2a39;
        color: #ffffff !important;
        border-radius: 4px;
        font-weight: 500;
        font-size: 14px;
        transition: background-color 0.2s ease;
    }

    .dropdown-logout-btn:hover {
        background: #e02532 !important;
        color: #ffffff !important;
    }

    .dropdown-logout-btn i {
        margin-right: 8px;
        font-size: 14px;
    }

    /* Divider */
    .dropdown-divider {
        height: 1px;
        background: #f0f0f0;
        margin: 4px 0;
    }

    /* =========================
       CART & SEARCH ICONS ON MOBILE
       ========================= */
    .navbar-right .search_icon:not(.dropdown) {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .navbar-right .search_icon:not(.dropdown) > a {
        display: flex !important;
        align-items: center;
        width: 100%;
        padding: 11px 15px !important;
        font-size: 14px;
        color: #34373b !important;
        background: #fff;
        pointer-events: auto !important;
        text-decoration: none;
    }

    .navbar-right .search_icon:not(.dropdown) > a:hover {
        background-color: #f9f9f9;
        color: #ff2a39 !important;
    }

    .navbar-right .search_icon:not(.dropdown) > a i {
        font-size: 16px;
        margin-right: 10px;
    }

    .navbar-right .search_icon:not(.dropdown) > a::after {
        content: "Căutare";
        font-size: 14px;
        font-weight: 400;
    }

    /* =========================
       SCROLLBAR STYLING
       ========================= */
    .main_menu .navbar-collapse::-webkit-scrollbar {
        width: 6px;
    }

    .main_menu .navbar-collapse::-webkit-scrollbar-track {
        background: #f5f5f5;
    }

    .main_menu .navbar-collapse::-webkit-scrollbar-thumb {
        background: #cccccc;
        border-radius: 3px;
    }

    .main_menu .navbar-collapse::-webkit-scrollbar-thumb:hover {
        background: #ff2a39;
    }

    /* =========================
       ANIMATIONS
       ========================= */
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .navbar-collapse.show {
        animation: slideDown 0.3s ease;
    }

    /* =========================
       FIX MENU OVERLAP
       ========================= */
    .header_area + section,
    .header_area + div,
    .header_area + footer {
        margin-top: 0;
    }
}

/* =========================
   TABLET ADJUSTMENTS
   ========================= */
@media (min-width: 768px) and (max-width: 991px) {
    .main_menu .navbar-collapse {
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* =========================
   DESKTOP - HIDE MOBILE ELEMENTS
   ========================= */
@media (min-width: 992px) {
    .mobile-account-label {
        display: none !important;
    }
}


