﻿/* ================================================
   SIDEBAR LEFT - GIỐNG HÌNH MẪU ASHICO LOGISTICS
   ================================================ */

.sidebar-left {
    width: 100%;
    max-width: 280px;
}

/* ⭐ TITLE - IN HOA, Gạch dưới xanh */
.sidebar-left__title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--ashico-blue, #034ea2);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.sidebar-left__title h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ashico-blue, #034ea2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ⭐ NÚT MŨI TÊN - Ẩn trên desktop */
.sidebar-left__news-nav {
    display: none;
    gap: 8px;
}

.news-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--ashico-blue, #034ea2);
    background: #fff;
    color: var(--ashico-blue, #034ea2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.news-nav-btn:hover:not(.disabled) {
    background: var(--ashico-blue, #034ea2);
    color: #fff;
}

.news-nav-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.news-nav-btn i {
    font-size: 12px;
}

/* ⭐ MENU LIST */
.sidebar-left__menu-section {
    margin-bottom: 30px;
}

.sidebar-left__menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-left__menu-list li {
    margin-bottom: 0;
}

/* ⭐ MENU LEVEL 1 - IN ĐẬM */
.sidebar-left__menu-list li > a:first-child {
    display: block;
    padding: 10px 0;
    color: #333;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed #ddd;
    transition: all 0.3s ease;
}

.sidebar-left__menu-list li > a:first-child:hover {
    color: var(--ashico-blue, #034ea2);
    padding-left: 5px;
}

/* ⭐ MENU LEVEL 1 ACTIVE - MÀU ĐỎ */
.sidebar-left__menu-list li.active > a:first-child {
    color: var(--ashico-red, #ec2028) !important;
    font-weight: 700;
    background: rgba(236, 32, 40, 0.05);
    padding-left: 10px;
    margin-left: -10px;
    margin-right: -10px;
    padding-right: 10px;
}

/* ⭐ SUBMENU - Mặc định màu XANH */
.sidebar-left__menu-list li .submenu-link {
    display: block;
    padding: 8px 0 8px 20px;
    color: var(--ashico-blue, #034ea2);
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    border-bottom: 1px dashed #eee;
    transition: all 0.3s ease;
}

.sidebar-left__menu-list li .submenu-link:hover {
    color: var(--ashico-blue, #034ea2);
    padding-left: 25px;
    font-weight: 500;
}

/* ⭐ SUBMENU ACTIVE - MÀU ĐỎ khi click */
.sidebar-left__menu-list li .submenu-link.active {
    color: var(--ashico-red, #ec2028) !important;
    font-weight: 600;
    background: rgba(236, 32, 40, 0.05);
    padding-left: 25px;
}

/* Submenu trong menu active - vẫn giữ màu xanh */
.sidebar-left__menu-list li.active .submenu-link:not(.active) {
    color: var(--ashico-blue, #034ea2);
    background: transparent;
}

/* ⭐ NEWS SECTION */
.sidebar-left__news-section {
    margin-bottom: 30px;
}

.sidebar-left__news-section .sidebar-left__title h4 {
    text-transform: uppercase;
}

.sidebar-left__news-wrapper {
    position: relative;
}

.sidebar-left__news-list {
    /* Container */
}

/* NEWS ITEM - Desktop */
.sidebar-news-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed #ddd;
}

.sidebar-news-item:last-child {
    border-bottom: none;
}

/* Thumbnail */
.sidebar-news-item__img {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
}

.sidebar-news-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sidebar-news-item:hover .sidebar-news-item__img img {
    transform: scale(1.05);
}

/* Content */
.sidebar-news-item__content {
    flex: 1;
    min-width: 0;
}

.sidebar-news-item__content h5 {
    margin: 0 0 5px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.sidebar-news-item__content h5 a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.sidebar-news-item:hover .sidebar-news-item__content h5 a {
    color: var(--ashico-blue, #034ea2);
}

.sidebar-news-item__content .date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #888;
}

.sidebar-news-item__content .date i {
    font-size: 11px;
    color: var(--ashico-red, #ec2028);
}

/* ==================== MENU TOGGLE - THU GỌN/MỞ RỘNG ==================== */

/* Menu Item Container */
.sidebar-menu-item {
    position: relative;
    margin-bottom: 2px;
}

/* Menu Item Header - Chứa link và nút toggle */
.sidebar-menu-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.sidebar-menu-item.active .sidebar-menu-item__header,
.sidebar-menu-item:hover .sidebar-menu-item__header {
    background: rgba(var(--ashico-blue-rgb, 3, 78, 162), 0.08);
}

/* Menu Link */
.sidebar-menu-item__link {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 10px 12px;
    color: var(--ashico-blue, #034ea2);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu-item__link:hover {
    color: var(--ashico-red, #ec2028);
}

.sidebar-menu-item.active .sidebar-menu-item__link {
    color: var(--ashico-red, #ec2028);
}

/* Arrow Icon trước text */
.sidebar-menu-item__arrow-icon {
    font-size: 10px;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.sidebar-menu-item.active .sidebar-menu-item__arrow-icon,
.sidebar-menu-item:hover .sidebar-menu-item__arrow-icon {
    color: var(--ashico-red, #ec2028);
}

/* ⭐ NÚT TOGGLE - THU GỌN/MỞ RỘNG ⭐ */
.sidebar-menu-item__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    background: var(--ashico-blue, #034ea2);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-menu-item__toggle:hover {
    background: var(--ashico-red, #ec2028);
    transform: scale(1.05);
}

.sidebar-menu-item.expanded .sidebar-menu-item__toggle {
    background: var(--ashico-red, #ec2028);
}

/* ⭐ SUBMENU - ẨN MẶC ĐỊNH ⭐ */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    padding-left: 20px;
    margin: 0;
    list-style: none;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

.sidebar-submenu.show {
    max-height: 500px; /* Đủ lớn để chứa các item */
    padding-top: 5px;
    padding-bottom: 5px;
}

/* Submenu Item */
.sidebar-submenu__item {
    margin-bottom: 2px;
}

.sidebar-submenu__item a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--tanspot-gray, #585b6b);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sidebar-submenu__item a:hover {
    background: rgba(var(--ashico-blue-rgb, 3, 78, 162), 0.08);
    color: var(--ashico-blue, #034ea2);
}

.sidebar-submenu__item.active a {
    background: rgba(var(--ashico-red-rgb, 236, 32, 40), 0.1);
    color: var(--ashico-red, #ec2028);
    font-weight: 600;
}

.sidebar-submenu__item a i {
    font-size: 8px;
    margin-right: 8px;
    color: var(--ashico-blue, #034ea2);
}

.sidebar-submenu__item.active a i {
    color: var(--ashico-red, #ec2028);
}

/* ⭐ RESPONSIVE ⭐ */
@media (max-width: 991px) {
    .sidebar-menu-item__link {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .sidebar-menu-item__toggle {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .sidebar-submenu__item a {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .sidebar-left {
        max-width: 100%;
        margin-bottom: 30px;
    }
    
    /* ⭐ ẨN MENU SECTION */
    .sidebar-left__menu-section {
        display: none;
    }
    
    /* ⭐ HIỆN NÚT MŨI TÊN */
    .sidebar-left__news-nav {
        display: flex;
    }
    
    /* News section - Scroll ngang, ẨN SCROLLBAR */
    .sidebar-left__news-list {
        display: flex;
        flex-wrap: nowrap;
        gap: 15px;
        overflow-x: auto;
        padding-bottom: 5px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    /* Ẩn scrollbar Webkit */
    .sidebar-left__news-list::-webkit-scrollbar {
        display: none;
    }
    
    /* News item - Card ngang */
    .sidebar-news-item {
        flex: 0 0 250px;
        flex-direction: row;
        border-bottom: none;
        background: #f9f9f9;
        border-radius: 8px;
        padding: 10px;
        scroll-snap-align: start;
    }
    
    .sidebar-news-item__img {
        width: 90px;
        height: 70px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .sidebar-left {
        padding: 0;
    }
    
    .sidebar-left__title h4 {
        font-size: 16px;
    }
    
    /* ⭐ ẨN MENU SECTION */
    .sidebar-left__menu-section {
        display: none;
    }
    
    /* Nút mũi tên nhỏ hơn */
    .news-nav-btn {
        width: 28px;
        height: 28px;
    }
    
    .news-nav-btn i {
        font-size: 10px;
    }
    
    /* News - Scroll ngang */
    .sidebar-left__news-list {
        gap: 12px;
    }
    
    .sidebar-news-item {
        flex: 0 0 220px;
        padding: 8px;
    }
    
    .sidebar-news-item__img {
        width: 75px;
        height: 55px;
    }
    
    .sidebar-news-item__content h5 {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .sidebar-news-item__content .date {
        font-size: 11px;
    }
}

/* Mobile nhỏ (< 480px) */
@media (max-width: 480px) {
    .sidebar-news-item {
        flex: 0 0 200px;
    }
    
    .sidebar-news-item__img {
        width: 65px;
        height: 50px;
    }
}