/* Mobile Menu Bar Styles */
@media only screen and (max-width: 767px) {
    /* Show mobile menu bar only on mobile */
    #mobile-menu-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid #e0e0e0;
        padding: 0px 0 4px;
        z-index: 99999; /* Cao nhất để không bị đè */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        position: fixed !important;
    }

    /* Mobile menu items */
    .mobile-menu-item {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .mobile-menu-link,
    .mobile-menu-trigger {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #333333;
        background: none;
        border: none;
        padding: 10px 8px;
        width: 100%;
        transition: color 0.3s ease;
        cursor: pointer;
        position: relative;
        z-index: 10;
    }

    .mobile-menu-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 2px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative; /* Cần relative cho absolute icons */
    }

    .mobile-menu-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-icon {
        position: relative;
    }

    .mobile-menu-icon .mobile-icon-normal {
        opacity: 1;
    }

    .mobile-menu-icon .mobile-icon-active {
        opacity: 0;
        position: absolute;
        top: 0;
        left: 0;
    }

    /* Hover states cho TẤT CẢ menu items */
    .mobile-menu-item:hover .mobile-icon-normal {
        opacity: 0;
    }

    .mobile-menu-item:hover .mobile-icon-active {
        opacity: 1;
    }

    /* Active states cho TẤT CẢ menu items */
    .mobile-menu-item.active .mobile-icon-normal {
        opacity: 0;
    }

    .mobile-menu-item.active .mobile-icon-active {
        opacity: 1;
    }

    /* Đảm bảo active states HOẠT ĐỘNG với !important */
    .mobile-menu-item.active .mobile-icon-normal {
        opacity: 0 !important;
    }

    .mobile-menu-item.active .mobile-icon-active {
        opacity: 1 !important;
    }

    /* Specific cho home để chắc chắn */
    .mobile-menu-item[data-menu="home"].active .mobile-icon-normal {
        opacity: 0 !important;
    }

    .mobile-menu-item[data-menu="home"].active .mobile-icon-active {
        opacity: 1 !important;
    }

    /* Overlay trigger buttons khi active */
    .mobile-menu-item[data-menu="dichvu"].active .mobile-icon-normal,
    .mobile-menu-item[data-menu="danhmuc"].active .mobile-icon-normal {
        opacity: 0 !important;
    }

    .mobile-menu-item[data-menu="dichvu"].active .mobile-icon-active,
    .mobile-menu-item[data-menu="danhmuc"].active .mobile-icon-active {
        opacity: 1 !important;
    }

    /* Single icon không đổi */
    .mobile-menu-icon .mobile-icon-single {
        opacity: 1 !important;
    }

    /* Đảm bảo khi KHÔNG active thì icon normal hiện */
    .mobile-menu-item:not(.active) .mobile-icon-normal {
        opacity: 1 !important;
    }

    .mobile-menu-item:not(.active) .mobile-icon-active {
        opacity: 0 !important;
    }

    /* Specific cho overlay triggers khi không active */
    .mobile-menu-item[data-menu="dichvu"]:not(.active) .mobile-icon-normal,
    .mobile-menu-item[data-menu="danhmuc"]:not(.active) .mobile-icon-normal {
        opacity: 1 !important;
    }

    .mobile-menu-item[data-menu="dichvu"]:not(.active) .mobile-icon-active,
    .mobile-menu-item[data-menu="danhmuc"]:not(.active) .mobile-icon-active {
        opacity: 0 !important;
    }

    .mobile-menu-text {
        font-size: 10px;
        font-weight: 500;
        text-align: center;
        line-height: 1.2;
    }

    /* Active state for menu items - chỉ border-top đơn giản */
    /* Active state với border-top */
    .mobile-menu-item.active {
        border-top: 2px solid #1f8538 !important;
    }

    /* Đảm bảo KHÔNG active thì KHÔNG có border */
    .mobile-menu-item:not(.active) {
        border-top: none !important;
    }

    .mobile-menu-item.active .mobile-menu-text {
        color: #00a600;
        font-weight: 600;
    }

    /* Overlay Styles */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-menu-overlay.fullscreen-overlay {
        top: 0 !important;
        height: 100vh !important;
        background: transparent;
    }

    .mobile-menu-overlay.fullscreen-overlay #danhmuc-overlay {
        background: #00a600;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-overlay-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        max-height: 85vh;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .mobile-menu-overlay-content.fullscreen-content {
        top: 0;
        bottom: 60px;
        left: 0;
        right: 0;
        border-radius: 0;
        max-height: calc(100vh - 60px);
        padding-top: 60px;
    }

    .mobile-menu-overlay-content.mobile-overlay-green {
        background: #00a600;
    }

    .mobile-menu-overlay.active .mobile-menu-overlay-content {
        transform: translateY(0);
    }

    .mobile-menu-overlay.active .mobile-menu-overlay-content.fullscreen-content {
        transform: translateY(0);
    }

    /* Green overlay for Danh mục */
    #danhmuc-overlay .mobile-menu-overlay-content {
        background: #00a600;
    }

    #danhmuc-overlay .mobile-menu-overlay-header h3 {
        color: #ffffff;
    }

    #danhmuc-overlay .mobile-menu-close {
        color: #ffffff;
    }

    .mobile-menu-overlay-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #e0e0e0;
    }

    .mobile-menu-overlay-content.fullscreen-content .mobile-menu-overlay-header {
        display: none;
    }

    .mobile-menu-overlay-content.fullscreen-content .ux-block-container {
        height: calc(100vh - 160px); /* Giữ lại không gian cho menu bar */
        overflow-y: auto;
        margin-top: 20px;
    }

    .mobile-menu-close.fullscreen-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: transparent;
        border: none;
        font-size: 28px;
        color: #333333;
        z-index: 10;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s ease;
    }

    .mobile-menu-close.fullscreen-close:hover {
        background-color: rgba(0, 0, 0, 0.1);
    }

    .mobile-overlay-green .mobile-menu-close.fullscreen-close {
        color: #ffffff;
    }

    .mobile-overlay-green .mobile-menu-close.fullscreen-close:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    /* Đảm bảo menu bar luôn visible khi overlay active */
    body.mobile-menu-open #mobile-menu-bar {
        display: flex !important;
        z-index: 10001 !important;
    }


    #danhmuc-overlay .mobile-menu-overlay-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .mobile-menu-overlay-header h3 {
        font-size: 18px;
        font-weight: bold;
        margin: 0;
        color: #333333;
    }

    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #333333;
        padding: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background-color 0.3s ease;
    }

    .mobile-menu-close:hover {
        background-color: rgba(0, 0, 0, 0.1);
    }

    #danhmuc-overlay .mobile-menu-close:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    /* Menu content styles */
    .mobile-overlay-menu .mobile-overlay-menu-green {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-overlay-menu li {
        margin-bottom: 15px;
    }

    .mobile-overlay-menu li:last-child {
        margin-bottom: 0;
    }

    .mobile-overlay-menu li a {
        display: flex;
        align-items: center;
        padding: 12px 0;
        color: #333333;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        border-bottom: 1px dotted #ddd;
        transition: color 0.3s ease;
    }

    .mobile-overlay-menu li:last-child a {
        border-bottom: none;
    }

    .mobile-overlay-menu li a::before {
        content: '›';
        margin-right: 10px;
        color: #00a600;
        font-weight: bold;
        font-size: 18px;
    }

    /* Green menu styles */
    .mobile-overlay-menu-green li a {
        color: #ffffff;
        border-bottom-color: rgba(255, 255, 255, 0.2);
    }

    .mobile-overlay-menu-green li a::before {
        color: #ffffff;
    }

    .mobile-overlay-menu-green li:last-child a {
        border-bottom: none;
    }

    /* Service overlay content styling */
    .dichvu-item {
        display: flex;
        align-items: center;
        padding: 15px 0;
        border-bottom: 1px dashed #ddd;
    }

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

    .dichvu-icon {
        width: 40px;
        height: 40px;
        background: #00a600;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 15px;
        flex-shrink: 0;
    }

    .dichvu-icon.white {
        background: #ff6b6b;
    }

    .dichvu-icon.orange {
        background: linear-gradient(135deg, #ff9a56, #ffad56);
    }

    .dichvu-icon svg {
        width: 20px;
        height: 20px;
        fill: white;
    }

    .dichvu-content h4 {
        font-size: 16px;
        font-weight: bold;
        margin: 0 0 5px 0;
        color: #333333;
    }

    .dichvu-content p {
        font-size: 14px;
        color: #666666;
        margin: 0;
        line-height: 1.4;
    }
	button.mobile-menu-trigger {
    margin: 0px;
	}
}

/* Add some spacing to prevent content overlap */
@media only screen and (max-width: 767px) {
    body {
        padding-bottom: 60px;
    }
}
