/* Ẩn mặc định */
.abm-mobile-bottom-menu {
    display: none;
}

/* Hiện trên mobile */
@media (max-width: 767px) {
    .abm-mobile-bottom-menu {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #ddd;
        padding: 8px 0;
        z-index: 9999;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    }

    .abm-mobile-bottom-menu .menu-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        color: #222;
        text-decoration: none;
        width: 20%;
    }

    .abm-mobile-bottom-menu .menu-icon {
        padding: 6px 12px;
        border-radius: 999px; /* Bo tròn dài như viên thuốc */
        background-color: transparent;
        transition: background-color 0.3s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 4px;
    }

    .abm-mobile-bottom-menu .menu-icon img {
        width: 28px;
        height: 28px;
        display: block;
    }

    /* Chỉ icon được bo màu khi active */
    .abm-mobile-bottom-menu .menu-item.active .menu-icon {
        background-color:white;
    }

    .abm-mobile-bottom-menu .menu-text {
        line-height: 1;
        text-align: center;
    }
}

/* Ẩn toàn bộ menu và panel trên desktop */
.abm-mobile-bottom-menu,
#abm-danhmuc-panel {
    display: none;
}

/* Mobile only */
@media (max-width: 768px) {
    .abm-mobile-bottom-menu {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        border-top: 1px solid #ccc;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        z-index: 9999;
    }

    .menu-item {
        text-align: center;
        font-size: 12px;
        text-decoration: none;
        color: #000;
        flex: 1;
    }

    .menu-icon img {
        width: 22px;
        height: 22px;
        display: block;
        margin: 0 auto 4px;
    }

    .menu-text {
        display: block;
    }

    /* Hộp danh mục full màn hình */
    #abm-danhmuc-panel {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 92%;
        background: #fff;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 9998;
        padding: 20px 0;
    }
	
	#abm-danhmuc-panel {
		max-height: 95vh;  /* Chiều cao tối đa, tránh che status bar */
		overflow-y: auto;
		-webkit-overflow-scrolling: touch; /* Cho mượt trên iOS */
	}

    #abm-danhmuc-panel.active {
        display: block;
        transform: translateY(0);
    }

    .abm-danhmuc-item {
		position: relative;
		color: #008df2;
		padding: 14px 20px;
		font-weight: bold;
		border-bottom: 1px solid #ddd;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-wrap: wrap; /* ✅ Quan trọng: để nội dung submenu xuống dòng */
	}

	.abm-danhmuc-item .arrow-icon {
		font-size: 14px;
		color: #008df2;
		transition: transform 0.3s ease;
		display: inline-block;
	}

	.abm-danhmuc-item .arrow-icon.rotated {
		transform: rotate(90deg);
	}
	
	.abm-submenu a {
		display: block;
		padding: 10px 0;
		border-bottom: 1px solid #eee;
		font-weight: normal;
		color: #008df2;
		text-decoration: none;
	}

	.abm-submenu a:hover {
		color: #0066cc;
	}

	/* SUBMENU */
	.abm-submenu {
		display: none;
		width: 100%;
		padding: 0 10px;
	}

	.abm-submenu.active {
		display: block;
	}

	.abm-submenu div {
		padding: 10px 0;
		border-bottom: 1px solid #eee;
		font-weight: normal;
	}
}
